feat(prototype): Edit in the IDE opens the file, not just the project - #128
Merged
AndrejK666 merged 1 commit intoSep 11, 2026
Conversation
The button handed the IDE a project and left the person to find the document themselves — in a repository of five thousand files, with the path sitting right there in the row they had just clicked. Everything needed was already built and nothing was using it. The IDE's portal bridge has handled `studio.openInEditor` since it was written, resolving a repo-relative path against every workspace root and each root's children — because a repository is cloned to `/workspace/<name>` — and warning by name when the file is not checked out. `openInStudioEditor` has been sitting in App.tsx with no callers at all. A binding's `path` is exactly the shape that opener wants. So the only real work is the timing. Opening a document means starting a session when none is running, and a message posted at an iframe that has not loaded its bridge yet is simply lost — the same failure the `studio.init` retry exists for. The path is therefore both posted now, for a session already up, and remembered for the bridge's first sign of life, which the message listener already watches for to end that retry. The slot is module-scoped rather than a prop threaded from the shell down to the project screen: one browser tab opens one file at a time, and the listener that drains it lives several components above the button that fills it. Signed-off-by: Andrej Kuchma <Andrej.Kuchma@constructor.tech>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Comment |
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.
What it did
The button handed the IDE a project and left the person to find the document
themselves — in a repository of five thousand files, with the path sitting right
there in the row they had just clicked.
What was already there
Almost all of it, unused:
studio.openInEditorsince it waswritten, and
OpenInEditorFrontendControllerresolves a repo-relative pathagainst every workspace root and each root's children — because a repository
is cloned to
/workspace/<name>— warning by name when the file is notchecked out in that session;
openInStudioEditorhas been sitting inApp.tsxwith no callers atall;
pathis repo-relative, which is exactly the shape that openerwants.
So this connects three things that were each waiting for the other two.
The only real work: timing
Opening a document means starting a session when none is running, and a message
posted at an iframe that has not loaded its bridge yet is simply lost — the same
failure the
studio.initretry already exists for ("the iframe's first loadevents are the session gate's redirect/splash pages").
The path is therefore both posted immediately, for a session already up,
and remembered for the bridge's first sign of life — which the message
listener already watches for, to end that retry. One extra branch there drains
it.
The slot is module-scoped rather than a prop threaded from the shell down
through the project screen: one browser tab opens one file at a time, and the
listener that drains it lives several components above the button that fills it.
tsc -band the 41 prototype tests clean. Frontend only; no change to the Theiaextension, which could already do this.