Repository navigation
[Feature][Mobile] Edit workspace Markdown files directly, including AGENTS.md #14438
Description
Problem or use case
I want to make small edits to workspace Markdown files from the T3 Code mobile app without prompting an agent. The main use case is updating AGENTS.md: correcting an instruction, adding a project convention, or removing an outdated rule. The same flow should work for README files and other Markdown documents, then eventually all file formats should be supported.
Mobile currently lets me browse workspace files, view rendered Markdown or its source, and copy the contents, but it does not offer direct editing or saving back to the workspace. For a small text change, I have to ask an agent or use another client/editor.
Desktop and web already support direct source editing of workspace text files, with automatic saving. Mobile should offer a simple way to make the same kind of change.
Proposed behavior
- Open an existing Markdown file from the workspace Files browser or a workspace file link.
- Choose Edit to edit the raw Markdown in a native multiline text editor. Support selection, copy/paste, undo, and keyboard-aware scrolling; disable autocorrect and automatic capitalization that would alter Markdown or paths.
- Choose Save to write the contents to the connected environment's workspace, without starting an agent turn. Return to the file view with the saved contents visible.
- Choose Cancel to leave editing without writing changes. If there are unsaved changes, confirm before discarding them, including when navigating back or selecting another file.
Show the workspace-relative file path while editing so it is clear which file will change. Use the active environment and workspace/worktree, including remote connections; saving must not target a different checkout or create a copy on the phone.
If a save fails or the connection drops, keep the draft available and show an actionable error. Only report a successful save after the server confirms the write.
If an agent or another device changes the file after editing begins, do not silently overwrite it. Keep the draft and offer to reload the current file or explicitly overwrite it.
Smallest useful scope
- Edit existing, fully loaded workspace Markdown files, including root and nested
AGENTS.mdfiles. - Support both iOS and Android through the existing React Native mobile client, including its phone and tablet file flows.
- Keep the existing rendered preview and source viewer; add a plain source editor with explicit Save and Cancel.
- Keep attachments, files outside the workspace, and truncated previews read-only.
A dedicated Open AGENTS.md shortcut and creation of a missing instructions file would be useful follow-ups. Longer term, mobile should support editing all workspace files, with Markdown as the first step. Rich-text editing, general code editing, Markdown formatting tools, and a full mobile IDE are outside the initial scope.
Editing AGENTS.md changes the file on disk. This feature should not promise that an already-running provider session immediately reloads its instructions.
Willingness to contribute
I’m happy to build this if maintainers are interested in the feature and agree on the scope. I’d start with the smallest useful version described above: editing existing workspace Markdown files on iOS and Android, with explicit Save and Cancel.
Implementation context
Source inspection of the current checkout shows that most of the file transport already exists:
apps/mobile/src/features/files/ThreadFilesRouteScreen.tsxhandles workspace file loading, preview/source modes, and file actions.apps/mobile/src/features/files/SourceFileSurface.tsxis a read-only source surface.- Mobile already exposes the shared
projectEnvironment.writeFilecommand frompackages/client-runtime/src/state/projectCommands.ts. - The server's
WorkspaceFileSystem.writeFilewrites workspace-relative files in the requested environment. No provider-specific adapter changes are needed to perform the edit.
The current write contract accepts a path and contents without an expected file revision/content check. Conflict detection would need a small contracts/server change rather than only a mobile UI change. Existing web/desktop callers should remain compatible.
Acceptance criteria
- On iOS and Android, a user can open an existing workspace
AGENTS.md, change its text, and save it without sending a prompt or starting an agent turn. - Other workspace Markdown files use the same editing flow, whether opened from Files or a workspace file link.
- Saved contents are written to the selected environment and worktree, and appear in the file view after saving.
- Cancel leaves the file unchanged; navigation cannot silently discard an unsaved draft.
- A failed save or disconnected environment preserves the draft and allows retry.
- Concurrent file changes are detected before overwriting; the user's draft remains available during conflict resolution.
- Attachments, host files outside the workspace, and truncated previews cannot be edited through this flow.
- Existing file browsing and preview behavior continues to work on phones and tablets, and existing web/desktop editing remains compatible.
Related work
- PR #11637: in-place Lexical Markdown editor is an open draft for rich-text editing in the web/desktop file preview. It does not add editing to the React Native mobile app. This request is for a native plain-source editor on mobile.
- No matching open mobile Markdown-editing PR or issue was found in the searches performed for this draft.
Activity
juliusmarminge commentedon Sep 30, 2026
Triage
Thanks for the detailed proposal. This is a feature request rather than a bug, and those usually live in Ideas, so it might get more visibility there.
The gap is real, and it's not a duplicate. On mobile,
ThreadFileScreencan show the preview or source, toggle word wrap, and copy the path or contents.SourceFileSurfaceis selectable highlighted text, not an editor, and there's no Edit or Save action anywhere. The phone file route and the tablet file pane both use that same screen. Host files opened from chat (absolute paths outside the workspace) andAttachmentFileScreenare read-only too.Web and desktop already edit workspace text in place.
EditableFileSurfaceiscontentEditableand writes throughprojects.writeFileafter a 500 ms debounce. A truncated read (the first 1 MB) or a host file stays in the read-only source preview, and attachments never reach that editor.On mobile,
projectEnvironmentis built from the shared client atoms and already includeswriteFile, but no mobile screen calls it. A few details matter for the scope you described:ProjectWriteFileInputis onlycwd,relativePath, andcontents.WorkspaceFileSystem.writeFileresolves the path inside the requested environment's workspace, writes the string, and refreshes the file list. It doesn't compare against the version the client started from, so conflict detection would need a new optional field on that contract to keep existing web callers working.AGENTS.mdshouldn't promise a live reload.Related but separate: Discussion #6916 (open, opening workspace links from mobile Markdown previews) and #11637 (open draft PR, a Lexical editor for the web file preview, not the React Native app).
juliusmarminge commentedon Sep 30, 2026
Closing this issue as leftover hygiene — the proposal was moved to Ideas as #14444 per the triage note above. Please continue the conversation there.