Repository navigation
Conversation
Replace the Spotlight-style list with a Launchpad/Dock-style grid: four tiles to a row, each with a generated app icon (a rounded square in the rice's new ACCENT colour with the initial of its name), the name and the compositor underneath, and a Dock-style dot under the current rice. The header has a "Switch Desktop" title and a search pill, the arrow keys move around the grid, and the footer says that switching logs out. The glass is neutral; only the tiles carry colour. Visual only: selection, cancel and validation are unchanged. Fixes #80
Schnee111
left a comment
There was a problem hiding this comment.
Autonomous Code Review
Verdict: Approved
Target Commit: 44b58f7
Summary
Redesign of the rice-switch menu into an app-tile grid layout is well-structured, securely handles dynamic SVG generation with atomic writes, and updates Rofi arguments and test suites cleanly.
Recommendations
- In
bin/rice-switch(rice_icon), apply uppercase before escaping (initial="$(markup_escape "${initial:0:1}")"vs${initial^^}): if an initial ever contains&or<, uppercasing post-escape turns&/<into invalid XML entities&/<. - In
tests/rice-switch.sh(line 86), useicon="${XDG_CACHE_HOME:-$HOME/.cache}/rice-switch/end4.svg"instead of hardcoding$HOME/.cacheto avoid test failures in environments that exportXDG_CACHE_HOME. - In
common/rofi/rice-switch.rasi,textbox { horizontal-align: 0.5; text-color: @text-dim; }applies to all textbox widgets includingtextbox-title. Scope footer styling tomessage textboxor explicitly specifyhorizontal-align: 0.0;andtext-color: @text;ontextbox-titleto prevent unexpected centering or dimming of the header title. - In
rice_iconSVG template, consider appending a generic font fallback (font-family="Google Sans Flex, sans-serif") for systems where Google Sans Flex is not installed.
Shorekeeper Sentinel · Autonomous Quality Gate
Uppercase the initial before escaping it, add font fallbacks to the tile SVG, honour XDG_CACHE_HOME in the test, and give the header title its own alignment and colour so the footer's textbox rule cannot reach it. (rofi does not match a `message textbox` selector, so the footer keeps the plain `textbox` rule.)
|
Review follow-ups in 7ec3393:
|
Schnee111
left a comment
There was a problem hiding this comment.
Autonomous Code Review
Verdict: Changes Requested
Target Commit: 7ec3393
Summary
The redesign cleanly implements the app-tile grid and atomic SVG icon generation, but uses an invalid Rofi property name (content instead of str) on the header title widget, causing the "Switch Desktop" title to render completely blank.
Logic & Invariants
- common/rofi/rice-switch.rasi:56:
textbox-titlespecifiescontent: "Switch Desktop";instead ofstr: "Switch Desktop";. Rofi textbox widgets do not support the CSScontentproperty; Rofi silently ignores it and looks forstrwhen rendering static text, causing the header title widget to remain empty.
Recommendations
- In
common/rofi/rice-switch.rasiline 56, replacecontent: "Switch Desktop";withstr: "Switch Desktop";so Rofi correctly displays the title in the header.
Shorekeeper Sentinel · Autonomous Quality Gate
|
The The title also renders in practice. Live screenshots of |
|
Closing without merging: the grid of icon tiles is not the direction we want. The redesign continues as a row list without icons in a new PR for #80. |
Fixes #80
What this changes
Visual only. Selection by row index, Esc/cancel handling and rice name validation are unchanged; the diff touches none of
-format i,-no-customor thechoicehandling.The menu from #77 was a restyled vertical list. This replaces it with a grid of app-style tiles, as in macOS Launchpad or the Dock.
common/rofi/rice-switch.rasi, rewritten:rgba(30, 30, 34, 66%)with a 1 pxrgba(255, 255, 255, 14%)border and a 26 px radius, 664 px wide. It no longer importscolors.rasi, because the tiles carry the colour.Inter Display Semi-Bold 16) on the left and a rounded search pill on the right. Typing still filters, matches are shown in bold rather than underlined, and the panel keeps its size (fixed-height).flow: horizontal. Each tile has a 68 px icon, then the name, the compositor and the dot. The hover/selection state is a softrgba(255, 255, 255, 11%)tile.kb-row-left/right). The entry keepsCtrl+B/Ctrl+Ffor moving the cursor.Switching logs you out · ↵ switch · esc cancel.bin/rice-switch:rice_iconwrites~/.cache/rice-switch/<rice>.svg: a rounded square in the rice'sACCENT, with a light sheen and a hairline edge, and the initial ofDISPLAY_NAMEinGoogle Sans Flex. It is rewritten on every open (eight small files), so a cache can never be stale.\x1e, because\x1fbelongs to the row option, and are written withprintf, because a NUL cannot live in a bash string.-lis now the number of grid rows (ceil(rices / 4)).Metadata: every
rice.confgetsACCENT, a macOS system colour: indigo, blue, purple, teal, orange, graphite, pink, green. The README template documents it.Tests:
tests/rice-switch.shchecks:ACCENTand initial;tests/rice-metadata.shrequiresACCENTto be#RRGGBB.Verification
bash tests/run.sh: all test files pass.shellcheck -S warningis clean.rofi -dump-themeparses the theme.bin/rice-switchfrommain,tests/rice-switch.shfails withexpected 8 rows, got 0.bin/rice-switch -n. Screenshots were checked by hand:Downmoves from end4 to Noctalia;vitleaves only Vitreus;Escapeexits 0 with no output.Risk
Low. Until the next install links the new theme, the
display.rasifallback shows the three-line tiles in the old list layout. On rices without a blur rule for therofilayer, the panel is a 66 % dark translucent box.