Skip to content

Refactor visual designer architecture and graph coordination - #20249

Open
Shenglong Li (shenglol) wants to merge 5 commits into
mainfrom
shenglol/visualizer-hygine
Open

Refactor visual designer architecture and graph coordination#20249
Shenglong Li (shenglol) wants to merge 5 commits into
mainfrom
shenglol/visualizer-hygine

Conversation

@shenglol

@shenglol Shenglong Li (shenglol) commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactor the visual designer into explicit app, feature, UI, and library boundaries while preserving its existing behavior.

  • add feature-owned, typed messaging APIs
  • establish an explicit app environment for the Jotai store, host channel, synchronization, and theme
  • scope the canvas runtime to Canvas and expose UI actions through context
  • separate the client graph model, layout processing, rendering, and update coordination
  • simplify feature composition and consolidate the architecture documentation

Graph update coordinator fixes

The canvas now uses a React-independent GraphUpdateCoordinator with controlled-promise unit tests for its ordering rules. In addition to making the update flow easier to test, it fixes several concurrency bugs:

  • Preserve layout retries: a graphChanged layout response now schedules reconciliation and re-pends the interrupted layout, preventing a graph from remaining hidden behind the layout visibility gate.
  • Preserve reset intent: Reset Graph Layout outranks automatic layout and retains reset mode across retries, so it cannot be downgraded to an automatic layout that skips unchanged node dimensions.
  • Protect resource placement: update responses that arrive during a source mutation are discarded and fetched again after the expected node ID is bound to its drop origin.
  • Serialize mutations safely: source mutations run one at a time, and a rejected mutation does not stall the following mutation.
  • Settle requests correctly: callers arriving during a pass wait until all coalesced work is complete; failed passes release shared waiters so the reset-layout action cannot remain locked for the rest of the session.
  • Avoid lost follow-up work: pending work recorded while a drain is unwinding triggers another drain.

Validation

  • visual designer lint
  • 62 visual designer unit tests
  • 31 Playwright end-to-end tests
  • all 5 vscode-bicep-ui workspace builds
  • all 4 vscode-bicep-ui workspace test tasks
Microsoft Reviewers: Open in CodeFlow

Establish app, feature, UI, library, and development boundaries; normalize feature structure and enforce dependency direction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 91f8ba77-9474-4393-aa97-78e82fb5381b
Define feature-owned message descriptors and typed request, notification, and channel hooks across the visual designer.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 91f8ba77-9474-4393-aa97-78e82fb5381b
Hoist devtools and cross-cutting hooks, normalize naming and imports, and establish reusable graph, math, theme, and UI modules.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 91f8ba77-9474-4393-aa97-78e82fb5381b
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 33354576278)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 33354576278
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 33354576278"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 33354576278
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 33354576278"

Scope canvas actions and runtime ownership, separate graph model, layout, and application, and harden update, layout, and mutation ordering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 91f8ba77-9474-4393-aa97-78e82fb5381b
Replace legacy notes with concise current documentation for module boundaries, graph synchronization, layout, and resource creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 91f8ba77-9474-4393-aa97-78e82fb5381b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant