Skip to content

Desktop polish: dark canvas, Linux window chrome, frosted popups, motion, Recent menu - #177

Open
dragosol wants to merge 1 commit into
storytold:mainfrom
dragosol:desktop-polish
Open

dragosol wants to merge 1 commit into
storytold:mainfrom
dragosol:desktop-polish

Conversation

@dragosol

Copy link
Copy Markdown

Summary

Desktop polish from running GridCraft daily on Fedora 44 / GNOME 50 (Wayland, 4K). Everything lives in crates/ui-egui plus window options in apps/gridcraft; colours still come from theme::Tokens, and nothing changes for the engine, CLI, MCP or control channel. It's one commit, but the pieces are independent, so feel free to take only some of them. A list of what's here:

A dark mode that's actually dark

  • Dark tokens become near-black teal surfaces with hairline borders and a brighter green accent.
  • The sheet canvas is dark too. Upstream dark mode keeps a white grid with black text.
  • Workbook colours are drawn through theme::adapt. In dark mode it mirrors HSL lightness and keeps hue and saturation, so black text reads light, white fills go near-black, and a cell's text keeps its contrast against its fill. This also covers charts, data bars, number-format colours, note and validation popups, filter buttons and the in-cell editor. Light mode is untouched.
  • set_canvas_dark runs each frame from the effective theme, so it follows the new System appearance (Add System appearance alongside Light and Dark themes #96).

Linux window chrome

  • The window is undecorated, and the existing title bar row becomes the title bar. It has the app mark, Recent, Save, Undo/Redo (right-click for undo history), and a "…" menu that now holds AutoSave, Share and the old quick commands. The title sits in the centre, with Search, Comments and hairline minimize/maximize/close on the right.
  • Rounded, anti-aliased window corners (transparent window and clear colour). Corners go square when maximized.
  • Every panel sits on one solid rounded backdrop, so seams between panels never show the desktop through.
  • Resize handles on the edges and corners via ViewportCommand::BeginResize.
  • 4× MSAA for icon strokes and shapes.

Frosted glass for floating surfaces (glass.rs)

  • Menus, popups, dialogs and tooltips get a translucent tint over a blur of the sheet beneath them, plus a specular rim along the top edge.
  • No compositor support is needed. The background layer's shapes are replayed under each surface as a 17-tap running average. It's cheap, and only runs while something is open.

Motion

  • Zero-bounce eased helpers (theme::glide, glide_rect, fade, hover_fill).
  • The selection frame glides between cells. It's anchored to sheet coordinates, so scrolling never lags.
  • Ribbon and sheet-tab underlines slide between tabs.
  • Hover and press states fade in and out on every ribbon widget.
  • Ribbon content eases in when switching tabs.

Recent workbooks

  • A Recent menu in the title bar, also used on the Start screen. Each entry shows the file name with its folder, and missing files are greyed out.
  • Any workbook with a path is recorded, however it was opened or saved.
  • ui.json is written as soon as the list changes. Previously the list was saved only on a clean exit.

Smaller theme touches

  • Floating thin scroll bars, slim slider handles, and consistent 6/10/12 px corner radii.
  • The status-bar zoom slider is tidied up.

Not included, because other PRs already cover these: listing and rendering installed system fonts (#9), separate native windows per workbook (#171 and #27), and non-Latin font fallbacks (#38, #103, #147).

Testing

  • cargo xtask ci passes locally (fmt, clippy -D warnings, tests, assets, layers, wasm).
  • New unit tests cover the dark-canvas colour mapping and the glass tap layout and averaging.
  • Checked in a running build on Fedora 44 / GNOME 50 (Wayland, 3840×2160) through the control channel's ui.screenshot. Window corners are transparent with no gaps inside the window, and the frosted popups and dialogs were checked over charts.
  • This branch also renders cleanly through the offscreen snapshot example in both light and dark.
  • Not tested on macOS or Windows. The window changes are behind cfg(target_os = "linux"), and the theme and motion changes are platform-neutral.

🤖 Generated with Claude Code

…ion, Recent menu

- Dark mode draws a dark sheet; workbook colours are mapped by mirrored lightness
  (theme::adapt), following the System appearance.
- Linux: undecorated window with our title bar, window controls, rounded corners,
  edge resizing and one solid backdrop under all panels; 4x MSAA.
- Menus, popups and dialogs are frosted glass over the content beneath (glass.rs).
- Eased, zero-bounce motion: selection glide, sliding tab underlines, hover fades.
- Recent workbooks menu in the title bar and on the Start screen, saved as it changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 10, 2026

Copy link
Copy Markdown
Member

Thank you — there's a lot of polish here. Changing the default look for everyone (dark palette, dark canvas that recolours workbook colours, frameless transparent window on Linux, frosted glass, motion) is a product decision we're holding for the maintainers. Independently of that: the glass pass re-adds every background shape 17 times per open popup per frame, which is expensive on large sheets, and the branch conflicts in 9 files.

Would you split it? The Recent menu (with preferences saved without a global static Mutex) and the resize handles could land on their own; the theme/canvas/glass/chrome changes can follow once the direction is agreed.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft — happy to talk any of this through there.

@Harrison-Booth

Copy link
Copy Markdown
Contributor

Hi @dragosol, thanks for this PR. GitHub currently reports a merge conflict between this branch and main (I checked the PR's merge status only; I haven't built or tested it). If it would help, I'm happy to merge the latest main into your branch and resolve the conflicts. Your branch allows maintainer edits, so I'd push a merge commit (no rebase or force-push). Just reply here and say so, or go ahead and update it yourself if you prefer. If we don't hear back, I'll leave it as is for now.

MihailCosmin added a commit to MihailCosmin/gridcraft that referenced this pull request Nov 5, 2026
…lay theme Dark leaves the cells alone

Reverses H3 at the user's request: the shape upstream maintainers are likely
to accept, since changing the default look for everyone is their decision
(PR storytold#177). Restores the code and docs of 41750be^; Dark sheet and
Animations share one row in the View tab so the group fits the card (N1).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFa1DitgUd9yV4AvGTW7AX

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants