Repository navigation
Conversation
🎩 PreviewA preview build has been created at: |
1 of 3 tasks
A document opened in the Tangent workarea or selected on the project page is now a Monaco editor with Save and Discard, not a read-only viewer. Save writes the body back to the resource's payload (Cmd/Ctrl+S too), keeping any other payload keys. The draft lives in the component rather than the query cache, so while nothing has been typed the editor follows a save made elsewhere (e.g. by an agent), and once something has, that save is announced with a choice to overwrite or discard into it. The document workarea kind now stays mounted while inactive so an unsaved draft survives a tab switch, and a successful update seeds the resource's query cache so the editor does not flash the old body before the refetch. On the project page the editor is keyed by the resource, so selecting another document opens a fresh editor instead of carrying the previous document's draft over, where Save would have written it into the wrong row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
camielvs
marked this pull request as draft
November 5, 2026 23:38
camielvs
force-pushed
the
cvs/editable-documents
branch
from
November 6, 2026 00:11
37f1855 to
2ea79b1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2978 (
cvs/document-file-drop), which this branch is based on. Review only the top commit.Intent
Let anyone with a project edit its documents where they already read them — in the Tangent right-hand panel and on the project page — instead of having to delete and re-add a document to change a line. The next PR in the stack (#3004) uses the same editor for code.
Current behavior
A document opened from the Resources window in Tangent, or selected on the project page, is shown in a read-only code viewer. The only document that can be changed after it is added is the project's Instructions, through its own dialog. Everything else is fixed once created.
What changes
A document now opens in a code editor (the same Monaco editor the Add a document dialog uses after #2978) with a small header: the document's name, an Unsaved changes note while you type, and Discard / Save buttons. ⌘S / Ctrl+S saves too. Saving writes the text back to the document in the project; anything else stored in the document's payload is left untouched.
Edits are kept in the editor, not in the shared data cache, so the editor behaves sensibly when an agent changes the same document:
In Tangent, a document tab now stays mounted while another tab is active, so an unsaved draft survives switching tabs. A successful save also seeds the document's cached copy with the server's response, so the editor does not flash the old text between the save and the refetch.
On the project page, selecting a different document opens it in a fresh editor, so a draft typed into one document can never be shown against, or saved into, another.
Both surfaces (Tangent workarea and project page preview) use one
DocumentEditorcomponent.How to test
refresh_project_resources. The editor should show the new text without a banner.Automated: the new
DocumentEditor.test.tsxcovers each editor behaviour above with a mocked editor;ProjectResourcePreview.test.tsxchecks that selecting another document opens a fresh editor;documentKind.test.tsxis updated.vitestfor the touched folders,tscandknippass, andeslintandprettierpass on the touched files. The UI steps have not been walked through in a browser.Related Issue and Pull requests
Stacked on #2978. Next in the stack: #3004, code as its own kind of document.
Type of Change
Line Breakdown
Checklist
Additional Comments
contentstring (for example{}) opens as an empty editor rather than the previous "nothing written in it" message, so it can be written into.