Repository navigation
Let plugin panels open a file in the workspace's file tab #7585
Replies: 6 comments
|
Also was about to post this for a cursor style 'Project' notes. +1 |
|
I am building a multi-repo git management plugin and it'd be a nice addition to the workflow too! |
|
Another use case for this API: reviewing agent-generated Markdown reports. I'd like an agent to write a report and ask a plugin to open it as a rendered file tab in that agent's workspace, instead of requiring a click on a chat link or having the plugin implement a second Markdown viewer. For that workflow, please also consider exposing the opener on the client contribution context, alongside The agent-facing command and delivery of its request to the connected app could remain plugin responsibilities. The reusable core capability would be opening the file on the specified host and workspace through Paseo's existing file-tab path, including its file validation and remembered panel association. That would also benefit the report-review and project-notes workflows described above. |
|
Another use case, with one detail that matters for the design: the files can live outside the workspace directory. My plugin keeps a per-task panel (a "progress" panel) in a workspace whose cwd is a code repository. The files the task produces or receives (screenshots the user sent, reports) are stored in a per-task data directory elsewhere on the machine. Today a click on one of them cannot open anything in Paseo, so the plugin falls back to showing a path to copy, or renders its own small preview in the panel. I prototyped It only works if the call is available to the mounted panel on web, desktop and mobile; on a phone running the hosted app it stays unavailable until the host ships it. +1 to djbclark's point about also exposing it on the client contribution context. I can open a focused PR with the above and QA evidence if that is useful. |
|
Another use case: a Source Control panel modelled on VS Code's (repositories, changes as a folder tree, commit graph). VS Code puts an inline "Open File" action on every changed file. For now the plugin presses a hidden Markdown link from code, as described in #8344. That only works where the link is an element of a web page, so the action is missing on iOS and Android, and it breaks if Paseo changes how it draws links. Two details from this workflow:
|
|
Your plugin can now open an HTML or Markdown report in Paseo’s built-in file tab through the workspace layout API. The change is on main and will go out in the next release. PR #11328 |
Uh oh!
There was an error while loading. Please reload this page.
What are you trying to do?
My plugin, Progress, lists the files an agent hands back for review in a workspace panel. Many are HTML reports. I want a click on one to open it in Paseo's file tab, the same viewer a file path in chat opens. That tab already renders HTML and Markdown, on desktop and on phones.
How do you do it today?
A workspace panel gets
navigation.openAgent,openWorkspaceandopenBrowser. None of them opens a file.openBrowsertakes only http(s) URLs and runs on the desktop client, so it can't load a file that lives on a remote daemon. So the plugin:openorxdg-open). On a headless Linux daemon that fails. Where it works, the file opens on the daemon's machine, which isn't always the one the user is sitting at.addScreenandopenScreen) as a sandboxed iframe. That only works on desktop, because plugins have no web view on iOS or Android.Where does Paseo get in the way?
The app can already open a file tab from a route (
?open=file:<path>on the workspace route), but plugins can't reach it. #7317 and #7318 addopenFilefor timeline renderers and list panels and screens as a non-goal. Plugin dialogs are also fixed at 520 px.AdaptiveModalSheettakesdesktopMaxWidth, but the pluginModaldoesn't pass it through, so a dialog is too narrow to show a page either.What would a better workflow look like?
navigation.openFile({ workspaceId, path, lineStart?, serverId? })on workspace panels, agent panels and screens. It opens the file as a tab in that workspace, the way a click on a path in chat does.pathis absolute or relative to the workspace directory. Plugins feature-detect it, as they doopenBrowsertoday.HTML deliverables would then open in the same viewer as chat links, on every client, and the plugin could drop its own iframe screen.
All reactions