Skip to content

TUI infrastructure improvements#15

Open
freesig wants to merge 27 commits into
mainfrom
freesig/sim-1-tui-infra
Open

TUI infrastructure improvements#15
freesig wants to merge 27 commits into
mainfrom
freesig/sim-1-tui-infra

Conversation

@freesig

@freesig freesig commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add config menu with username setting, spec settings screen, and mode/locality picker
  • Standardize data directory to ~/.spec-forest across all crates
  • Add tree-based directory browser, depth picker, and candidate answer display
  • Add toggleable log panel, node deletion, auto-explore setting
  • Replace eprintln with tracing, add macOS ad-hoc codesigning
  • Various UX fixes: tree panel default, sync indicator, explore keys

Stack

  • PR 1/5 ← you are here
  • PR 2/5: Simulation Core & UX
  • PR 3/5: Sim Tools, Game Mode & Streaming
  • PR 4/5: Members Screen
  • PR 5/5: Lean Game Mode

Test plan

  • TUI launches and displays spec list
  • Config menu opens and persists username
  • Directory browser works for seed-from-dir
  • Log panel toggles with keybind
  • Node deletion requires double-press confirmation

freesig added 27 commits March 30, 2026 15:10
…from dir

The seed feature now opens a full filesystem tree browser instead of a
plain text path input. Users can expand/collapse directories, navigate
with arrow keys, go above home with Backspace, and select with S.
After selecting a directory, a new screen lets you choose exploration
depth (1–5) before seeding. Uses the existing recursive ingest backend
instead of single-level seed_spec, with background status polling.
Add candidate browsing and acceptance to the spec_view content panel.
When a node has candidates, they appear below the answer section with
[/] to browse and [y] to accept. Candidates persist after acceptance.
Both create-spec and seed-from-directory flows now prompt the user
to choose between local/remote and development/exploration before
proceeding, passing the selection through to the spec-forest API.
Wire [f] and [n] keybindings in SpecView to create new root features
and child questions via the external editor, using existing backend
create_feature and add_child APIs.
Poll sync connection status on every tick and display a red
"Sync: not connected" label in the footer when a sync URL is
configured but the connection is not established (not logged in,
login failed, or connection dropped).
Add a settings screen accessible from the spec view (press [g]) that
shows the current active directory and allows changing it via the
directory browser or clearing it. The directory automatically flows
to AI prompts for development-mode specs once set.
Sync module and other shared library code used eprintln!() which writes
to stderr and corrupts the TUI alternate screen, leaving lingering text
after operations like sync login. Switched all eprintln calls to tracing
macros so messages route to the log file instead. Also fixed a test that
used an 80-column terminal too narrow for the full footer text.
Captures tracing events into an in-memory ring buffer via a custom
tracing Layer, displayed as a bottom panel toggled with [l].
Supports scrolling with PgUp/PgDn. File logging is unaffected.
… support

Show all candidate answer texts instead of only the selected one, fix
misleading [/] browse hint to show actual keybindings, and add [E] to
load the selected candidate into the external editor for editing before
submission.
Tab focus switching no longer desyncs the displayed node. Removed
node_selected flat list index in favor of always using tree_state
for selection. Main panel Up/Down now navigates siblings.
Answering a question no longer automatically generates child nodes by
default. A new "Auto Explore" toggle in the Config screen (g) controls
this behavior, persisted across sessions via the settings table.
Log model, prompt size, response size, and elapsed time on success,
failure, and timeout paths for better observability of Claude API calls.
The TUI now exclusively uses the spec-forest API layer instead of
accessing the database directly. Added missing API functions
(get_children, get_next_question, get/set_setting) and re-exported
DB types from spec-forest so frontends don't need a direct dep.
The editor now shows both fields as editable sections (## Question /
## Answer) so existing answers are preserved and either field can be
updated independently. The flat-list 'e' key now edits the selected
node instead of fetching the next unanswered question.
The comment filter in run_editor() was stripping all lines starting
with '#', including the '## Question' and '## Answer' section markers
that parse_question_answer() needs. This caused edited answers to be
placed into the question field instead.
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.

1 participant