feat(tui): experiments via devtools bar, drafts stay put - #41917
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #41862 based on first real use of the experiments surface:
Experimentsitem at the end of the bottom bar opens the experiments dialog. The/baldbeardeaster-egg command is deleted, along with theslash.secretmechanism that existed only to hide it — it was too much special machinery for one joke.←/→ changehints and bindings, selection tracking — the same interaction grammar as/settingsinstead of a bespoke enter-to-toggle list.<leader>npreviously 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_draftsenabled, typing a draft on tab two and pressing<leader>nopened 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>nopens 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 theopencode.experimentscommand (and its carried-draft logic insession.new);session.newis 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— newExperimentsBarItemthat closes any open panel and opensDialogExperiments.packages/tui/src/component/dialog-experiments.tsx— restyled to theDialogConfiggrammar (footer value, left/right bindings,onMoveselection 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 theslash.secretflag 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
debug.devtoolsis on, making DevTools the sole entry point. If experiments should be reachable without DevTools later, the dialog is onedialog.replacecall from anywhere./settingsstructurally 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/settingsitself in the same instance). Enter/onSelecttoggling is verified end-to-end.Testing
bun typecheckclean inpackages/tuiandpackages/plugin;test/prompt/draft-stash.test.tsstill green./baldbeardno longer resolves;Experimentsappears in the DevTools bar; clicking it opens the dialog; toggling writesexperimental.tab_drafts: true; with the experiment on, a drafted-then-<leader>nflow 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 nopens a blank new session → clicking back to the original tab shows the draft intact.recording-a0823c9f-9be4-4f6c-82b1-eb6f512df96f.mp4