Skip to content

feat(workflows): switch between graph and form by keyboard - #10226

Open
renningg wants to merge 3 commits into
invoke-ai:mainfrom
renningg:feat/workflow-view-shortcut
Open

renningg wants to merge 3 commits into
invoke-ai:mainfrom
renningg:feat/workflow-view-shortcut

Conversation

@renningg

@renningg renningg commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Press Shift+Z in the workflow graph editor or the left Workflow panel to move keyboard focus to the other view. The shortcut reveals a collapsed destination and can be changed in Settings → Hotkeys under Switch workflow view.

Related Issues / Discussions

Related to #6429.

QA Instructions

  • Open the Workflow layout, press Shift+Z in the graph, then press it again in the Workflow panel. Focus moves in both directions. Repeat with the left panel collapsed or with the graph in the bottom region.
  • In Compose, add Workflow to the left panel without opening the graph. Press Shift+Z twice. The graph and original panel stay visible, and focus returns to the panel.
  • In Compose, press 4 to open Workflow, enable Workflow in the left rail, then select Preview in the center. Focus the left Workflow panel and press Shift+Z twice. The existing graph opens alongside the original panel without adding another Workflow tab. The second press returns focus to the panel.
  • Verified in Chromium with a 100-node mock workflow. The targeted checks passed 16 browser tests and 45 unit tests.
  • pnpm check:release passed formatting, lint, and types. The unit stage hit the same two macOS shortcut assertions on this branch and the clean base. The remaining release stages did not run.

Review

The shortcut preserves the panel's selected tab and form mode. When both docked graph views are visible, focus returns to the center graph. A floating editor stays in place when there is no left Workflow panel to switch to.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Meaningful regression coverage added / updated where needed; obsolete tests/code removed
  • Persisted-state and API changes include required migrations / compatibility validation
  • Relevant performance/efficiency opportunities considered; material claims have evidence
  • Material review findings resolved and relevant checks rerun
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)
workflow-view-command

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Add a remappable Shift+Z shortcut for the workflow editor and panel. Reveal the target view and move focus while preserving the panel mode.
@github-actions github-actions Bot added frontend PRs that change frontend files docs PRs that change docs labels Nov 10, 2026

@joshistoast joshistoast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Otherwise, the approach is contained, reuses existing infrastructure, and adds meaningful tests without apparent performance concerns. It provides useful navigation, though narrower than the original issue’s edit/linear-mode toggle.

Comment on lines +334 to +340
const opened = openWidgetPlacement({
getWidgetsForRegion,
options: { preferredRegions: [destination] },
projectId: project.id,
typeId: 'workflow',
widgets,
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Shift+Z can hide the Workflow panel it starts from.

Reproduce by starting in Compose, adding Workflow to the left panel, then pressing Shift+Z. Opening the missing center graph reuses the left panel’s instance. The reducer then switches the left panel to another widget or collapses it. A focus-navigation shortcut unexpectedly removes the companion form.

Preserve the left panel when opening the graph, and add regression coverage for this layout. The existing test misses it because the default Workflow layout uses separate instances.

Open a separate workflow graph instance from the Compose panel. Cover the focus round trip and preserve the panel in custom layouts.

@joshistoast joshistoast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

your last commit almost fixed it.

Comment on lines +360 to +366
const opened = openWidgetPlacement({
getWidgetsForRegion,
options: { preferredRegions: [destination] },
projectId: project.id,
typeId: 'workflow',
widgets,
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Revealing an existing graph still hides the left Workflow panel.

Reproduction:

  1. Start in Compose and press 4 to open Workflow.
  2. Enable Workflow in the left rail.
  3. Select Preview in the center.
  4. Focus left Workflow and press Shift+Z.

The existing graph bypasses the new fix. Opening it reuses the shared instance, switching the left panel to another widget or collapsing it. The new tests cover only a missing graph.

Select the existing center Workflow tab directly so a shared panel stays open.
@renningg

Copy link
Copy Markdown
Contributor Author

Thanks for catching this, @joshistoast. The latest commit (0ecf936) keeps the left Workflow panel open when Shift+Z reveals an existing graph. I added a regression test for that layout, and the frontend tests passed in CI.

Could you take another look when you have a chance?

This branch has not been deployed

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

Labels

docs PRs that change docs frontend PRs that change frontend files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants