Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
d4ea383
feat(app-mode): layout grid primitive + system cells (Phase 1)
eliheuer Apr 16, 2026
96330d5
feat(bento): Phase 2a — per-input cells with uniform width
eliheuer Apr 14, 2026
0d31e3b
feat(bento): Phase 2b — per-output cells + design tokens
eliheuer Apr 14, 2026
43302f8
feat(app-mode): semi-customizable floating panels MVP (Phase 4)
eliheuer Apr 16, 2026
7da9659
style(app-mode): Phase 4 polish — typography, spacing, panel chrome
eliheuer Apr 16, 2026
451752b
refactor(app-mode): rename bento/ -> layout/
eliheuer Apr 16, 2026
1d16073
feat(app-mode): welcome screen — wordmark, copy, Run pill
eliheuer Apr 16, 2026
dde524f
feat(app-mode): unified chrome — shared sidebar + panel-matched cells
eliheuer Apr 16, 2026
8f8aa62
style(app-mode): flush left-dock + surface Run errors as toast
eliheuer Apr 16, 2026
a4addaa
i18n(app-mode): route output-thumb alt + block-drag aria-label throug…
eliheuer Apr 16, 2026
e28af8c
feat(app-builder): WYSIWYG floating panel shared with App Mode
eliheuer Apr 17, 2026
d9ae0dd
feat(app-mode): hoist Run cluster out of panel + mirror welcome copy
eliheuer Apr 17, 2026
c9b8e53
Merge branch 'main' into app-mode-semi-customizable-layout
DrJKL Apr 21, 2026
299292a
refactor(app-mode): address PR review feedback
eliheuer Apr 22, 2026
d436f54
fix(app-mode): second-round CodeRabbit feedback
eliheuer Apr 22, 2026
385b611
fix(app-mode): third-round CodeRabbit feedback
eliheuer Apr 22, 2026
9657403
Merge branch 'main' into app-mode-semi-customizable-layout
eliheuer Apr 22, 2026
3361a66
refactor(app-mode): unify App Mode and Builder chrome + panel
eliheuer Apr 23, 2026
3b70a54
refactor(app-mode): one grid system — fixed-gutter flex zones
eliheuer Apr 23, 2026
551a702
polish(app-builder): grid-aligned chrome bars + unified blue / orange…
eliheuer Apr 23, 2026
76dc717
polish(app-builder): highlight selectable widgets in builder:inputs
eliheuer Apr 23, 2026
550d855
polish(app-builder): output-selection parity + footer cleanup
eliheuer Apr 23, 2026
9adcea8
polish(app-mode): go/stop semantic cluster + run progress bar
eliheuer Apr 23, 2026
916ad31
refactor(app-mode): route go/stop colors through local CSS vars
eliheuer Apr 23, 2026
d621c7d
chore(app-mode): pre-squash CR-pattern cleanup
eliheuer Apr 23, 2026
69e1bff
Merge remote-tracking branch 'upstream/main' into app-mode-semi-custo…
eliheuer Apr 23, 2026
82f1980
chore(app-mode): pre-squash cleanup from .agents/checks audit
eliheuer Apr 23, 2026
fd022de
refactor(app-mode): unify App Builder and App Mode into one WYSIWYG s…
eliheuer Apr 23, 2026
e8c7076
chore: drop unused type exports flagged by knip
eliheuer Apr 23, 2026
38b197c
polish(app-mode): pre-draft-flip panel UX pass
eliheuer Apr 23, 2026
adc1db4
chore(app-mode): pre-review code-quality cleanup pass
eliheuer Apr 24, 2026
fbddb28
Merge remote-tracking branch 'upstream/main' into app-mode-semi-custo…
eliheuer Apr 24, 2026
d1f29f0
polish(app-mode): workspace pan/zoom + nav cluster + welcome touch-up
eliheuer Apr 24, 2026
32ab581
polish(app-mode): panel-block reorder — architecture + visuals
eliheuer Apr 24, 2026
583ba29
polish(app-mode): phase-3 drag demo + accent sweep
eliheuer Apr 26, 2026
0628acf
feat(app-mode): output preview as a movable window
eliheuer Apr 26, 2026
7c0d078
feat(app-mode): migrate run chrome into OutputWindow
eliheuer Apr 26, 2026
ccf166d
chore(app-mode): drop dead Interrupt/Progress cells
eliheuer Apr 26, 2026
4083442
feat(app-mode): multi-window output workspace (scaffolding)
eliheuer Apr 26, 2026
f067835
refactor(app-mode): drop the thumbnail history strip
eliheuer Apr 27, 2026
fc8e2f3
feat(app-mode): multi-window polish — asset resolution + close + clea…
eliheuer Apr 27, 2026
09d6ff6
polish(app-mode): UI pass — panel/window chrome, widget outlines, aut…
eliheuer Apr 27, 2026
8f3b9be
polish(app-mode): output overlay + widget chrome refinements
eliheuer Apr 27, 2026
d2e637b
polish(app-mode): floating-panel layout fixes + pre-review cleanup
eliheuer Apr 27, 2026
98f57a9
polish(app-mode): pan reliability + drag perf + dot-grid polish
eliheuer Apr 27, 2026
8c3fb37
polish(app-mode): address outstanding review nits
eliheuer Apr 27, 2026
a4128c8
docs(app-mode): defer agent design-system discoverability work
eliheuer Apr 27, 2026
ea0601a
chore(app-mode): comment trim pass for review (-343 lines)
eliheuer Apr 27, 2026
201fc1e
polish(app-mode): progress bar tracks sampler + window snap during drag
eliheuer Apr 27, 2026
bd4f9ef
chore(app-mode): trim small net-new files (-82 lines)
eliheuer Apr 27, 2026
17ecf38
refactor(app-mode): extract shared PanelHeader component
eliheuer Apr 27, 2026
895c0c1
refactor(app-mode): extract usePointerDrag base hook
eliheuer Apr 28, 2026
56bbd35
chore(app-mode): trim PR-added comments in modified files (-15 lines)
eliheuer Apr 28, 2026
d8355f4
chore(app-mode): drop remaining `!` Tailwind in chrome cells
eliheuer Apr 28, 2026
543f4b3
chore(app-mode): address CR review nits (batch 1/3)
eliheuer Apr 28, 2026
75b77b0
chore(app-mode): address CR review minors (batch 2/3)
eliheuer Apr 28, 2026
d676184
fix(app-mode): address CR review majors (batch 3/3)
eliheuer Apr 28, 2026
ed93de5
docs(app-mode): drop stale check count in discoverability note
eliheuer Apr 28, 2026
36c23a6
test(app-mode): fix LinearWelcome tests broken by run-pill addition
eliheuer Apr 28, 2026
ff60b57
polish(builder): step badges + Preview-step layout
eliheuer Apr 28, 2026
1289e61
refactor(app-mode): drop temp accent/active tokens for design-system
eliheuer Apr 28, 2026
d4dc570
refactor(builder): unify selection chrome, drop zoom-dependent sizing
eliheuer Apr 28, 2026
f6a29be
refactor(design-system): fold layout tokens into style.css
eliheuer Apr 28, 2026
c497c8c
refactor(design-system): consolidate App Mode tokens, drop README
eliheuer Apr 28, 2026
90f140b
chore(app-mode): trim noisy comments across new files
eliheuer Apr 28, 2026
563742f
feat(app-mode): resize OutputWindow, smooth fly-to, grid-edge spawn
eliheuer Apr 29, 2026
1d16598
feat(app-mode): align panel widgets + metadata-driven subtitle
eliheuer Apr 29, 2026
61ff478
refactor(app-mode): extract FLIP composable, persist panel layout
eliheuer Apr 29, 2026
d434a0d
chore(app-mode): comment sweep + LinearArrange refactor
eliheuer Apr 29, 2026
91bd183
refactor(app-mode): center welcome card; drop side-flip machinery
eliheuer Apr 29, 2026
b007a55
fix(app-mode): drop double focus-ring on widget pills
eliheuer Apr 29, 2026
676a443
Merge branch 'main' into app-mode-semi-customizable-layout
DrJKL Apr 29, 2026
13b3e09
feat(app-mode): no-zoom dashboard mode with adaptive bento layout
eliheuer Apr 30, 2026
6f91765
feat(app-mode): add slicing-tree bento candidate
eliheuer Apr 30, 2026
2a21d12
fix(app-mode): snap dashboard tiles to chrome cell grid
eliheuer Apr 30, 2026
c274133
feat(app-mode): fill canvas via slicing-tree + stretch + cover-fit
eliheuer Apr 30, 2026
0d18fe0
feat(app-mode): asymmetric bento stretch — newest tile uncropped
eliheuer May 1, 2026
8f00acb
feat(app-mode): cap dashboard at 9 tiles, full slicing-tree always
eliheuer May 1, 2026
5edcdf8
fix(app-mode): drop the 8px body padding around output images
eliheuer May 1, 2026
274d32c
fix(app-mode): N=1 stays uncropped, anchored opposite the panel
eliheuer May 1, 2026
152653a
refactor(app-mode): rebuild dashboard layout for visual fidelity
eliheuer May 1, 2026
1f0cfea
feat(app-mode): bento templates fill avail rect, hide header on small…
eliheuer May 1, 2026
de52814
refactor(app-mode): clean up output header chrome + fix panel-drag fr…
eliheuer May 1, 2026
4754980
style(app-mode): match input-cell label/subtitle type, breathe out te…
eliheuer May 1, 2026
681a959
feat(app-mode): theme toggle, zoom-mode parity, gradient skeletons
eliheuer May 2, 2026
989754e
Merge remote-tracking branch 'upstream/main' into app-mode-semi-custo…
eliheuer May 6, 2026
4fb60b8
refactor(app-mode): use palette tokens instead of local --app-mode-* …
eliheuer May 6, 2026
2746856
refactor(app-mode): tighten design-system conformance
eliheuer May 6, 2026
9c171c1
refactor(app-mode): conformance pass per AGENTS.md
eliheuer May 6, 2026
055e46e
refactor(app-mode): minor cleanups from deep audit
eliheuer May 7, 2026
2640d09
lint(autofix): tailwind class order in files using foreground tokens
eliheuer May 7, 2026
c6cf567
test(app-mode): include layout.panelRows in linearData expectations
eliheuer May 7, 2026
fd75632
test(app-mode): unit coverage for new store math
eliheuer May 7, 2026
1acdb42
refactor(app-mode): scope foreground tokens to App Mode via arbitrary…
eliheuer May 7, 2026
a4d4145
Revert "lint(autofix): tailwind class order in files using foreground…
eliheuer May 7, 2026
1a7300b
lint(autofix): canonical class names in pre-existing files
eliheuer May 7, 2026
7e5a95a
fix(app-mode): evict by createdSeq, not mutable zIndex
eliheuer May 7, 2026
6b9dfe8
fix(test): pass ComfyPage to reSaveAs instead of dereferencing Locator
eliheuer May 7, 2026
f357c57
fix(app-mode): spread graphNodes shallowRef on every assignment
eliheuer May 7, 2026
c668618
fix(app-mode): disable manual drag/resize on output windows in noZoom…
eliheuer May 7, 2026
4c140cb
fix(app-mode): don't silently rerun current graph when output has no …
eliheuer May 7, 2026
1a1025b
fix(app-mode): scope wheel-zoom to the workspace, leave panel scroll …
eliheuer May 7, 2026
c48d731
fix(app-mode): keep full-viewport backdrop hit-testable for pan/zoom
eliheuer May 7, 2026
5a31405
fix(app-mode): address 5 minor CodeRabbit findings
eliheuer May 7, 2026
2f7e90a
fix(app-mode): address 5 load-bearing CodeRabbit findings (round 2)
eliheuer May 8, 2026
7a5e375
docs(adr): add 0009 App Mode + Builder unification; format pass
eliheuer May 9, 2026
c997195
fix(app-mode): address round-3 CodeRabbit findings (5 follow-ons + 4 …
eliheuer May 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(adr): add 0009 App Mode + Builder unification; format pass
CONTRIBUTING.md asks contributors to (a) document significant
architectural decisions via ADRs, and (b) ensure `pnpm format` is
clean before submitting. Both checked here.

ADR 0009 records the rationale for unifying App Mode and App Builder
behind a single store (`appModeStore`) and shared chrome
(`AppChrome`, `FloatingPanel`), the alternatives considered (a
translation layer, save-time generation), and the consequences —
including the moodboard semantics shift in the output workspace
and the larger-than-typical PR shape.

Format: `oxfmt` collapsed the multi-line shadow declaration in
`src/assets/css/style.css:9-10` to a single line. Cosmetic only.
  • Loading branch information
eliheuer committed May 9, 2026
commit 7a5e37589cce57eb47074243d2c7c3e080dd0363
194 changes: 194 additions & 0 deletions docs/adr/0009-app-mode-builder-unification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# 9. App Mode and App Builder Unification

Date: 2026-05-08

## Status

Proposed

## Context

App Mode (the runtime view consumed by an app's end users) and App
Builder (the authoring view used to wire inputs and outputs) were
implemented as parallel UIs. They shared the workflow graph but each
maintained its own chrome (top bar, panel rails, run controls), its
own panel layout state, its own viewport pan/zoom state, and its own
output-display affordance (a thumbnail strip in App Mode, an inline
preview in Builder).

This produced four recurring problems:

1. **Loss of WYSIWYG.** Edits in Builder did not appear identically in
App Mode. Authors had to switch modes, verify, and repeat.
2. **State drift.** Panel preset, panel collapse, and per-input grid
position lived in disconnected places, with no single
serialization surface. Workflow files persisted partial state.
3. **Duplicated chrome.** Run/Stop, batch count, zoom controls,
builder-step controls, and feedback affordances were each rendered
by both modes' chrome with mode-specific bug fixes that drifted.
4. **Single-output bottleneck.** App Mode displayed one output at a
time via a thumbnail strip. Comparing or arranging multiple
outputs required leaving App Mode entirely. App Mode users
asked for a mood-board surface; App Builder users asked for "the
real thing the user will see" in the authoring view.

Related: PR
[#11317](https://github.com/Comfy-Org/ComfyUI_frontend/pull/11317).

## Options

### A. Translation layer between parallel UIs

Keep App Mode and Builder as separate components. Add a translation
layer that maps Builder edits into App Mode's runtime state and vice
versa.

- **Pro**: Smallest change. Each mode keeps its current shape.
- **Pro**: No risk to the App Mode runtime contract used by deployed
apps.
- **Con**: The translation layer becomes its own correctness surface,
requiring tests and maintenance every time either mode adds a
feature.
- **Con**: WYSIWYG still relies on a translation step, not on
shared rendering. Subtle visual drift remains.
- **Con**: The single-output thumbnail-strip vs. multi-output
mood-board question is unaddressed — that's a UX decision the
translation layer can't make for either mode.

### B. Generate App Mode from Builder state at save time

Builder edits a richer authoring document; on save, the document is
compiled into the App Mode runtime state (a different shape).

- **Pro**: Clear separation of authoring concerns vs. runtime
concerns.
- **Pro**: Builder gets free reign on structure without affecting the
runtime contract.
- **Con**: Same WYSIWYG loss as A — App Mode runs the _output_, not
the live edit. Authors still need to save + reload to verify.
- **Con**: Two document shapes to keep in sync.
- **Con**: Doesn't simplify the chrome duplication or address the
single-output question.

### C. Unify via shared store + shared components (selected)

App Mode and Builder render the **same** chrome and panel components,
backed by a **single** store (`appModeStore`) holding panel preset,
panel rows, viewport state, selected inputs, and selected outputs.
Builder edits write directly to the same state App Mode consumes;
the only mode-specific differences are the conditional
edit-affordance overlays (drag handles on panel blocks, the
input/output-selection scrim in Builder, etc.).

The output surface is generalized to a multi-window workspace inside
a pan/zoom viewport (the "mood board"); each generation produces a
floating output window that can be promoted, repositioned,
maximized, or pruned. The single-output thumbnail strip is removed.

- **Pro**: WYSIWYG by construction. There is no translation layer
because the two modes render the same components against the
same state.
- **Pro**: Chrome rendering, panel reordering, viewport state,
and output windowing each have **one** implementation. Bug
fixes and refinements apply uniformly.
- **Pro**: Workflow serialization gets a single coherent shape
(`extra.linearData.layout`) that captures the unified state
forward-compatibly via `.passthrough()`.
- **Pro**: Multi-window output workspace addresses the long-standing
request for arrange-and-compare without leaving App Mode.
- **Con**: Larger PR than typical. The chrome + store + panel +
output-windows interlock means that splitting the change into
smaller PRs would require flag-gated half-states or
almost-immediate rewrites of one half by the other.
- **Con**: New surface area in `appModeStore` (viewport math,
panel-row reconciliation) and `outputWindowStore` (eviction,
bento layout) to keep tested and maintained.
- **Con**: Output windows persist beyond their source generation
(moodboard semantics), which is a behavior change from the prior
thumbnail strip. Cleanup is now an explicit user action ("Clear
all output windows" in the chrome rail).
- **Con**: The drag/resize semantics differ between zoom mode (free
placement) and no-zoom dashboard mode (auto-arranged grid). The
`relayoutDashboard()` and pruning logic are non-trivial.

## Decision

Adopt **Option C**.

The unification is implemented as:

- `appModeStore` — single source of truth for panel preset, panel
rows, viewport pan/zoom, selected inputs/outputs, and per-input
widget config. Persists to `rootGraph.extra.linearData` via
builder-mode-only watchers.
- `AppChrome.vue` + `FloatingPanel.vue` — rendered by both modes via
the `variant` prop, which gates only edit affordances and chrome
topology, not the underlying state.
- `outputWindowStore` — multi-window output state, with an eviction
policy (in-flight tier > finalized tier; finalized within tier
evicted by `createdSeq`, not click-mutable `zIndex`) and a
bento-template auto-layout when no-zoom dashboard mode is active.
- `LayoutView.vue` — the pan/zoom workspace host that App Mode and
the Builder's arrange step both render into.
- Workflow schema gains `extra.linearData.layout` as a partial,
passthrough-permitted block carrying `panelPreset`,
`panelCollapsed`, `panelWidthCells`, and `panelRows`.

## Consequences

### Positive

- WYSIWYG between Builder and App Mode is structural, not asserted
by tests.
- Future panel features (additional presets, new block kinds, panel
resize semantics) land once and apply to both modes.
- Output windowing replaces the single-thumbnail surface and opens
the door to comparison-driven authoring loops without a separate
mode for it.
- Builder no longer needs to ship its own chrome; existing chrome
cells (`RunCell`, `BatchCountCell`, `JobQueueCell`,
`ModeToggleCell`, `FeedbackCell`, `IconCell`) participate in
Builder's footer too.
- Workflow files become forward-compatible carriers of layout
state. Older clients ignore the new fields cleanly via
`.passthrough()`.

### Negative

- The PR introducing the unification is large. The "Why this is
one PR" rationale is recorded in PR #11317's description; future
similar unifications should expect the same shape.
- `appModeStore` accumulates more than the original App Mode
responsibilities. Its public surface is broader than is
conventionally Pinia-idiomatic.
- The dashboard relayout math (eviction, bento templates,
panel-aware tile distribution) is novel layout code with limited
precedent in the codebase. It must remain unit-tested as it
evolves.
- Output windows that survive a workflow swap are a behavior
change. Users expect the prior generation's outputs to persist
across runs of a different workflow until explicitly cleared.

## Notes

- The unification deliberately **does not** introduce a CRDT or ECS
for panel state. App Mode panel state is workflow-local and
user-owned; the document-collaboration concerns ADR
[0003](0003-crdt-based-layout-system.md) addresses do not apply.
ADR [0008](0008-entity-component-system.md)'s entity-system scope
is graph entities (LGraphNode etc.), not panel chrome, and is
therefore also out of scope here.
- The semantic-token gap surfaced during the conformance pass for
this PR (`--success-foreground`, `--destructive-foreground`,
`--primary-foreground` not previously present in the design
system) is documented as a follow-up upstream-PR opportunity in
[comfyui-theme-tools](https://github.com/eliheuer/comfyui-theme-tools)'s
`docs/upstream-pr-opportunities.md`. App Mode references the
underlying tokens via Tailwind 4 arbitrary-value syntax
(`text-(--success-foreground)`) until the design-system tier is
expanded.
- The four `<style scoped>` blocks in `InputCell`, `ModeToggleCell`,
`FeedbackCell`, and `PanelBlockList` use `:deep()` + `!important`
to reset third-party widget chrome (PrimeVue, Typeform). Each
carries an inline TODO citing a `layout` prop on `NodeWidgets`
as the proper upstream fix; landing that prop is a follow-up.
1 change: 1 addition & 0 deletions docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ An Architecture Decision Record captures an important architectural decision mad
| [0006](0006-primitive-node-copy-paste-lifecycle.md) | PrimitiveNode Copy/Paste Lifecycle | Proposed | 2026-02-22 |
| [0007](0007-node-execution-output-passthrough-schema.md) | NodeExecutionOutput Passthrough Schema | Accepted | 2026-03-11 |
| [0008](0008-entity-component-system.md) | Entity Component System | Proposed | 2026-03-23 |
| [0009](0009-app-mode-builder-unification.md) | App Mode and App Builder Unification | Proposed | 2026-05-08 |

## Creating a New ADR

Expand Down
3 changes: 1 addition & 2 deletions src/assets/css/style.css
Comment thread
eliheuer marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
more separation. Could be lifted to a design-system
--shadow-floating-panel token in a follow-up. */
--app-mode-floating-panel-shadow:
0 2px 4px rgb(0 0 0 / 0.4),
0 16px 48px rgb(0 0 0 / 0.45);
0 2px 4px rgb(0 0 0 / 0.4), 0 16px 48px rgb(0 0 0 / 0.45);
}

/* Shared surface for FloatingPanel + Builder toolbars. */
Expand Down