Skip to content

feat(prototype): Edit in the IDE opens the file, not just the project - #128

Merged
AndrejK666 merged 1 commit into
constructorfabric:mainfrom
AndrejK666:AndrejK666/open-the-file-in-the-ide
Sep 11, 2026
Merged

feat(prototype): Edit in the IDE opens the file, not just the project#128
AndrejK666 merged 1 commit into
constructorfabric:mainfrom
AndrejK666:AndrejK666/open-the-file-in-the-ide

Conversation

@AndrejK666

Copy link
Copy Markdown
Contributor

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:

  • the IDE's portal bridge has handled studio.openInEditor since it was
    written, and OpenInEditorFrontendController resolves a repo-relative path
    against every workspace root and each root's children — because a repository
    is cloned to /workspace/<name> — warning by name when the file is not
    checked out in that session;
  • openInStudioEditor has been sitting in App.tsx with no callers at
    all
    ;
  • a binding's path is repo-relative, which is exactly the shape that opener
    wants.

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.init retry already exists for ("the iframe's first load
events 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 -b and the 41 prototype tests clean. Frontend only; no change to the Theia
extension, which could already do this.

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>
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a2c27185-18fd-4476-b019-b9dc8a17a595


Comment @coderabbitai help to get the list of available commands.

@AndrejK666
AndrejK666 merged commit 2309902 into constructorfabric:main Sep 11, 2026
3 checks passed
@AndrejK666
AndrejK666 deleted the AndrejK666/open-the-file-in-the-ide branch September 11, 2026 11:05
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.

1 participant