Skip to content

feat(tui): experiments via devtools bar, drafts stay put - #41917

Merged
kitlangton merged 1 commit into
v2from
experiments-polish
Aug 12, 2026
Merged

feat(tui): experiments via devtools bar, drafts stay put#41917
kitlangton merged 1 commit into
v2from
experiments-polish

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Follow-up to #41862 based on first real use of the experiments surface:

  1. The DevTools bar is now the way in. A new Experiments item at the end of the bottom bar opens the experiments dialog. The /baldbeard easter-egg command is deleted, along with the slash.secret mechanism that existed only to hide it — it was too much special machinery for one joke.
  2. The dialog now matches the settings screen: current value in the row footer, ←/→ change hints and bindings, selection tracking — the same interaction grammar as /settings instead of a bespoke enter-to-toggle list.
  3. New session no longer steals the draft. With per-tab drafts on, <leader>n previously moved the in-progress draft into the new session. Now the new tab starts blank and the draft stays on the tab where it was written — you can always go back and copy it.

Before / After

Before: with tab_drafts enabled, typing a draft on tab two and pressing <leader>n opened the new session with the draft in its composer, and returning to tab two found it empty — the draft had been moved. Reported by Kit as "it stole my stash."

After: <leader>n opens a blank composer; returning to tab two finds the draft exactly where it was left. Draft movement between tabs is no longer a thing in either direction.

How

  • packages/tui/src/app.tsx — deletes the opencode.experiments command (and its carried-draft logic in session.new); session.new is back to the plain navigate-home it was before feat(tui): hidden experiments section with per-tab prompt drafts #41862.
  • packages/tui/src/component/devtools-bar.tsx — new Experiments BarItem that closes any open panel and opens DialogExperiments.
  • packages/tui/src/component/dialog-experiments.tsx — restyled to the DialogConfig grammar (footer value, left/right bindings, onMove selection tracking); description text updated to "New sessions start blank."
  • packages/tui/src/component/prompt/autocomplete.tsx, packages/tui/src/context/keymap.tsx, packages/plugin/src/tui/context.ts — remove the slash.secret flag and its autocomplete gate.

The draft stash itself (draft-stash.ts, per-tab keying, its tests) is untouched — new-session simply no longer reaches into it.

Scope

  • The bar item only exists while debug.devtools is on, making DevTools the sole entry point. If experiments should be reachable without DevTools later, the dialog is one dialog.replace call from anywhere.
  • Arrow-key value cycling matches /settings structurally but could not be exercised through opencode-drive (plain arrow presses do not land through the harness — the same limitation as modifier keys, confirmed against /settings itself in the same instance). Enter/onSelect toggling is verified end-to-end.

Testing

  • bun typecheck clean in packages/tui and packages/plugin; test/prompt/draft-stash.test.ts still green.
  • End-to-end via opencode-drive against this branch: /baldbeard no longer resolves; Experiments appears in the DevTools bar; clicking it opens the dialog; toggling writes experimental.tab_drafts: true; with the experiment on, a drafted-then-<leader>n flow leaves the new tab blank and preserves the draft on the original tab.

Demo

Recorded end-to-end run: DevTools bar → Experiments dialog → toggle on → draft on session one → ctrl+x n opens a blank new session → clicking back to the original tab shows the draft intact.

recording-a0823c9f-9be4-4f6c-82b1-eb6f512df96f.mp4

@kitlangton
kitlangton enabled auto-merge (squash) August 12, 2026 02:00
@kitlangton
kitlangton merged commit 1b45061 into v2 Aug 12, 2026
10 checks passed
@kitlangton
kitlangton deleted the experiments-polish branch August 12, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant