Skip to content

feat(tui): edit a widget's label with e - #666

Merged
sirmalloc merged 2 commits into
sirmalloc:mainfrom
eric-engberg:feat/label-key-e
Oct 9, 2026
Merged

sirmalloc merged 2 commits into
sirmalloc:mainfrom
eric-engberg:feat/label-key-e

Conversation

@eric-engberg

Copy link
Copy Markdown
Contributor

What

The line editor's label editor (#601) opens with e, shown as (e)dit label…, instead of b (la(b)el…).

Why

e already means "edit this widget's text" in the line editor:

Widget Key Help text
Custom Text e (e)dit text
Custom Command e (e)dit cmd
Custom Symbol e (e)dit symbol
Link e (e)dit text
Every labeled widget, before b la(b)el…
Every labeled widget, now e (e)dit label…

Editing a label is the same kind of action, so one key covers both. (e)dit label… also reads more plainly than la(b)el…, whose mnemonic letter sits mid-word.

l, the other natural choice, stays out of it for the reason the code already gave: the reset timers bind (l)ocale.

How

  • LABEL_KEYBIND in raw-or-labeled.ts is now e, with the label (e)dit label….
  • No key clash: none of the four widgets that bind e has a label, so e is free wherever the label editor appears. The existing test that every widget declaring a label prefix leaves the label key unbound, in every mode, now runs against e and passes.
  • No new behavior: the label editor, the hidden-in-raw-mode rule and the (label: "…") row note don't change.
  • Docs: docs/USAGE.md lists the new key in both places it mentions the label key.

Demo

The line editor on a Custom Text, then Model, which is relabeled to M . Before, Custom Text edits with e but Model's label opens with b; after, both use e. The model name is the TUI's sample.

Before (Powerline)

Label key b, Powerline

After (Powerline)

Label key e, Powerline

Before (plain)

Label key b, plain

After (plain)

Label key e, plain

Testing

  • Tests, changed first and seen failing (7 failures):
    • raw-or-labeled.test.ts: a new test that the label keybind is e / (e)dit label….
    • ItemsEditor.test.ts: the label editor tests press e and look for (e)dit label….
    • widgets.test.ts: the check that labeled widgets leave the label key free picks up e without changes.
  • Bun: bun test gives 2777 pass, 0 fail (Bun 1.4.2). bun run lint is clean. A 12-run loop of ItemsEditor.test.ts had no failures.
  • Node 26 vitest: the 3 touched test files pass (53 tests).
  • On today's main (with docs: explain an empty status line in one folder (workspace trust) #606 and feat(git-is-fork): render forks as an editable glyph #617): merging it in is clean, bun run lint is clean and bun test gives 2783 pass, 0 fail. No widget added since binds e.

The label editor opened with b (la(b)el…). Custom Text, Custom Command,
Custom Symbol and Link already open their text editors with e, so the
line editor's "edit this widget's text" key differed by widget. Labels
now use e too, shown as (e)dit label…, which also reads more plainly.

None of the widgets that bind e has a label, so e is free wherever the
label editor appears; the existing check that labeled widgets leave the
label key unbound now runs against e.
The label key moved to e, but one sentence still said b is hidden while
raw value is on.
@sirmalloc
sirmalloc merged commit 994dd68 into sirmalloc:main Oct 9, 2026
3 checks passed
@eric-engberg
eric-engberg deleted the feat/label-key-e branch October 9, 2026 22:23
pcvelz added a commit to pcvelz/ccstatusline-usage that referenced this pull request Oct 11, 2026
Upstream: label prefixes editable with e (sirmalloc#601, sirmalloc#666), Session Cost Rate (sirmalloc#671) and Extra Usage Daily Budget (sirmalloc#672) widgets, own-lock-only usage lock clearing (sirmalloc#624), NO_PROXY and request deadlines, terminal control-sequence sanitizing, git hardening and linear-time parsing, shared searchable option editor (sirmalloc#649) and widget base classes (sirmalloc#646-sirmalloc#654), node: imports (sirmalloc#657), Number.* globals lint (sirmalloc#645), test waits on redraw instead of fixed delays (sirmalloc#652).

Hand edits outside conflicts:
- src/widgets/shared/searchable-option-editor.tsx: compat fix - ports the fork's ref-based input handling (Enter picks from what was just typed) into upstream's new shared editor
- src/utils/usage-fetch.ts: compat fix - fork's fetchFreshUsageData uses upstream's clearOwnUsageLock (sirmalloc#624) instead of the removed clearUsageLock
- src/widgets/ApiUsage.tsx, src/widgets/Battery.ts: compat fix - Number.isNaN/Number.parseInt for upstream's no-restricted-globals rule
- src/utils/__tests__/usage-prefetch.test.ts: compat fix - mock renamed to upstream's mockFetchUsage
- src/tui/components/__tests__/PowerlineSetup.test.ts, src/tui/components/__tests__/StatusLinePreview.test.ts, src/tui/components/__tests__/TerminalWidthMenu.test.ts: compat fix - drop the fork's flushInk import, unused after upstream's waitFor switch
- README.md: upstream notes linked docs/USAGE.md (deleted in the fork); inlined the proxy and workspace-trust text instead; upstream's own release-note entries not taken
- .fork-keep-deleted: src/widgets/FableWeeklyUsage.ts (upstream widget, unregistered in the fork, which ships WeeklyFableUsage.ts)
- src/widgets/WeeklyFableUsage.ts: compat fix - adopts upstream's shared getUsagePercentWidgetEditorDisplay, which carries the time-cursor modifier
- src/tui/__tests__/App.test.ts: fork deviation - one extra down-arrow for the fork's Off Hours main-menu row
- src/widgets/__tests__/CacheTimer.test.ts, src/widgets/CacheTimer.ts: compat fix - emoji toggle moved from e to o because upstream reserves e for edit-label
- src/widgets/AgentAddress.ts: split the session-title guard into its own if (same behaviour) so the .fork-invariants nameSource guard matches again
- docs/test-retirements.md: ledger for tests upstream renamed or replaced
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