NS8 slice: Launch a real editor for files, folders, and new paths #44

Closed
opened 2026-06-21 09:12:11 +00:00 by tmk241 · 1 comment
Owner

OBJECTIVE: mim, mim <file>, mim <missing-file>, and mim <directory> launch the real terminal editor surface instead of help text, one-shot previews, or a line-mode placeholder.

AUTHORITY: Parent #43 NS8: Prod-ready modal editor implementation; PRODUCT.md; KEYMAP.md; req: session/001-003, ui/001-002, repo/001, input/001, testing/001-004.

AGENT AUTHORITY:

  • Delivery authority: local-commit
  • Tracker authority: this issue may be commented and closed when acceptance passes; parent #43 may be commented/checklisted.
  • Handoff state: committed clean, tracker commented/closed.

PARENT: #43 via explicit issue link and parent checklist.

SCOPE: CLI dispatch in src/main.zig, session/TUI entrypoints, buffer/file lifecycle, directory/file picker startup, smoke/replay tests, help text. Preserve --help, --version, context, profile, and mimctl command behavior.

BOUNDARIES: Do not implement the whole KEYMAP grammar here. Do not add runtime config files, plugin hooks, external installers, or a native app. Do not silently overwrite missing/new files before save.

ACCEPTANCE:

  • Running mim opens the current directory in an editor/file-browser surface, not only usage text.
  • Running mim existing-file opens an editable buffer for that file.
  • Running mim missing-file opens a new unsaved buffer whose first save creates the file only after an explicit save command.
  • Running mim directory opens a navigable file-browser/editor surface rooted at that directory.
  • Dirty-buffer quit is protected: a user cannot lose unsaved changes by accidental close.
  • EOF/non-interactive smoke paths exit cleanly and do not spin or flood output.
  • Legacy commands and --help keep their documented behavior.

VERIFICATION:

  • zig build test
  • zig build v1-smoke
  • zig build run -- --help
  • Headless/replay smokes for mim, existing file, missing file, directory, dirty quit, and EOF/non-interactive exit.
  • redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md if requirements/docs are changed.

BLOCKERS: none.

OBJECTIVE: `mim`, `mim <file>`, `mim <missing-file>`, and `mim <directory>` launch the real terminal editor surface instead of help text, one-shot previews, or a line-mode placeholder. AUTHORITY: Parent #43 `NS8: Prod-ready modal editor implementation`; PRODUCT.md; KEYMAP.md; req: session/001-003, ui/001-002, repo/001, input/001, testing/001-004. AGENT AUTHORITY: - Delivery authority: local-commit - Tracker authority: this issue may be commented and closed when acceptance passes; parent #43 may be commented/checklisted. - Handoff state: committed clean, tracker commented/closed. PARENT: #43 via explicit issue link and parent checklist. SCOPE: CLI dispatch in `src/main.zig`, session/TUI entrypoints, buffer/file lifecycle, directory/file picker startup, smoke/replay tests, help text. Preserve `--help`, `--version`, `context`, `profile`, and `mimctl` command behavior. BOUNDARIES: Do not implement the whole KEYMAP grammar here. Do not add runtime config files, plugin hooks, external installers, or a native app. Do not silently overwrite missing/new files before save. ACCEPTANCE: - Running `mim` opens the current directory in an editor/file-browser surface, not only usage text. - Running `mim existing-file` opens an editable buffer for that file. - Running `mim missing-file` opens a new unsaved buffer whose first save creates the file only after an explicit save command. - Running `mim directory` opens a navigable file-browser/editor surface rooted at that directory. - Dirty-buffer quit is protected: a user cannot lose unsaved changes by accidental close. - EOF/non-interactive smoke paths exit cleanly and do not spin or flood output. - Legacy commands and `--help` keep their documented behavior. VERIFICATION: - `zig build test` - `zig build v1-smoke` - `zig build run -- --help` - Headless/replay smokes for `mim`, existing file, missing file, directory, dirty quit, and EOF/non-interactive exit. - `redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` if requirements/docs are changed. BLOCKERS: none.
tmk241 added the sliceready-for-agentgoal labels 2026-06-21 09:12:12 +00:00
Author
Owner

Completed in commit 047bae9 (Launch local editor for paths).

What changed:

  • mim and mim <path> now dispatch to a local editor launch path instead of help/unknown-arg behavior.
  • Existing files open into an editable buffer; missing paths open a new unsaved buffer; directories open the file-browser panel.
  • Non-interactive/EOF runs render once and exit cleanly for smoke/CI safety.
  • Interactive loop reads terminal bytes through the TUI client, supports save persistence via the normal Space s path, and blocks dirty quit by clearing the quit request and showing a status message.
  • Added client helpers and tests for input byte decoding, save state, and dirty quit guard.

Verification:

  • zig fmt src/main.zig src/tui.zig && zig build test
  • zig build
  • zig build v1-smoke
  • zig build run -- --help
  • Existing-file smoke: zig build run -- /tmp/mim-ns8-existing.txt
  • Missing-file smoke: zig build run -- /tmp/mim-ns8-new-file.txt
  • Directory smoke: zig build run -- src
  • redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md

Notes:

  • Raw terminal mode/polished modal key handling remains scoped to #45. #44 now provides the real launch path and safe non-interactive behavior required for the first NS8 slice.
Completed in commit 047bae9 (`Launch local editor for paths`). What changed: - `mim` and `mim <path>` now dispatch to a local editor launch path instead of help/unknown-arg behavior. - Existing files open into an editable buffer; missing paths open a new unsaved buffer; directories open the file-browser panel. - Non-interactive/EOF runs render once and exit cleanly for smoke/CI safety. - Interactive loop reads terminal bytes through the TUI client, supports save persistence via the normal `Space s` path, and blocks dirty quit by clearing the quit request and showing a status message. - Added client helpers and tests for input byte decoding, save state, and dirty quit guard. Verification: - `zig fmt src/main.zig src/tui.zig && zig build test` - `zig build` - `zig build v1-smoke` - `zig build run -- --help` - Existing-file smoke: `zig build run -- /tmp/mim-ns8-existing.txt` - Missing-file smoke: `zig build run -- /tmp/mim-ns8-new-file.txt` - Directory smoke: `zig build run -- src` - `redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` Notes: - Raw terminal mode/polished modal key handling remains scoped to #45. #44 now provides the real launch path and safe non-interactive behavior required for the first NS8 slice.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmk241/mim#44