Skip to content

feat: add simple palette mode with basic variant filtering - #186

Merged
StephenTangCook merged 4 commits into
mainfrom
claude/load-message-block-selector-65gwxk
Aug 15, 2026
Merged

feat: add simple palette mode with basic variant filtering#186
StephenTangCook merged 4 commits into
mainfrom
claude/load-message-block-selector-65gwxk

Conversation

@StephenTangCook

@StephenTangCook StephenTangCook commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional "simple" palette mode that opens on a flat list of variants flagged basic (in the built-in palette, just Rich Text Section), with no search box. An "Advanced" link at the top swaps in the full sectioned palette with search. Nothing is removed — it's a smaller first screen for ordinary messages.

Why

Users writing a typical message only need the Rich Text Section block. The full palette with all its sections and search can feel overwhelming on first encounter. This change lets callers opt into a gentler onboarding experience that doesn't hide any features — they're just behind a clearly labeled link.

A custom palette can opt its own variants into the simple list by setting basic: true on them. A palette with no basic variants stays in advanced mode automatically.

Changes

  • Palette component: Added mode prop ('advanced' | 'simple'). In simple mode, renders a flat list of basic variants with an "Advanced" link that toggles to the full palette. The link includes a tooltip explaining what's on the other side.
  • PaletteVariant interface: Added optional basic boolean flag to mark variants for inclusion in simple mode.
  • defaultPalette: Marked the Rich Text Section variant as basic: true and updated its label to "Rich Text Section" (self-describing since it appears without a section heading in simple mode).
  • BlockKitchen component: Wired through the new paletteMode prop to the Palette component.
  • PaletteMode type: New exported type for the mode option.
  • LoadMessageDialog: Moved the not-editable verdict callout above the scrolling preview card (so it stays visible while the message scrolls) and disabled the load button when the verdict offers an action ("Open as new" or "Sign in"), making the callout's button the primary path forward.
  • SlackMark component: New SVG icon for the Slack sign-in button.
  • Tests: Added comprehensive test suite (palette-modes.test.tsx) covering simple mode rendering, toggling, search clearing, and custom palettes. Updated LoadMessageDialog tests to verify the new verdict callout positioning and button disable logic.
  • Storybook stories: Added SimpleMode, SimpleModeAdvancedLink, and SimpleModeWithoutBasicVariants stories demonstrating the feature.
  • Documentation: Updated README with paletteMode prop and new "Simple vs advanced palette" section.

Test plan

  • pnpm typecheck — new PaletteMode type and prop signatures
  • pnpm lint — code style
  • pnpm test — new palette-modes.test.tsx suite covers simple mode toggling, search clearing, custom palettes, and verdict button disable logic; existing tests updated for verdict callout repositioning
  • Spot-checked in pnpm storybookSimpleMode, SimpleModeAdvancedLink, and SimpleModeWithoutBasicVariants stories verify UI and interactions

https://claude.ai/code/session_01UDKJELLHkb1HryHes5J843


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…fixes

Load-message dialog:
- Move the not-editable callout out of the scrolling preview card and up
  under the PREVIEW header, so it stays put while the message scrolls. A
  verdict with no blocks now says "Nothing to preview." rather than
  leaving an empty card behind the callout.
- Disable the footer's "Load message" button whenever that callout owns
  the next step (sign in, or open as a new message) — the host has said
  the message can't be loaded, so the callout's button is the way
  forward. A bare no-match verdict keeps the button live for a retry.

Toolbar:
- Swap the "Find message" icon for Slack's four-colour mark, inlined as
  an SVG (same 3.5 box as the icons beside it).

Palette:
- Rename the Rich Text "Section" variant to "Rich Text Section": simple
  mode lists it without its section heading, so the label carries it.
- Add `paletteMode` ('advanced' default | 'simple'). Simple mode opens on
  a flat list of the variants flagged `basic` — no sections, no search —
  behind an "Advanced" link whose tooltip says what's on the other side;
  the same link leads back. A palette flagging no `basic` variants has no
  simple list to show, so it stays advanced and the link is withheld.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDKJELLHkb1HryHes5J843
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
block-kitchen 88c8850 Commit Preview URL

Branch Preview URL
Aug 15 2026, 05:21 PM

- Add a "Palette" header selector so the playground can switch the builder
  between advanced (package default) and simple palette modes — the
  feature was invisible in the demo, which passes no `paletteMode`.
- Reset the palette's expansion and search when a host flips `paletteMode`
  at runtime, so the new mode starts from the top instead of inheriting
  the old one's state (adjusted during render, not in an effect).
- Turn the demo's edit-mode menu into a plain "Mode" dropdown beside the
  other header selectors, and move its contents into a "Sample Data"
  dialog reachable in either mode — the message store is what a reader
  needs in order to choose a mode, so it shouldn't be behind one. In
  write-only mode the dialog says what that mode does with the store.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDKJELLHkb1HryHes5J843
@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

✅ Deployed 88c8850 · Branch preview · Commit preview · Build logs

claude added 2 commits August 15, 2026 17:09
Simple mode's header was a lone right-aligned "Advanced" link over empty
space, with nothing naming what the rail below held. Pair it with a
muted title so the row reads as a pane header. Rendered only where the
mode switch is — a palette that opens straight onto its named sections
is already self-describing and keeps its untitled header.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDKJELLHkb1HryHes5J843
It's exported from the root entry but appeared nowhere in the docs — no
props table, no example, not even in the exports list. Adds a Templates
section covering the props, the consumer-owned `Template` shape, why the
package ships none of its own, how a selection gets applied (`onSelect`
hands back the template; re-seeding needs a `key` bump because
`initialBlocks` is mount-only), and the `.bk-root` ancestor the scoped
stylesheet requires — the one that silently renders it unstyled.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UDKJELLHkb1HryHes5J843
@StephenTangCook
StephenTangCook merged commit 3f2c329 into main Aug 15, 2026
14 checks passed
@StephenTangCook
StephenTangCook deleted the claude/load-message-block-selector-65gwxk branch August 15, 2026 17:21
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.

2 participants