feat(plugin): document-root relaunch button for one-click reopen - #74
Open
jamesjohn-ui wants to merge 1 commit into
Open
jamesjohn-ui wants to merge 1 commit into
jamesjohn-ui wants to merge 1 commit into
Conversation
Plants a per-file relaunch button on `figma.root` via `setRelaunchData` plus a matching `relaunchButtons` entry in the plugin manifest. Once the Bridge has run in a file, the design panel surfaces an "Open Figma Desktop Bridge" button when nothing is selected — one click reopens it. Workflow win: designers and AI agents working across many Figma files no longer have to dig through Plugins > Development > Figma Desktop Bridge > Run each time they switch back to a file. The relaunch data persists with the document, survives close/reopen and Figma restarts, and syncs across collaborators on the same file. Honest scope: this only helps RE-opens in files where the Bridge has already run once. The first launch per file is still user-driven — Figma's plugin API does not expose any cross-file launch surface, so that gap is structural, not addressable from inside the plugin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Problem
Multi-file Figma workflows — especially when paired with AI agents driving the Bridge — need a reliable way to reopen the Bridge per file. Today, every reopen requires:
Plugins > Development > Figma Desktop Bridge > RunThat's three clicks of menu friction every time you switch back to a file where the Bridge was previously running. For agents that need the Bridge alive in the active file to do anything useful, this turns into a constant interrupt.
Solution
Plant a per-file relaunch button on
figma.rootviasetRelaunchData, plus a matchingrelaunchButtonsentry in the plugin manifest. Once the Bridge has run in a file, the design panel surfaces a one-click "Open Figma Desktop Bridge" button when nothing is selected.The relaunch data is persisted with the document — survives close/reopen, Figma restarts, and syncs across collaborators on the same file.
Scope (honest)
This only helps re-opens in files where the Bridge has already run at least once. The first launch per file is still user-driven.
That gap is structural: Figma's plugin API does not expose any cross-file launch surface (no
relaunchButtons/setRelaunchDatausage exists prior to this PR, no Widget surface in this plugin, no cross-file events). I'm deliberately not trying to paper over that limitation.A broader UI overhaul (settings modal, port override, debug copy, etc.) is out of scope here — happy to follow up with a separate PR if that's of interest.
Testing
Verified end-to-end in a scratch Figma file:
setRelaunchDatacall succeeds on document root (no thrown error path hit)figma.command === 'open'Files changed
figma-desktop-bridge/code.js— +13 lines (try/catch aroundfigma.root.setRelaunchDatainside the existingloadAllPagesAsync().then(...)block)figma-desktop-bridge/manifest.json— +3 lines (top-levelrelaunchButtonsarray with one{ command: "open", name: "Open Figma Desktop Bridge" }entry)No behavioural changes outside the relaunch surface. The
try/catchguards against any edge case (e.g. permissions, future API changes) without affecting the rest of the bootstrap.