Skip to content

Show colour schemes apart from tweaks in the stylesheet menu - #99

Open
adamXbot wants to merge 3 commits into
mainfrom
ui/sheet-groups
Open

adamXbot wants to merge 3 commits into
mainfrom
ui/sheet-groups

Conversation

@adamXbot

@adamXbot adamXbot commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

What it does

When a theme ships both kinds of optional stylesheet, the install menu and try --info list them in two groups: tweaks first, then colour schemes.

  Optional stylesheets  30 · pick any
    Tweaks
     1✓ compact-tabs     5. increase-contrast    9. tabs-swapclose
     2. enabletabview    6. noidentity          10. windows-swapclose
     …

    Colour schemes · pick one
    11. theme-ayu-mirage             21. theme-material-ocean
    …
    15. theme-catppuccin-mocha     › 25✓ theme-nord
    …
  • Which sheets count as colour schemes. A sheet's name starts with theme- (or theme_), or one of its words names a palette (nord, dracula, catppuccin-mocha, rose-pine …).
  • Themes with one kind. A theme that ships only one kind keeps the single list it has today, in the same order.
  • Numbering. The sheets are numbered straight through, so typed answers (1,25, all) work as before. ↑↓ move from one group into the next; ←→ stay inside a group.
  • "Pick one". The colour schemes' title says "pick one" when every pair of them clashes. This uses the same measurement install uses before refusing a pair, not the names. All 20 of WhiteSur's colour schemes clash with each other this way.
  • Only the display changes. Picked sheets are imported in the theme's own order, and --with takes the same names.

Picking two that clash

The menu used to print the clash report and say "Pick one of each pair", then ask for the whole list again. That made it look as if you were choosing a colour, not a stylesheet. Now it asks which sheet to keep:

  Keep which colour scheme?  both set the same 110 colours; only one can take effect
   1. theme-catppuccin-mocha  ██ #11111b  ██ #cdd6f4  ██ #cba6f7  ██ #6c7086
›  2. theme-nord              ██ #242933  ██ #eceff4  ██ #88c0d0  ██ #5e81ac  (Enter)

  Which one? ↑↓ or 1-2 [2]
  • Rows. Each row previews the colours that sheet would set: the most-used ones that are clearly different from each other, shown as a swatch and its hex code.
    • A terminal that sets COLORTERM=truecolor gets the exact colour.
    • A 256-colour terminal gets the nearest one.
    • Elsewhere, and with colour off, only the hex codes are shown.
  • Default. Enter keeps the sheet that loads last, the one that would have won anyway.
  • Several at once. A set of sheets that all clash is one question, so picking all with WhiteSur is one question, not 190 clash reports. A chain (a clashes with b, b with c, a and c compose) asks only about what actually clashes.
  • The result. The menu never returns a clashing set, so install carries on with the kept sheet instead of refusing.
  • --force. In the menu, --force still installs everything picked. The menu shows the clash and names --with a,b --force to repeat it.
  • --with a,b on the command line. Unchanged: it shows the report, then refuses without --force.

The clash report now wraps between words to fit the terminal, wherever it appears (install, try, upgrade and tweaks). Before, it ran past the edge and the terminal broke it mid-word.

Changes

  • inventory.is_colour_scheme(): the naming rule.
  • cli._sheet_groups(): the menu's order and groups, the single-list fallback and the "pick one" measurement.
  • cli._keep_one(): the keep question. _choose_sheets() calls it unless --force is set; cmd_install passes --force through.
  • sheets.contested() and sheets.palettes(): what each clashing sheet sets that the others set differently, and its distinct colours.
  • style.swatch(), style.colour_depth() and style.rgb(): the colour preview, at the depth the terminal supports. It is the one place fxcss shows a colour outside the 16 ANSI colours, and the hex code always shows the same information as text.
  • style.column_groups() and style.group_spans(): titled grids numbered straight through. columns and column_rows gain first and digits; their defaults leave today's output unchanged.
  • prompt.pick_many(): gains a groups argument.
  • README: the stylesheet menu example now shows the groups, explains "pick one" and shows the keep question.

Test plan

  • python3 -m unittest discover -s tests: 738 tests, 1 skipped (Python 3.14), also inside a pseudo-terminal. The new tests also pass on 3.9.
  • New tests/test_sheet_groups.py covers:
    • the naming rule;
    • grouping, and the fallback for a theme with one kind;
    • "pick one" shown only when every pair of colour schemes clashes;
    • typed numbers following the menu while the result keeps the theme's order;
    • the keep question: Enter keeps the last sheet, a typed pick keeps that one, three sheets that all clash are one question, and a chain asks only what it must;
    • hex codes in each row, and (Enter) placed just after them;
    • swatches at each colour depth, the 256-colour mapping, and palettes skipping near-identical shades.
  • InstallSheetConflictTests updated for the new flow. Every way out of the keep question (Enter, EOF, an unusable answer, a retry first) installs one sheet. --force still installs both.
  • New GroupedPickTests in tests/test_prompt.py covers:
    • titles and numbering;
    • ticks and the pointer landing in the right group without shifting the layout;
    • ↑↓ and ←→ at group edges;
    • typing a number in either group.
  • install on a local WhiteSur checkout, with a throwaway profile: picking three colour schemes asks once and installs the one kept. Picking all lists all 20 colour schemes, each with its own palette.
  • Run fxcss install AdamXweb/WhiteSurFirefoxThemeMacOS without --with and pick from both groups.

🤖 Generated with Claude Code

@adamXbot
adamXbot force-pushed the ui/sheet-groups branch 3 times, most recently from 9a72d60 to 05fc89a Compare November 8, 2026 06:04
adamXbot and others added 3 commits November 8, 2026 18:19
When a theme ships both kinds of optional stylesheet, the install menu and
try --info list them under "Tweaks" and "Colour schemes", numbered straight
through. A sheet named theme-..., or after a palette such as nord or
catppuccin-mocha, counts as a colour scheme. A theme with one kind keeps
the single list, and picked sheets are still imported in the theme's order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The colour schemes' title says "pick one" when every pair of them
measures as clashing. When someone keeps a clashing pair, the menu no
longer names a --with list that install would refuse, and install no
longer repeats the clash report the menu has already shown. The report
now wraps between words to the terminal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picking sheets that cancel each other out used to print the clash and
ask for the whole list again. The menu now asks which one to keep, shows
each sheet's main colours as a swatch and hex code, and defaults to the
one that loads last. A set that all clashes is one question. --force
still installs everything picked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamXbot
adamXbot changed the base branch from ui/arrow-key-menus to main November 8, 2026 07:19

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.

1 participant