Skip to content

Number new untitled tabs - #203

Merged
tebriz91 merged 3 commits into
mainfrom
windows/tab-numbering
Oct 28, 2026
Merged

tebriz91 merged 3 commits into
mainfrom
windows/tab-numbering

Conversation

@tebriz91

@tebriz91 tebriz91 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

New tabs use Untitled.md, then the lowest free Untitled N.md across current and lazy restored tabs. Closing a tab frees its name; saving under a different name also frees the old untitled name while the tab stays open. Empty unsaved tabs retain their names across restarts. Save As, close/quit prompts, the sidebar and its accessibility labels receive the document name, and the command palette shares the sidebar title lookup.

The tab owner reserves retained titles before naming older unnamed session records. Failed or loading Markdown files retain their filenames rather than reserving an untitled number. Removes 0.3.0 item 1 from ROADMAP.md and adds changes/tab-numbering.md.

Validation:

  • Regressions reproduced duplicate names and lost restored names before implementation, then stale post-save suggestions and failed-file names before the review fixes.
  • Coverage includes sequence, gap reuse (including lazy restored tabs), session save/load, JSON records without the new field, saved-file title reservations, Save As suggestions before/after save, and numbered Close/Quit prompts.
  • just check passed after the review fixes: fmt-check, deny, lint-scripts, lint and test. Cargo: 806 passed, 0 failed, 20 ignored, including isolated headless rendering; all 14 release-script cases passed. git diff --check also passed.
  • Native screen-reader and file-picker presentation were not exercised. GPUI's test picker discards the suggested-name argument; tests assert the session method that supplies that argument and separately exercise Save As.

Review

Reviewed by claudeAgent / claude-haiku-5-5, effort max, against origin/main and ADR 0071. No Critical or High findings; one Medium and three Low findings, addressed as follows:

  1. Medium — failed/unloaded Markdown tabs reserve Untitled.md: fixed. Initialize the document's fallback name from the file record until a load succeeds, without accepting the path as a successfully opened document. Failed-file snapshots also remain file records rather than blanks. An invalid-UTF-8 regression verifies the filename, window/sidebar labels, loadable session record and the next new tab's name.
  2. Low — Save As retains an old untitled suggestion after saving: fixed. Suggestions prefer the saved filename over the unsaved fallback name. The existing import-based suggestion still takes precedence, as its established regression requires. Added a failing-then-passing post-save regression.
  3. Low — persisted names and the paths-only session policy: retained intentionally. Restoring an empty unsaved tab with its existing name requires title metadata. No document contents or mapping are stored, and nonempty unsaved buffers remain omitted. Custom restored-reply titles may contain the same source stem already present in source paths. The existing 4 MiB manifest read limit continues to bound input; a separate title restriction is outside this naming change.
  4. Low — restoration wording and obsolete roadmap pointer: fixed. The fragment and ADR now specify empty unsaved tabs, and the completed roadmap-item pointer was removed.

Optional review notes: the legacy test now deserializes an actual JSON record without name. Allocation compares displayed names exactly, as specified; it does not define filesystem path uniqueness. DocumentSession keeps its existing public-field API, while TabSet owns private tab records and their naming transition. For initialized tabs the live document name is authoritative; snapshots refresh the retained blank name from it.

@tebriz91
tebriz91 marked this pull request as ready for review October 28, 2026 02:41
@tebriz91
tebriz91 merged commit 6a6267f into main Oct 28, 2026
5 checks passed
@tebriz91
tebriz91 deleted the windows/tab-numbering branch October 28, 2026 03:03
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