Skip to content

feat(plugins): suggest an official plugin when a file type has no highlighting - #30760

Closed
nwparker wants to merge 4 commits into
nwparker/plugins-v2-7-syntax-packsfrom
nwparker/plugins-v2-8-file-type-suggestions
Closed

nwparker wants to merge 4 commits into
nwparker/plugins-v2-7-syntax-packsfrom
nwparker/plugins-v2-8-file-type-suggestions

Conversation

@nwparker

@nwparker nwparker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​287 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​283
Prod 25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​477 $\color{#cf222e}{\Huge{\mathbf{−}}}$​35 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​442

ELI5

When you open a file Orca can't highlight or display, and a plugin in your catalog says it handles that file type, Orca shows a one-line banner offering it. You can look at the plugin, hide the banner for now, or tell Orca never to suggest it for that extension. Nothing is ever installed from the banner.

What Changed

Before: unknown file types opened as plain text or showed "Binary file — cannot display", with no hint that a plugin could help.

After:

  • A banner above the editor. It appears for plain-text files and replaces the binary placeholder: "A plugin can open .{ext} files: {name}".
    • View plugin opens the same reviewed marketplace preview as the catalog. It never installs.
    • Not now hides it for the session.
    • Don't suggest for .{ext} remembers the extension.
  • A setting. Plugins → "Suggest plugins for unknown files" turns suggestions off. They are also off whenever the plugin system is off.

How it works:

  • Catalog (plugin-catalog-release.ts, plugin-file-type.ts):
    • A v2 catalog release can list fileTypes (lowercase extensions without the dot) and the plugin's name. Invalid or extra fileTypes entries are dropped (up to 32 kept) rather than rejecting the release, and name must match the manifest.
    • When the release is verified, each listed type must appear among the manifest's syntax extensions, or the release is rejected.
    • The release schema already strips unknown keys, so older clients are unaffected.
  • Matching (src/main/plugins/plugin-file-type-suggestion.ts, plugins:suggestForFileType):
    • It reads only cached, verified catalogs, with no fetch on file open (listCachedPlugins).
    • It takes the first official listing in catalog order. A user-added marketplace never produces an unsolicited suggestion.
    • It skips kill-listed releases, plugins already installed, and any type an installed plugin handles, even a disabled one.
  • Settings (pluginFileTypeSuggestions, pluginDismissedFileTypes): normalized on write and load in main, through one normalizePluginOwnedSettings. Dismissals keep the newest 256.
  • Renderer:
    • PluginFileTypeSuggestion.tsx is used in EditorEditFileSurface. It is a role="status" banner that shows the release's name.
    • "View plugin" goes through a small preview-request store. PluginMarketplaceBrowser consumes it once its listings load, and clears a request it can't serve so it never pops open later.
  • Catalog reads: the marketplace store keeps parsed snapshots in memory. Its own writes and removals update them, so a file open never re-reads catalogs from disk.

Why

  • Cached catalogs only. Opening a file must stay instant and offline-safe. A banner that waited on the network would be worse than no banner.
  • Preview, never install. A suggestion leads to the reviewed preview and consent path that every other install uses.
  • Skip types any installed plugin handles. Pointing users at something they already have, even disabled, is noise.

Linked Issue

None. This is part of the plugin platform rework (maintainer change).

Visual Proof

Captured in the end-to-end run (hidden window, isolated profile) against a local Git v2 catalog:

  • Banner on a .gleam file (the Gleam example pack is listed in the catalog): 1-banner.png
  • View plugin opens the marketplace preview; nothing installs: 2-preview.png
  • After "Don't suggest for .gleam": 3-dismissed.png

Testing

  • Unit tests:

    • The matcher: catalog order, kill list, installed or handled types, off, and dismissed (plugin-file-type-suggestion.test.ts).
    • The release check (plugin-catalog-release.test.ts).
    • Extension parsing and settings bounds (plugin-file-type.test.ts).
    • The banner: view, never-install, Don't suggest, Not now, and off (PluginFileTypeSuggestion.test.tsx).
  • End-to-end: plugin-file-type-suggestion.spec.ts (in the smoke PR) runs the whole flow against a real local Git v2 catalog.

  • Checks: suites, tc:node, tc:web, oxlint, check:code-quality:changed and localization checks pass locally.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH and WSL: matching uses only the extension, so remote files get the same suggestion.
  • Compatibility: fileTypes is optional and stripped by older clients. The new settings are optional, and older clients ignore them.
  • Depends on: the syntax packs PR.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred). Targeted suites, typechecks, oxlint, the change-quality gate and plugin e2e pass locally; full pnpm lint not run.

@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from 240106d to bbec1a5 Compare October 19, 2026 21:42
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from b77bd91 to a654606 Compare October 19, 2026 21:42
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from bbec1a5 to 65098ae Compare October 21, 2026 06:34
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from a654606 to ee52e94 Compare October 21, 2026 06:35
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from 65098ae to 4d4c87c Compare October 21, 2026 12:23
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from ee52e94 to b383d4e Compare October 21, 2026 12:23
@nwparker
nwparker marked this pull request as ready for review October 21, 2026 12:24
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from 4d4c87c to 7aa0734 Compare October 21, 2026 20:10
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from b383d4e to 8cb344c Compare October 21, 2026 20:11
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from 7aa0734 to 0ca1685 Compare October 24, 2026 11:43
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from 8cb344c to 5a045cc Compare October 24, 2026 11:44
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from 0ca1685 to e2c7d24 Compare October 24, 2026 12:55
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch 2 times, most recently from 936b3f9 to 8b91c90 Compare October 24, 2026 13:31
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from 1815b6e to bf08223 Compare October 25, 2026 05:23
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch 2 times, most recently from ab92ebe to 6a6f51a Compare October 26, 2026 12:04
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from bf08223 to 20e19c6 Compare October 26, 2026 12:04
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from 6a6f51a to d740d07 Compare October 26, 2026 12:32
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch 2 times, most recently from ad09422 to 48cb49b Compare October 28, 2026 04:57
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from d740d07 to 3691df7 Compare October 28, 2026 04:58
@nwparker
nwparker force-pushed the nwparker/plugins-v2-7-syntax-packs branch from 48cb49b to 65e407c Compare October 28, 2026 05:30
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from 3691df7 to 7193340 Compare October 28, 2026 05:30
When a file shows as plain text or as a binary Orca can't display, and a
cached catalog lists a release whose fileTypes include its extension, the
editor offers it: View plugin opens the marketplace preview (never an
install), Not now hides it for the session, and Don't suggest remembers
the extension. Suggestions come only from cached, verified catalogs, skip
kill-listed releases and anything an installed (even disabled) plugin
already handles, and can be turned off in Plugins settings. A release's
fileTypes must match its manifest's syntax extensions.
The editor stays mounted when its file changes, so a single hidden flag
suppressed the suggestion for the next file type too. Track which file
type was hidden instead.
@nwparker
nwparker force-pushed the nwparker/plugins-v2-8-file-type-suggestions branch from 7193340 to bf3494d Compare October 28, 2026 10:53
@nwparker nwparker mentioned this pull request Oct 28, 2026
7 of 9 tasks
@nwparker

Copy link
Copy Markdown
Contributor Author

Folded into #35470 (Plugin Alpha), which lands the rest of the plugin stack in one PR.

@nwparker nwparker closed this Oct 28, 2026
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