Skip to content

Make the blocks palette and list insertion easier to use (#1484) - #1489

Merged
amyjko merged 1 commit into
mainfrom
palette-and-list-insertion
Nov 8, 2026
Merged

amyjko merged 1 commit into
mainfrom
palette-and-list-insertion

Conversation

@amyjko

@amyjko amyjko commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Context

#1484 reported four problems with the blocks-mode code palette. The reporter later added that he couldn't figure out how to add another number to a list. Each report was verified in the code and in a headless browser before changing anything.

Palette (Sidebar.svelte, conceptGroups.ts, ConceptPreview.svelte, Wellspring.svelte)

  • Closed on a near miss. Any press on non-interactive space toggled the sidebar, including the gaps between blocks and the scrollbar. Annotations had the same bug. The whole-bar toggle now works only while the bar is collapsed; an open sidebar closes from its arrow.
  • Look-alike entries. Name and Reference both rendered as name, Input and Bind as name: value, a Dimension as name, Markup/Paragraph/Words as …, PatternLiteral/PatternType as ⣿⣿, Program/Source as _, and Text/Translation as ''.
    • isPaletteConcept leaves the fragments out, and getPaletteGroups moves Words, PatternType and Translation to "etc.".
    • This happens in the palette only: getPurpose() is unchanged, because purpose also ranks the editor's insert menu, where Advanced comes last.
  • Tiny targets. Nodes whose block kind is none/type (0, unit, ‥) draw no box, and the palette also stripped their padding. In the palette they are now framed, and every entry is at least --wordplay-target-size (WCAG 2.5.8).
  • The "unknown emoji" is This (⬚, U+2B1A). It renders correctly and now sits in a framed box like the others.

List insertion (NodeSequenceView.svelte, Editor.svelte, Menu.ts, UnitView.svelte)

  • Clutter around the "+". [1 2 3] rendered as 1 ▾ ▾ 2 ▾ ▾ 3 ▾ ▾ +. Both ▾ belonged to the number's empty Unit: one for its numerator, one for its slash. The slash ▾ now appears only once a unit has a numerator.
  • "+" now adds an empty slot. In a list that holds expressions, "+" appends an ExpressionPlaceholder and selects it, so typing fills it in: appendSlot on the editor context, via the existing Append revision. Its position computation moved into a shared getInsertionPosition. Lists of other kinds keep the menu.
    • The caret announcement speaks the new slot.
    • The "+" has a new label, ui.source.menu.append ("add an item"), translated into all locales.
  • The menu ranks by siblings. Before, the menu began with Outputs, with Numbers fifth. When every item in the list is the same kind, it now leads with one more of it, written the same way (0, not π), and ranks that purpose first. Mixed lists keep today's order.

Before/after screenshots of every change, in light and dark: https://claude.ai/artifact/VKnG71qvu9bfUezoT3KWbh. It's private until shared.

Related issues

Verification

  • Gates. npm run check:now, npm run test:run, npm run test:sweep, npm run locales, npm run rtl and npm run tokens all pass.
  • New unit tests.
    • No palette category has two entries that render the same.
    • Words, PatternType and Translation appear under "etc.".
    • The menu for an insert into [1 2 _] (and for its placeholder) leads with a plain numeral and ranks Numbers before Outputs, while a mixed list keeps the usual order. These tests fail with the ranking disabled.
  • Headless Chromium against the dev server.
    • A press on a gap, a heading or the scrollbar keeps the palette open, the arrow still closes it, and a press on the collapsed bar opens it.
    • Framed entries measure at least 24×24.
    • "+" yields [1 2 3 _] with the slot selected, and typing 4 gives [1 2 3 4].
    • The announcer said "placeholder for a value, anything".
    • [1m 2] still shows the slash ▾ on 1m.
  • Not done. The e2e suite was not run locally. Real screen-reader (VoiceOver/NVDA) and keyboard-only passes are still to do.

Checklist

  • CHANGELOG entries under 0.41.0
  • New locale string translated (≈$0.48)
  • VoiceOver pass on "+" and the palette

🤖 Generated with Claude Code

The code palette closed whenever a press missed a block, showed pairs of
concepts that render identically (Name/Reference, Input/Bind, and more),
and gave lone tokens no box to grab. An open palette now closes only from
its arrow, look-alikes are left out or moved to "etc." in the palette
only, and chromeless entries get a framed 24px target.

Adding to a list was hard to discover: the "+" opened a menu that began
with Outputs, and every number carried two unit menus. The "+" now
appends an empty slot to type into, the menu leads with more of what the
list already holds, and the slash menu appears only once a number has a
unit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@amyjko
amyjko merged commit 4628561 into main Nov 8, 2026
17 checks passed
@amyjko
amyjko deleted the palette-and-list-insertion branch November 8, 2026 05:12
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.

Drag and Drop Potential Issues

1 participant