Skip to content

mac: the entry document takes the opened file's own name, not main.tex (GH #75) - #255

Closed
jay3332 wants to merge 1 commit into
mainfrom
agent/mac-claude-a/entry-document-name
Closed

jay3332 wants to merge 1 commit into
mainfrom
agent/mac-claude-a/entry-document-name

Conversation

@jay3332

@jay3332 jay3332 commented Sep 14, 2026

Copy link
Copy Markdown
Member

Fixes the first half of #75: HW1.tex no longer shows as main.tex in the tab, sidebar, Problems panel and quit prompt, and an opened named file is a rooted project for the preview controller (its directory is the project root, saves go through the helper's rooted export, includes are known to the durable route) instead of a session copy.

replaceProject(entryText:entryPath:) takes the file name; File > Open, FLASHTEX_SEED_FILE and restore-discarded-buffer pass url.lastPathComponent. An untitled buffer keeps main.tex.

Tests: open/save round trip asserts paper.tex; the controller save test keeps its guarantee (file on disk holds the buffer) via the rooted export; the session-copy DirtySnapshotsControllerTests class is removed — its premise (a named file as a session project) no longer exists; the rooted route is covered by DocumentFilesTests. Full swift test with the bundled helpers in FLASHTEX_PREVIEW_CONTROLLER/FLASHTEX_COMPILER: 1049 tests; only failures are pre-existing and reproduce on pristine main (EditorDiagnosticsPartialOutputTests compiler-count pins 115→156; CompletionTests.testSnippetsInsertThroughTheRealTextViewAsOneUndoStep).

Second half of #75 (include auto-open on the durable route) needs the preview-controller protocol change noted in ProjectDocuments.swift; stays open.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn

File > Open (and the FLASHTEX_SEED_FILE hook, and restoring a discarded
buffer) named the entry document `main.tex` whatever the file was called,
so HW1.tex showed as `main.tex` in the tab, the sidebar, the Problems
panel and the quit prompt (GH #75). It also meant a named file was always
a *session* project for the preview controller: ShellModel+Controller
roots the helper at the file's directory only when the entry path and the
file name agree, so an opened `paper.tex` got a temporary copy, its saves
went the direct way and its includes were unknown to the durable route.

`replaceProject(entryText:entryPath:)` takes the file name; the three
callers pass `url.lastPathComponent`. A buffer without a file keeps
`main.tex`, so the untitled/session case is unchanged.

Tests: the open/save round trip asserts the entry is `paper.tex`;
ControllerPipelineReviewTests' "save of a file not named main.tex writes
that file" keeps its guarantee (the file on disk holds the buffer) through
the helper's rooted export now, with `controllerRoutesFiles` true; the
session-copy DirtySnapshotsControllerTests class is removed because its
premise — a named file that is a session project — no longer exists (the
rooted route's reload/conflict/dirty behaviour is covered by
DocumentFilesTests and the direct-mode DirtySnapshotsTests). Full
`swift test` with FLASHTEX_PREVIEW_CONTROLLER/FLASHTEX_COMPILER set to the
bundled helpers: 1049 tests, the only failures being the pre-existing
compiler-count pins in EditorDiagnosticsPartialOutputTests (115 vs 156,
the compiler moved) and CompletionTests.testSnippetsInsertThroughTheReal
TextViewAsOneUndoStep, which fails identically on pristine main.

Implementation-Agent: Claude Code (mac-claude-a)
Commit-Executor: git via Claude Code
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

daniel-parent Mac pre-merge verification (for the integration lane, which has no Swift toolchain). Xcode 26.6, macOS 26.6, merged onto origin/main 98ca402a in a throwaway worktree, PR head ab2c3aab. Worker: Cursor; results checked by daniel-parent.

PR merge filtered tests full suite verdict
#255 CLEAN 19 / 7 skipped / 0 fail 1057 / 145 skipped / 3 fail (pre-existing WordCount) READY

About the 3 full-suite failures: WordCountModelTests.testOnlyTheLastScheduledUpdateWins and testScheduleUpdateEventuallyPublishesTotals fail in every full run, including the control on main, while the machine is loaded. Run alone on main 095e8406 they pass twice (2/0), so they're timing-flaky under full-suite load, not caused by this PR or broken on main.

@GoKubar

GoKubar commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Superseded by #655, which merged as `44b21adc`.

Same fix, landed independently: `ShellModel.replaceProject` now takes the filename (`ShellModel.swift:781` on main — `func replaceProject(entryText text: String, named entryName: String = "main.tex")`), and all three entry points pass the real name — File > Open via `adoptOpenedText`, the `FLASHTEX_SEED_FILE` startup seed (`ShellModel.swift:627`), and Restore Discarded Buffer.

Verified on main, not inferred from the title. This PR is also CONFLICTING against current main after ~115 commits. Closing as already-delivered; the branch and this PR's diff remain at `refs/pull/255/head` if any detail here is worth recovering.

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.

3 participants