Skip to content

feat: plugin quicktool adapter - #2898

Open
deadlyjack wants to merge 4 commits into
mainfrom
feat/plugin-quicktool
Open

feat: plugin quicktool adapter#2898
deadlyjack wants to merge 4 commits into
mainfrom
feat/plugin-quicktool

Conversation

@deadlyjack

@deadlyjack deadlyjack commented Sep 14, 2026

Copy link
Copy Markdown
Member
  • allow plugin to adapt quicktool
  • allow plugin to hook save, save event
  • fix icon size in file explorer
  • feat: icon button tooltip

- allow plugin to adapt quicktool
- allow plugin to hook save, save event
- fix icon size in file explorer
@greptile-apps

greptile-apps Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The changes appear safe to merge, with only the existing non-blocking plugin API documentation concern remaining.

Findings

  1. P2 Plugin Contract Lacks Documentation

Summary

  • Routes quick-tool actions, modifiers, focus, selection, and cancellation through per-tab adapters.
  • Adds asynchronous save-event handling for custom tabs and safer save-all/close workflows.
  • Defers plugin-backed file loading until filesystem providers initialize while preserving cached restoration state.
  • Adds delegated long-press tooltips and adjusts file-browser icon sizing.
  • The previously reported quick-tools capture issue is resolved; the public adapter contract remains insufficiently documented.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Plugin[Plugin custom tab] --> Register[registerQuickToolsAdapter]
    Register --> Registry[Per-tab adapter registry]
    QuickTools[Quick-tools UI] --> Registry
    Registry -->|capture/restore selection| Plugin
    Registry -->|execute action| Plugin
    Registry -->|tab switch, overlay, busy state| Cancel[Cancel pending work]

    Save[Save commands] --> SaveEvent[Custom-tab save event]
    SaveEvent -->|respondWith promise| PluginSave[Plugin persistence]
    PluginSave -->|success| Workspace[Workspace save notifications]

    Restore[Restored plugin URI] --> ProviderCheck[Filesystem provider check]
    ProviderCheck -->|missing| PluginLoad[Wait for initial plugin load]
    PluginLoad --> Provider[Resolve provider and load file]
Loading

Reviews (4) · Last reviewed commit: "fix: plugin based file system intializat..."

Comment thread src/handlers/quickTools.js
@deadlyjack

This comment was marked as outdated.

Comment thread src/handlers/quickTools.js Outdated
Comment thread src/handlers/quickToolsInit.js Outdated
Comment thread src/lib/quickToolsAdapter.js Outdated
Comment thread src/lib/commands.js Outdated
Comment thread docs/file-save-events.md Outdated
@deadlyjack

This comment was marked as outdated.

Comment thread src/lib/acode.js
- improve tooltip bug and visibility
- UI issues
@deadlyjack

This comment was marked as outdated.

Comment thread src/lib/editorFile.js
Comment on lines +1901 to 1909
if (
!fsOperation.hasProvider(this.uri) &&
!isInitialPluginLoadComplete()
) {
await waitForInitialPluginLoad();
}
if (!this.#tab) return;
file ||= fsOperation(this.uri);
const fileExists = await file.exists();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slow provider startup can delete recovery data

waitForInitialPluginLoad() resolves when the 15-second plugin-load race finishes, even though a timed-out plugin continues loading in the background. If its filesystem provider registers after that timeout, fsOperation(this.uri) is still undefined here and .exists() throws. The catch path removes the restored tab, and destruction can delete its cached unsaved content. Keep the tab pending until the provider registers, or fail without removing the tab/cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs enhancement New feature or request

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants