Repository navigation
Edit the document title in place in the header - #343
Conversation
|
Review: Changes needed Checked in a real browser (headless Chromium, fake-GitHub server) at 1440x900 and 390x844. Keyboard, blur, New document flow, two-user rename, long titles, and menu Rename all work. The items below are polish and one real input-loss bug. Must fix
Should fix Notes (no action needed)
Screenshots (local): |
|
Thanks. All eight items, plus the minor one, are addressed in a9b6a10 and 6094614:
CI: e2e and container pass. The container bundle is now 81,472 B gzip, under budget. |
|
Review: Changes needed (one item left) Re-verified at 6094614 in a fresh worktree (headless Chromium, 1440x900 and 390x844, fake-GitHub on 8843). Fixed
Still broken: immediate typing after New document
|
|
Fixed structurally in 61dad1f. From the moment New document is clicked,
E2E: the test now uses Known edge: at 0 ms with a held Enter, the commit can finish before the editor mounts, so focus falls back to the title button instead of the body. CI: e2e and container pass (initial JS 246,869 B / 78,772 B gzip on the merge with main). |
Clicking the header title, pressing F2, or choosing Rename from the document menu now swaps the title for an inline field. Enter or blur commits through the existing rename request; Escape reverts. A document created from New document opens with its generated name selected, and committing or dismissing it hands the caret to the document body. Archived and read-only viewers keep plain text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scope the editor lookup to the header's workspace, so an outgoing route layer's editor can't take focus, and move it before the field unmounts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claim the title edit during the workspace's first render so a new document's field is focused as soon as it mounts. Sidebar Rename now opens the document and its inline title instead of a modal, which is removed. Editing keeps the resting box and ink on a selected wash with a hairline ring, a duplicate title gets sentence-case guidance, and leaving a rejected title reverts it instead of retrying. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keys pressed while a new document is created and opened landed on the page, so a fast typist lost the start of the name. Hold printable keys and Enter from the click until the inline title mounts, then replay them in place of the generated name, committing if Enter was pressed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
61dad1f to
1390265
Compare
Why
New documents get random slug names ("eager-valley"), and the only way to name one was header chevron → Rename → modal. Nobody bothers, so the sidebar fills with names nobody chose.
What changed
theme.cssbeside the other focus rules.holdTypingintitle-edit.ts) instead of landing on the page or the editor. The field then mounts focused with the slug selected (placeholder "Untitled"), replays the held text in place of the slug, and commits if Enter was pressed. Nothing typed early becomes a partial name or reaches the document body. Enter or Escape then moves the caret into the body. The hold skips other inputs and textareas, and stops if creation fails or you navigate away.rename-document-dialog.tsxis deleted. The request is held intitle-edit.ts(the workspace claims it in its own lazy module) (expires after 15 s) and also signalled with a window event when the document is already open.DocumentRenamegains aninlinevariant that reuses the same request and validation.Header.Screenshots
Before: header at rest, and renaming needs a modal
After: rest / hover / editing (same box, so no shift)
After: right after New document (generated name selected)
After: duplicate title
Phone: rest / editing with a long title
Testing
bun run types: pass.cd apps/web && bun test src/: all pass. Under heavy machine load a few repo-walking tests time out at 5 s; they pass with--timeout 60000.navigation-chrome.test.tscovers the title button, the inline field, and the archived and viewer cases.bun scripts/check-design-record.ts: pass.bun run ci: fails only on the pinned review hashes below.Bundle budget: the container build passes (246,869 B raw / 78,772 B gzip, merged with current main). The typing hold adds about 130 B gzip to the initial chunk.
Checked in a real browser against a fake-GitHub server:
E2E in CI passes, with new tests:
The existing rename tests press Enter instead of clicking the removed Save button.
Needs a design-contract review
These files are pinned in
scripts/design-contract/exceptions/dynamic-web.json:apps/web/src/document-rename.tsx, new hashc9df5d5496e382136786e52f65a0d7a096baecd1d9e42ac860579b1b2d7ddd25. The existingclassNameforwarding on the form variant is unchanged. The inline branch uses only static classes.apps/web/src/navigation-shell.tsx, new hashd081007f84589d21b71a0584a54d6487f9fcb53b5a06937e8b5a1f25b958deb7. The rename dialog branch and its lazy import were removed, and Rename now navigates. No style or class logic changed.🤖 Generated with Claude Code