Skip to content

fix(flow designer): a flow wider than the canvas opens zoomed out to fit its width - #27978

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-9nt6x7
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-9nt6x7

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

维护者速读

Part of #27356 (row 22, hotcrm#2320 Studio S11: the flow canvas opens fitted at phone width)
Clause-②: no
Metadata-protocol: none

What changes

  • A diagram wider than the canvas opens fitted to its width. FlowCanvas framed every flow at 100%, centred, on mount. On a phone-width canvas a branching flow's outer branch nodes hung off both edges until the author pressed fit-to-view. The mount framing now takes z = max(MIN_ZOOM, min(1, (canvasWidth - 32) / diagramWidth)) and centres the diagram at that zoom.
    • It never zooms in: a diagram that fits opens at 100%, as before.
    • Width only: a tall linear flow still opens at 1:1, top-aligned, and the author scrolls down. This keeps the "familiar 1:1 on open" promise the effect's comment makes for every diagram that fits across.
    • A 0-wide (hidden) canvas opens at 100%, the same "nothing to fit" reading the width-change re-fit (objectui#11795) uses.
  • Unchanged: the zoom buttons, fit-to-view, the re-fit on a canvas width change, and the addNode / insertOnEdge call sites (another card is changing those two).
  • The surface: views/metadata-admin/previews/FlowCanvas.tsx is outside this order's declared Studio surface; the seat widened it to this one file for row 22.

Tests

  • New FlowCanvas.openFit-27356.test.tsx (4 tests) on the real canvas, with the viewport's box and ResizeObserver doubled as in FlowCanvas.resizeFit-11795: a three-branch flow at 390px opens below 100%, centred, its whole width inside the canvas, and the zoom readout shows that zoom; the same flow at 1400px opens at 100%, centred; a linear flow that fits 390px opens at 100%; a 0-wide canvas opens at 100%.
Readings (head 881dbf5, run on bf7e1c77, the same tree before a message-only amend; branch rebuilt from origin/main bacb3e6 after #27927 merged; install and app-shell closure rebuilt)
  • New file: 4/4 passed.
  • Every ui test file naming FlowCanvas (19 files, including feat(studio): Update Records offers the triggering record as its target, starts on the trigger object, and picks keys by label #27930's FlowCanvas.updateRecordSeed-27834): 19 passed, 293 passed.
  • pnpm --filter @object-ui/app-shell run type-check: exit 0 (lock VERDICT command-exit 0).
  • Ablation through scripts/ablation-replace.mjs (anchor 1 to 0): the mount zoom back to const z = 1;: 1 failed / 3 passed (the 390px branching case red); restored blob = HEAD blob 776392e9d921, git diff HEAD empty. vitest resolves @object-ui/* to source, so no rebuild leg.
  • pnpm --dir ui run check:i18n-drift: no en value changed.

Acceptance notes

  • Row 22's second half is ALREADY DONE on our side. The record cards' lines already come from the object's highlightFields (ADR-0085): plugin-grid objectGridGenerateColumns and plugin-list ListView lead with them when the object declares them, and Studio's object Settings tab edits them. "Account Name (Normalized)" is a HotCRM field that is not hidden, on an object that declares no highlightFields, so the default branch shows it. The fix is HotCRM's metadata (declare highlightFields, or mark the field hidden), outside this repo.
  • The 40% floor is the canvas's existing MIN_ZOOM. A diagram wider than 2.5 canvas widths still overflows at 40%; it was not measured on a real HotCRM flow.
  • Measured in happy-dom, which lays nothing out: the canvas and diagram widths are the box the test sets and the layout's computed size, not a rendered phone.

Verification

On head 881dbf54 (tree identical to bf7e1c77, where they ran): dispatch-gates --commands derived 34 families for this diff; all 34 were run locally, each exit 0, and --ran reconciled 34 run, 0 NOT-MEASURED, 0 UNRUN. check:new-line-citations: 0 new. CI check-runs were in progress when this was opened.


Generated by Claude Code

…fit its width

The flow canvas opened every flow at 100%, so a branching flow on a
phone-width canvas had its outer branches cut off at both edges. The mount
framing now zooms out until the diagram's width fits (floor MIN_ZOOM), never
zooms in, and leaves a 0-wide hidden canvas at 100%.

Claude-Session: https://claude.ai/code/session_01Utp6CZrsFMFmWFsxTaq2Bu
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · os-bill · session_01Utp6CaJoinvGQSbHeDaWBe

席位核对

ACCEPT · head 881dbf540b5a1ce56e71426451e63b043847992f · 2026-10-30T07:05Z

  • Shape: draft → main, Part of #27356 (row 22 only; the order lands one PR per row, so the card stays open), no closing keyword. Clause-②: no and Metadata-protocol: none match the claim. The change is Studio-side only, so no contract review is owed.
  • Premise, measured: at phone width, a branching flow opened at 100% with its outer branches cut off at both edges. FlowCanvas now opens zoomed to max(MIN_ZOOM, min(1, (w − 32) / diagramWidth)), centred.
  • Tests: FlowCanvas.openFit-27356 4/4 and the 19 FlowCanvas files (293 passed). Ablation (z = 1): 1 failed / 3 passed, restored. The readings are on bf7e1c77, and the head differs only in its commit message (a trailer refused by the pre-push hook); the tree is identical.
  • Gates (check-runs on the head): 44 success, 11 skipped, 0 failure; mergeable_state clean. check-governed-merges --pr 27978: NOT governed, 199 changed lines.
  • Accepted deviations: the branch was rebuilt from origin/main after row 13 (PR fix(studio): the read-only header offers an overlay only for a type that takes one #27927) merged, as the order sequenced it; the push was not forced. Part 2 of row 22 (HotCRM metadata) is answered in the Acceptance notes, and no card is filed.
  • Out of scope: rows 12, 14 and 19 wait on the maintainer's ruling.
  • Landing: non-governed, all checks green, mergeable_state clean ⇒ the seat lands it (pr_ready + automerge_enable).

Generated by Claude Code

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

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant