fix(web): keep the workspace title from stretching between tabs (UF-049)
The title carries a framer-motion layoutId for the card-to-header hero morph, which also animates any change of its box. With a short workspace name the title is as wide as the subtitle row; hiding that row on the Chat tab changed the width, and framer animated it as a horizontal scale (2.9x for "Eng"). Both titles now use layout="position": only the position animates, and the hero morph still moves the name into place. The hero-morph test checks it.
This commit is contained in:
@@ -525,6 +525,9 @@ const WorkspaceDesktopApp = ({
|
|||||||
<div className="mb-1.5 h-2.5 w-24 rounded bg-[var(--surface-2)] animate-pulse motion-reduce:animate-none" aria-hidden="true" />
|
<div className="mb-1.5 h-2.5 w-24 rounded bg-[var(--surface-2)] animate-pulse motion-reduce:animate-none" aria-hidden="true" />
|
||||||
<motion.h2
|
<motion.h2
|
||||||
layoutId={heroNameId}
|
layoutId={heroNameId}
|
||||||
|
// Text must not scale: the title's width follows the header row,
|
||||||
|
// which changes between tabs (UF-049). Only its position travels.
|
||||||
|
layout="position"
|
||||||
transition={SPRING.expressive}
|
transition={SPRING.expressive}
|
||||||
className="truncate font-display text-[clamp(20px,2.4vw,28px)] font-semibold leading-tight tracking-[-0.02em] text-[var(--text)]"
|
className="truncate font-display text-[clamp(20px,2.4vw,28px)] font-semibold leading-tight tracking-[-0.02em] text-[var(--text)]"
|
||||||
>
|
>
|
||||||
@@ -645,6 +648,9 @@ const WorkspaceDesktopApp = ({
|
|||||||
</div>
|
</div>
|
||||||
<motion.h2
|
<motion.h2
|
||||||
layoutId={heroNameId}
|
layoutId={heroNameId}
|
||||||
|
// Text must not scale: the title's width follows the header row,
|
||||||
|
// which changes between tabs (UF-049). Only its position travels.
|
||||||
|
layout="position"
|
||||||
transition={SPRING.expressive}
|
transition={SPRING.expressive}
|
||||||
className="truncate font-display text-[clamp(20px,2.4vw,28px)] font-semibold leading-tight tracking-[-0.02em] text-[var(--text)]"
|
className="truncate font-display text-[clamp(20px,2.4vw,28px)] font-semibold leading-tight tracking-[-0.02em] text-[var(--text)]"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ vi.mock('framer-motion', async () => {
|
|||||||
for (const k of Object.keys(props)) if (!DROP.has(k)) passed[k] = props[k];
|
for (const k of Object.keys(props)) if (!DROP.has(k)) passed[k] = props[k];
|
||||||
// Surface the two props the morph contract depends on.
|
// Surface the two props the morph contract depends on.
|
||||||
if (props.layoutId !== undefined) passed['data-layout-id'] = props.layoutId;
|
if (props.layoutId !== undefined) passed['data-layout-id'] = props.layoutId;
|
||||||
|
if (typeof props.layout === 'string') passed['data-layout'] = props.layout;
|
||||||
if (props.initial !== undefined) passed['data-initial'] = JSON.stringify(props.initial);
|
if (props.initial !== undefined) passed['data-initial'] = JSON.stringify(props.initial);
|
||||||
return React.createElement(tag, { ...passed, ref });
|
return React.createElement(tag, { ...passed, ref });
|
||||||
});
|
});
|
||||||
@@ -180,6 +181,8 @@ describe('Lane HM · workspace surface (destination)', () => {
|
|||||||
const name = container.querySelector(`[data-layout-id="${workspaceHeroNameId('w1')}"]`);
|
const name = container.querySelector(`[data-layout-id="${workspaceHeroNameId('w1')}"]`);
|
||||||
expect(avatar).toBeTruthy();
|
expect(avatar).toBeTruthy();
|
||||||
expect(name?.textContent).toBe('Alpha');
|
expect(name?.textContent).toBe('Alpha');
|
||||||
|
// UF-049: the title only moves; a size morph would stretch the text.
|
||||||
|
expect(name?.getAttribute('data-layout')).toBe('position');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('the LOADING skeleton already carries the hero ids (target mounted at commit)', async () => {
|
it('the LOADING skeleton already carries the hero ids (target mounted at commit)', async () => {
|
||||||
@@ -194,6 +197,7 @@ describe('Lane HM · workspace surface (destination)', () => {
|
|||||||
expect(container.querySelector(`[data-layout-id="${workspaceHeroAvatarId('w1')}"]`)).toBeTruthy();
|
expect(container.querySelector(`[data-layout-id="${workspaceHeroAvatarId('w1')}"]`)).toBeTruthy();
|
||||||
const name = container.querySelector(`[data-layout-id="${workspaceHeroNameId('w1')}"]`);
|
const name = container.querySelector(`[data-layout-id="${workspaceHeroNameId('w1')}"]`);
|
||||||
expect(name?.textContent).toBe('Alpha');
|
expect(name?.textContent).toBe('Alpha');
|
||||||
|
expect(name?.getAttribute('data-layout')).toBe('position');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reduced motion drops the header layoutIds', async () => {
|
it('reduced motion drops the header layoutIds', async () => {
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ Baseline: commit `b20b138` of `git.os-dev.tech/oleg.m/waggle-os`.
|
|||||||
| UF-046 | On macOS and Linux the desktop app kills the sidecar without its shutdown | Fixed | Desktop shell, sidecar |
|
| UF-046 | On macOS and Linux the desktop app kills the sidecar without its shutdown | Fixed | Desktop shell, sidecar |
|
||||||
| UF-047 | The command palette's search text touches its focus outline | Fixed | Web UI |
|
| UF-047 | The command palette's search text touches its focus outline | Fixed | Web UI |
|
||||||
| UF-048 | The sidebar account row sits off-center at the bottom | Fixed | Web UI |
|
| UF-048 | The sidebar account row sits off-center at the bottom | Fixed | Web UI |
|
||||||
|
| UF-049 | The workspace title stretches when switching tabs | Fixed | Web UI |
|
||||||
|
|
||||||
## Entries
|
## Entries
|
||||||
|
|
||||||
@@ -485,3 +486,12 @@ Entries UF-010 to UF-019 come from the UI audit `anti-slop/audit-001-2026-10-14.
|
|||||||
- Cause: the row's bottom padding adds to the nav's own 14px bottom padding.
|
- Cause: the row's bottom padding adds to the nav's own 14px bottom padding.
|
||||||
- What we did: the row has 14px above its content and none below, so the nav's padding gives the same 14px underneath.
|
- What we did: the row has 14px above its content and none below, so the nav's padding gives the same 14px underneath.
|
||||||
- Recommendation: apply the same change in the main project.
|
- Recommendation: apply the same change in the main project.
|
||||||
|
|
||||||
|
### UF-049. The workspace title stretches when switching tabs
|
||||||
|
- Status: Fixed
|
||||||
|
- Found: 2026-10-26
|
||||||
|
- Where: at commit `b20b138`, `apps/web/src/components/os/apps/WorkspaceDesktopApp.tsx:581` and `:701` (the title `motion.h2` with `layoutId`), with the subtitle row hidden on the Chat tab at `:710`
|
||||||
|
- Symptom: in a workspace with a short name, switching between Overview and Chat stretches the title sideways for about half a second; in a workspace named "Eng" it was drawn 2.9 times wider.
|
||||||
|
- Cause: the title carries a framer-motion `layoutId` for the card-to-header hero morph, and a `layoutId` animates any change of the element's box. The title's width follows the header column, which is as wide as the subtitle row when the name is short; hiding that row on the Chat tab changes the width, and framer animates it with a horizontal scale, which distorts the text.
|
||||||
|
- What we did: both titles (the header and its loading skeleton) use `layout="position"`, so only their position animates and the hero morph still moves the name into place. The hero-morph test checks the setting; in the browser no tab switch puts a transform on the title any more.
|
||||||
|
- Recommendation: apply the same change in the main project, and use `layout="position"` for any text that carries a `layoutId`.
|
||||||
|
|||||||
Reference in New Issue
Block a user