Skip to content

fix(workspace): the rail column is a width, so it moves with the canvas (#2676) - #2677

Merged
vybe merged 4 commits into
devfrom
fix/2676-rail-column-motion
Sep 11, 2026
Merged

vybe merged 4 commits into
devfrom
fix/2676-rail-column-motion

Conversation

@dolho

@dolho dolho commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Closes the deferred half of #2640. Filed as #2676 during that PR's review, claimed and handled here.

Stacked on #2647. This branches off fix/2640-voice-call-layout-motion, because the code it changes is that PR's. Merge #2647 first and this diff reduces to the five files below.

The defect

#2640 animated two of the three columns. The rail was the third and it still stepped.

PortalRail's <aside> carries no width transition in either state, and it was a bare v-if on a shrink-0 flex sibling of <main>. On call end it appeared at full size in one frame:

  • 48px collapsed,
  • 384px open,
  • or whatever --ws-rail had been dragged to.

On a wide, open rail that single-frame jump is larger than the 211px snap #2640 set out to remove.

The fix

The width moves onto a wrapper this view owns, not onto PortalRail's own <aside> — the same shape the sidebar column three columns to the left already has (shrink-0 overflow-hidden + an explicit --ws- width). --ws-rail is the rendered width (48px collapsed, the dragged width open), so one binding covers both states and agrees with the inner aside at rest.

Vue enter/leave classes, not an always-on transition-[width]. This is the load-bearing decision: that same variable is rewritten on every pointermove of a rail drag, so a permanently-transitioned width would make dragging the rail rubber-band by 300ms. Vue adds the active class only for the enter/leave window and removes it afterwards, so a drag stays instant. !w-0 is !-marked for the reason the canvas's !grow-0 is.

It retires voiceCanvasLeaving. That flag held the rail out of the row for the whole of the canvas's leave, because a rail mounting at full width beside a still-shrinking canvas put three columns in a row sized for two. A rail entering from zero width is complementary to a canvas leaving towards zero grow — the row's total is conserved at every frame — so the hazard is gone by construction, and the two motions now overlap instead of running back to back.

railHasColumn is the one shared condition. It reads railTabs.length because PortalRail's own root carries v-if="tabs.length" — with the width on a wrapper, a tabless rail would otherwise leave a full-width empty column behind.

Verification — measured, not argued

Headless Chromium against the real built stylesheet:

normal motion            mid=322.2  settled=384.0  -> ANIMATED
drag after transition    600                       -> instant
prefers-reduced-motion   mid=384.0  settled=384.0  -> INSTANT

Mid-transition the column is at 322 of its 384, so it interpolates rather than stepping; a drag issued once the active classes are gone lands in the same frame; and prefers-reduced-motion is instant (the motion-reduce:duration-0 finding from #2647's review carries through to the two classes added here).

The three Tailwind utilities are confirmed present in the built CSS — an arbitrary-value miss would have made the whole thing silently inert:

.\!w-0{width:0!important}
.transition-\[width\]{transition-property:width;…}
.w-\[var\(--ws-rail\,24rem\)\]{width:var(--ws-rail,24rem)}

Acceptance criteria

  • Ending a call moves the rail column continuously — collapsed, open, and at a dragged --ws-rail
  • Starting a call is symmetric — the rail does not vanish in one frame while the canvas ramps in
  • prefers-reduced-motion stays instant, both classes on every transitioning element
  • The exclusivity invariant holds — one shared computed, and any overlap is complementary by construction

Accepted discontinuity

thirdColumnResizable is gated on !voiceCall.active, so the 8px resize handle still appears and disappears in one frame. It is 8px against a column that moves 384, and animating it would mean a second animated element whose only content is a 1px line. Recorded in the feature flow.

Tests

The transition scan now reads class attributes rather than the whole file: this change's own comments name transition-[width] while explaining it, and a file-wide match reports the prose as an unguarded transitioning element.

Three source guards updated where the v-if moved — each asserts the shared computed, which is the property; which element carries the condition is not. Four new cases: the ramp's classes, the static class carrying no transition-, the retirement of voiceCanvasLeaving, and the tabless-rail gate. Removing the <Transition> reds the first.

113 files / 2536 tests green. Raw-colour ratchet unchanged.

Fixes #2676

🤖 Generated with Claude Code

https://claude.ai/code/session_01RSjVEjay9ztC1oDXXkh9uN

dolho and others added 3 commits September 9, 2026 13:13
…ts box (#2640)

Two defects, one report.

**The layout jumped.** `Portal.vue` toggled `<main>` between `flex-1` and
`sm:flex-[2_1_0%]` on `voiceCall.active` and swapped `PortalRail` for
`PortalVoiceCanvas` in the same frame. Nothing transitioned, so both columns
landed at their new shares in one paint, and End call jumped back.

`flex-grow` is a `<number>` and therefore animatable, so the share now
transitions — 300 ms ease-out on `<main>`, and the canvas column ramps its own
grow 0 → 3 over the same curve. The ramp is expressed as Vue enter/leave
classes rather than a class toggle because a newly inserted element has no
value to transition FROM. Opacity rides the same transition so the canvas's
content is not re-wrapping in view while the column is still moving.
`motion-reduce:transition-none` on every transitioning element.

The shares stay shares: reverting to `w-[40%]` / `w-[60%]` would animate just
as well and re-open #2581, where those summed to 100% + an 18rem sidebar and
the shell clipped the canvas column off the right edge.

Two consequences, both deliberate:

* The `v-if` / `v-else-if` chain is gone — a `<Transition>` wrapper breaks the
  adjacency a chain needs. The exclusivity it guaranteed by construction is now
  a named computed both arms read, so they cannot drift into both claiming the
  column.
* The rail waits for the canvas to finish leaving. Vue keeps a leaving element
  in the DOM for its transition; without the gate the rail would mount at full
  fixed width beside a canvas that is still shrinking — three columns in a row
  sized for two, `<main>` squeezed by flex for 300 ms, a worse jump than the one
  being fixed.

**The orb rendered squashed.** `VoiceOverlay.vue::resizeCanvas` sized the
bitmap ONCE, from the `watch(canvasEl)` that fires on mount — no
ResizeObserver, no window listener, no per-frame check — while the canvas is
`absolute inset-0 w-full h-full`. Every later width change left CSS stretching
a stale bitmap into an ellipse, and the overlay mounts in the same tick the call
re-lays out the columns, so the single measurement could capture the pre-call
width on its own.

It now observes both: a ResizeObserver for the box moving under a stable window
(the column swap, a rail drag), and a window `resize` for a devicePixelRatio
change, which resizes no box and so fires no observer. The bitmap is sized at
`css × dpr` (capped at 2) and the render loop draws in CSS pixels via
`ctx.setTransform`, so the 45px core and the particles' fixed radii keep meaning
what they meant. Resizing re-scales and never re-seeds — the particle field is
seeded once and lives in a fixed space around (0,0), so the orb does not restart
when the column moves. A zero-sized box is ignored rather than throwing the last
good size away, and a same-size measurement does not touch the bitmap, because
assigning to `canvas.width` clears the canvas.

Tests: `portalVoiceLayoutMotion.spec.js` (17) — the resize contract EXECUTED
against a stub canvas whose box changes (DPR scaling, the cap, a missing DPR,
the zero-box and same-size guards), mutation-checked by pinning the bitmap to
its first measurement, which fails exactly the "FOLLOWS a changed box" case;
plus the transition classes, the reduced-motion fallback counted over every
transitioning element, and the leave gate. Two existing guards in
`portalVoiceMode.spec.js` / `portalRail.spec.js` were rewritten to read the
shared condition instead of the retired chain — the property they protect is
exclusivity, not which construct expresses it.

Frontend suite: 113 files, 2532 tests, all passing; both ratchets green; vite
build clean.

Related to #2640

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bd71qsYbFodvofba8P69eP
… step (#2640)

Two review findings.

1. **Reduced motion was not instant.** Tailwind's `transition-none` emits only
   `transition-property: none` — the `duration-300` beside it still applies, so
   `transitionDuration` stays `.3s`. That is the exact property Vue's
   `getTransitionInfo` reads to size the fallback timer it resolves
   `@after-leave` on, so under `prefers-reduced-motion` nothing animated and
   every leave was still gated for 300ms: the canvas vanished, the right column
   sat empty, then the rail popped in. `motion-reduce:duration-0` on every
   transitioning element drives that timeout to 0. Verified against Tailwind's
   own output — the variant emits `transition-duration: 0s` inside the media
   query and after `duration-300`, so it wins.

   The comment on `voiceCanvasLeaving` claimed "`after-leave` fires immediately
   and this is never observably true", which was false as written; it now says
   what makes it true. Same correction in the feature flow.

2. **The rail column still steps** — accepted here, tracked at #2676. Its
   `<aside>` carries no width transition and it is a `shrink-0` flex sibling of
   `<main>`, so on call end it mounts at full width in one frame: 48px
   collapsed, 384px open, or the dragged `--ws-rail`, which on a wide rail is a
   bigger step than the 211px snap this PR removes. The honest fix is an
   explicitly animatable width for that column — CSS cannot transition to
   `auto` — and that width is owned by ent#492, not by the voice-call code.
   Doing it from here means either a wrapper element in the row or holding the
   rail mounted through a call, both of which want a browser to verify rather
   than the node-env source scan this suite is limited to. Recorded as a Known
   Limitation in the feature flow, with a test that fails if the limitation is
   deleted from the record or if the rail starts animating.

Tests: the class-counting case now requires BOTH reduced-motion classes and
asserts the ordering relation, since asserting the class string rather than the
behaviour is exactly why (1) shipped green.

113 files / 2534 tests green.

Fixes #2640

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RSjVEjay9ztC1oDXXkh9uN
…as (#2676)

#2640 animated two of the three columns. The rail was the third and it still
stepped: a bare `v-if` on a `shrink-0` flex sibling whose `<aside>` carries no
width transition, so on call end it appeared at full size in one frame — 48px
collapsed, 384px open, or whatever `--ws-rail` had been dragged to, which on a
wide rail is a LARGER step than the 211px snap #2640 removed.

The width now lives on a wrapper this view owns rather than on `PortalRail`'s own
`<aside>` — the same shape the sidebar column three columns to the left already
has (`shrink-0 overflow-hidden` plus an explicit `--ws-` width). `--ws-rail` is
the RENDERED width (48px collapsed, the dragged width open), so one binding
covers both states and agrees with the inner aside at rest.

**Vue enter/leave classes, not an always-on `transition-[width]`** — the
load-bearing decision. That same variable is rewritten on every `pointermove` of
a rail drag, so a permanently-transitioned width would make dragging rubber-band
by 300ms. Vue adds the active class only for the enter/leave window and removes
it afterwards, so a drag stays instant. `!w-0` is `!`-marked for the reason the
canvas's `!grow-0` is: both are single-class selectors setting the same property,
so without it Tailwind's output order would pick the winner.

**This retires `voiceCanvasLeaving`.** The flag existed because a rail mounting
at full width beside a still-shrinking canvas put three columns in a row sized
for two. A rail entering from zero width is complementary to a canvas leaving
towards zero grow — the row's total is conserved at every frame — so the hazard
is gone by construction rather than held off by a flag, and the two motions now
overlap instead of running back to back. The reduced-motion reasoning its comment
carried is not lost: it belongs to the transition classes, and the class-counting
test requires both `motion-reduce` classes on every transitioning element,
including the two added here.

`railHasColumn` is the one shared condition, and it reads `railTabs.length`
because `PortalRail`'s own root carries `v-if="tabs.length"` — with the width on
a wrapper, a tabless rail would otherwise leave a full-width empty column.

Measured in headless Chromium against the real built stylesheet rather than
argued from the classes: mid-transition the column is at 322px of its 384
(interpolating, not stepping), it settles at 384, under `prefers-reduced-motion`
it is at 384 immediately, and a drag issued after the active classes are removed
lands in the same frame. The three Tailwind utilities involved are confirmed
present in the built CSS — `.\!w-0{width:0!important}`,
`.transition-\[width\]{transition-property:width}` and
`.w-\[var\(--ws-rail\,24rem\)\]` — since an arbitrary-value miss would have made
the whole thing silently inert.

Accepted discontinuity: `thirdColumnResizable` is gated on `!voiceCall.active`,
so the 8px resize handle still appears and disappears in one frame. It is 8px
against a column that moves 384, and animating it would mean a second animated
element whose only content is a 1px line.

Tests: the transition scan now reads CLASS ATTRIBUTES rather than the whole file
— this change's own comments name `transition-[width]` while explaining it, and
a file-wide match reports the prose as an un-guarded transitioning element. Three
source guards updated where the `v-if` moved (they assert the shared computed,
which is the property; which element carries the condition is not), and four new
cases: the ramp's classes, the static class carrying no `transition-`, the
retirement of `voiceCanvasLeaving`, and the tabless-rail gate. Removing the
`<Transition>` reds the first of those.

113 files / 2536 tests green; raw-colour ratchet unchanged.

Fixes #2676
Related to #2640

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RSjVEjay9ztC1oDXXkh9uN
@dolho

dolho commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Self re-review. Nothing further from me — two things I went back to check specifically, since both were places this could have quietly broken something adjacent.

  • The mobile sheet is untouched. It is a separate <PortalRail sheet> instance gated on railVisible && railSheetOpen, outside the new wrapper and outside the <Transition>. The desktop column's gate moving to railHasColumn does not reach it, and the strip above the composer still keys on railVisible. So below sm — where the wrapper is display:none and transitions do not run at all — behaviour is byte-identical.
  • railTabs.length is in railHasColumn for a reason worth restating. PortalRail's own root carries v-if="tabs.length", so before this change a tabless rail rendered nothing and occupied nothing. With the width moved onto a wrapper this view owns, omitting that term would leave a full-width empty column on any stage where the tab set is empty. There is a test asserting the term is present, which is the cheap way to keep it.

The measurement is the part I would keep in the record: mid-transition 322 of 384, instant under prefers-reduced-motion, and a post-transition drag landing in the same frame — against the real built stylesheet, because a Tailwind arbitrary-value miss (w-[var(--ws-rail,24rem)], !w-0) would have made the whole thing silently inert and every source-scan test would still have passed.

Merge after #2647 — this deletes the voiceCanvasLeaving scaffolding that PR introduces.

@dolho

dolho commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Deeper self re-review. No defect, but one widening I introduced without saying so, and it should be on the record rather than discovered later.

The leave transition is not scoped to the voice call. railHasColumn is railVisible && railTabs.length && !voiceCanvasHasColumn, and <Transition> fires on any of the three going false. railVisibleFor returns false for a stage that is not ready, for the agent page, for an unreachable agent, and for a room on an instance without rooms — so navigating from a chat to the agent page now plays a 300ms width collapse on the rail column where it previously vanished in one frame. Same for a stage that goes back to loading.

That was not in #2676's scope, and I did not consider it when I moved the width. Two things follow:

  1. It is probably an improvement — the same easing the call end gets — but it is a change to every rail-hiding navigation, not to one feature, and reviewers of the next rail change will read the transition as voice-specific because that is what the comment above it discusses.
  2. There is a small artifact I can name precisely: usePortalRailFeeds is keyed on railVisible, which goes false immediately, while the rail stays mounted for the 300ms leave. So a rail leaving because of a navigation can visibly blank (feeds cleared) before it finishes shrinking. On the voice-call path this does not arise — railVisible stays true for the whole call, only voiceCanvasHasColumn flips.

I have not scoped the transition to the voice cause, deliberately: doing so means reintroducing a flag that says why the column is leaving, which is precisely the kind of flag this PR deletes (voiceCanvasLeaving). Accepting a uniform column motion is the simpler contract. But it is a decision, so it should be made explicitly rather than inherited — happy to gate it if you would rather the scope stayed at the call.

Everything else re-read clean: the mobile sheet is outside the wrapper and outside the <Transition> (gated on railVisible && railSheetOpen), so sub-sm is byte-identical; railTabs.length is in the gate so a tabless rail leaves no empty column; and the measured numbers (322/384 mid-flight, instant under reduced motion, post-transition drag in one frame) came from the real built stylesheet, which is what rules out a silently-absent Tailwind arbitrary value.

#2647 (the parent this branch was stacked on) squash-merged to dev an hour
ago, so its content arrived here from two directions at once: as the branch's
own commits and as dev's squashed form. All five conflicts are that, and the
resolution is the same in each — keep the branch, which already carries
#2647's work plus #2676's changes on top.

Portal.vue, three hunks: #2676 RETIRES `voiceCanvasLeaving` (a rail entering
from zero width is complementary to a canvas leaving toward zero grow, so the
row's total is conserved and the flag has nothing left to sequence). dev still
has the flag, its two transition handlers and the old `v-if` on `PortalRail`.
The branch's side is the intended end state.

The three spec files are the same shape one level along: each conflict is
#2676's updated assertion against the pre-#2676 one dev still holds
(`v-if="railHasColumn"` on the wrapper vs `v-if="railVisible && …"` on
`PortalRail`).

Resolved HUNK-WISE, not file-wise. `git checkout --ours` was the first attempt
and was WRONG: it takes the whole file from HEAD and so would have discarded
dev's ent#556 `PortalBrand` block from the signed-out shell — #2653's work,
untouched by this branch and present only in dev. Caught by diffing the
resolution against dev before committing. The merged file now carries both.

Frontend suite green on the result: 118 files / 2613 tests.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RSjVEjay9ztC1oDXXkh9uN
@vybe

vybe commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

merge-train 2026-09-10 (evening run): riding. Merged tree with #2649's viewport-derived rail max checked for coherence: the wrapper's w-[var(--ws-rail,24rem)] reads the same --ws-rail that useColumnResize.js writes from the clamped railWidth, and the inner aside agrees at rest. Full frontend unit suite on the merged tree: 2507 passed. The disclosed widening (a 300ms collapse on every rail-hiding navigation, not only call end) is accepted as stated.

One assertion left as is rather than patched, so you know it is known: portalVoiceLayoutMotion.spec.js:142 — toMatch(/data-testid="ws-rail-column"[\s\S]{0,80}|w-\[var\(--ws-rail,24rem\)\]/) — the | makes it pass if either token appears anywhere in the file, so the line asserts less than its comment claims. The next test (:145) pins the same property properly, so nothing is uncovered; drop the alternation when you are next in the file.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merge-train: batch validated on train/20260911-0925 (#2701)

@vybe
vybe merged commit c98db38 into dev Sep 11, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants