Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const chatComposerMeta = {
"border.width.default",
"color.composer.border",
"color.composer.contextBackground",
"control.composer.contextBlur",
"control.composer.surfaceRadius",
"control.composer.surfacePadding",
"control.composer.surfaceGap",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@

.root[data-has-context="true"] {
background: var(--openbitfun-color-composer-context-background);
backdrop-filter: blur(var(--openbitfun-control-composer-context-blur));
-webkit-backdrop-filter: blur(var(--openbitfun-control-composer-context-blur));
/* A transparent composer must not blur a rectangular patch of the shared
wallpaper. The patch becomes especially visible while reading older
messages and looks like an unintended shadow beside the input. */
backdrop-filter: none;
-webkit-backdrop-filter: none;
}

.context {
Expand Down
7 changes: 5 additions & 2 deletions src/apps/miniapp-shell/src/generated/chat-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,11 @@

.miniapp-ChatComposer-root[data-has-context="true"] {
background: var(--openbitfun-color-composer-context-background);
backdrop-filter: blur(var(--openbitfun-control-composer-context-blur));
-webkit-backdrop-filter: blur(var(--openbitfun-control-composer-context-blur));
/* A transparent composer must not blur a rectangular patch of the shared
wallpaper. The patch becomes especially visible while reading older
messages and looks like an unintended shadow beside the input. */
backdrop-filter: none;
-webkit-backdrop-filter: none;
}

.miniapp-ChatComposer-context {
Expand Down
1 change: 0 additions & 1 deletion src/shared/miniapp-chrome/generated/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
--openbitfun-control-chat-composer-compact-padding-inline: 8px;
--openbitfun-control-chat-composer-compact-track-height: 24px;
--openbitfun-control-chat-composer-control-height: 24px;
--openbitfun-control-composer-context-blur: 10px;
--openbitfun-control-composer-surface-gap: 12px;
--openbitfun-control-composer-surface-padding: 8px;
--openbitfun-control-composer-surface-radius: 16px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
inline-size: var(--openbitfun-space-5);
block-size: var(--openbitfun-space-5);

> [data-openbitfun-component='icon'] {
display: block;
vertical-align: middle;
}

&[data-status='running'] > [data-openbitfun-component='icon'] {
animation: session-status-running 1.4s linear infinite;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,16 @@
&__inline-item-trailing {
display: grid;
flex: 0 0 var(--openbitfun-space-5);
grid-template-rows: minmax(0, 1fr);
place-content: center;
place-items: center;
inline-size: var(--openbitfun-space-5);
block-size: var(--openbitfun-space-5);
}

&__inline-item-status {
grid-area: 1 / 1;
line-height: 0;
pointer-events: none;

.openbitfun-nav-panel__inline-item:hover &,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ describe('SessionsSection layout styles', () => {
const trailingBlock = extractInlineItemBlock(stylesheet, 'trailing');
expect(trailingBlock).toContain('display: grid;');
expect(trailingBlock).toContain('flex: 0 0 var(--openbitfun-space-5);');
expect(trailingBlock).toContain('grid-template-rows: minmax(0, 1fr);');
expect(trailingBlock).toContain('place-content: center;');
const statusBlock = extractInlineItemBlock(stylesheet, 'status');
expect(statusBlock).toContain('line-height: 0;');
expect(statusBlock).toContain('grid-area: 1 / 1;');
expect(statusBlock).not.toContain('margin-inline-end');
expect(statusBlock).toContain('.openbitfun-nav-panel__inline-item:hover &');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
}

.openbitfun-nav-panel__inline-item-trailing {
// Reserve both actions even while hidden, so their intrinsic width cannot
// push the status icon outside the row's clipped boundary.
// Reserve both actions on both axes even while hidden, so the xs default
// icon button neither clips the status icon nor overflows the 20px trailing
// track downward.
flex-basis: calc(var(--openbitfun-control-icon-button-xs-size) + var(--openbitfun-space-5));
inline-size: calc(var(--openbitfun-control-icon-button-xs-size) + var(--openbitfun-space-5));
block-size: var(--openbitfun-control-icon-button-xs-size);
grid-template-columns: minmax(0, 1fr);
grid-template-rows: minmax(0, 1fr);
align-content: center;
justify-items: end;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,17 @@ describe('WorkspaceListSection layout styles', () => {
expect(assistant).not.toContain('AssistantSessionHistoryDialog');
expect(assistant).toContain('handleOpenLatestAssistantSession');
});

it('centers assistant history trailing status and action controls on the block axis', () => {
const assistantHistoryStyles = readFileSync(
fileURLToPath(new URL('./AssistantSessionHistory.scss', import.meta.url)),
'utf8',
).replace(/\r\n/g, '\n');
const trailing = extractBlock(assistantHistoryStyles, '.openbitfun-nav-panel__inline-item-trailing');

expect(trailing).toContain('block-size: var(--openbitfun-control-icon-button-xs-size);');
expect(trailing).toContain('grid-template-rows: minmax(0, 1fr);');
expect(trailing).toContain('align-content: center;');
expect(trailing).toContain('justify-items: end;');
});
});
1 change: 1 addition & 0 deletions src/web-ui/src/app/layout/AppLayout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ html[data-openbitfun-native-material='sidebar'] body {
overflow: hidden;
background-repeat: no-repeat;
pointer-events: none;
transform: translateZ(0);
}

.openbitfun-appearance-background-media__video {
Expand Down
4 changes: 4 additions & 0 deletions src/web-ui/src/app/styles/visual-skin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
overflow: hidden;
border-radius: inherit;
pointer-events: none;
// Keep the backdrop in a stable composited layer while masked transcript
// rows reveal hover controls. Otherwise WebKit can re-composite the video
// and its scrim together for a frame, briefly darkening the whole shell.
transform: translateZ(0);

&::before,
&::after {
Expand Down
36 changes: 26 additions & 10 deletions src/web-ui/src/flow_chat/components/modern/FlowChatHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,33 +109,49 @@
height: 4px;
border-radius: 999px;
background: var(--openbitfun-color-status-success-emphasis);
box-shadow:
0 0 0 1px var(--openbitfun-color-surface-raised),
0 0 0 0 color-mix(in srgb, var(--openbitfun-color-status-success-emphasis) 42%, transparent);
box-shadow: 0 0 0 1px var(--openbitfun-color-surface-raised);
animation: flowchat-header-session-overview-pulse 1.45s ease-out infinite;

&::after {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background: inherit;
pointer-events: none;
animation: flowchat-header-session-overview-halo 1.45s ease-out infinite;
}
}

@keyframes flowchat-header-session-overview-pulse {
0%,
100% {
transform: scale(1);
opacity: 0.9;
box-shadow:
0 0 0 1px var(--openbitfun-color-surface-raised),
0 0 0 0 color-mix(in srgb, var(--openbitfun-color-status-success-emphasis) 40%, transparent);
}

50% {
transform: scale(1.22);
opacity: 1;
box-shadow:
0 0 0 1px var(--openbitfun-color-surface-raised),
0 0 0 5px color-mix(in srgb, var(--openbitfun-color-status-success-emphasis) 0%, transparent);
}
}

@keyframes flowchat-header-session-overview-halo {
0% {
transform: scale(1);
opacity: 0.42;
}

50%,
100% {
transform: scale(3.5);
opacity: 0;
}
}

@media (prefers-reduced-motion: reduce) {
&__session-overview-status-dot {
&__session-overview-status-dot,
&__session-overview-status-dot::after {
animation: none;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ describe('FlowChat transcript edge fade', () => {
expect(stylesheet).not.toContain('backdrop-filter');
});

it('keeps the animated transcript mask on a stable compositing path without trapping fixed descendants', () => {
const stylesheet = readSource('./VirtualMessageList.scss');
const scroller = stylesheet.match(/&__scroller\s*\{[\s\S]*?\n\s{2}\}/)?.[0];

expect(scroller).toBeDefined();
expect(scroller).toContain('will-change: opacity;');
expect(scroller).not.toMatch(/(?:^|\s)transform\s*:/);
expect(scroller).not.toContain('will-change: transform');
});

it('removes the mask in forced-colors mode', () => {
const stylesheet = readSource('./VirtualMessageList.scss');
const forcedColors = stylesheet.slice(stylesheet.indexOf('@media (forced-colors: active)'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
// fits. Overflow restores these defaults without changing layout geometry.
-webkit-mask-size: 100% 100%;
mask-size: 100% 100%;
// Runtime status spinners, hover controls, and streaming rows continuously
// invalidate this masked subtree. Keep its offscreen surface alive via
// opacity will-change (never `transform`, which traps non-portaled
// `position: fixed` views such as expanded GenUI maps inside the scroller).
will-change: opacity;
}

// At the actual scroll start there is no content entering from above, so
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// @vitest-environment jsdom

import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { act } from 'react';
import { createRoot, type Root } from 'react-dom/client';
import { renderToStaticMarkup } from 'react-dom/server';
Expand Down Expand Up @@ -72,6 +74,12 @@ describe('AppearanceBackgroundMedia', () => {
expect(html).toContain('data-media-ready="false"');
});

it('keeps the appearance video backdrop on a dedicated composited layer', () => {
const styles = readFileSync(resolve('src/app/layout/AppLayout.scss'), 'utf8');
const layerRule = styles.match(/\.openbitfun-appearance-background-media\s*\{[^}]*\}/)?.[0];
expect(layerRule).toContain('transform: translateZ(0);');
});

it('keeps the poster visible until a video frame is presented and hides the video again when suspended', async () => {
const releaseRevision = vi.fn();
const retainRevision = vi.fn(() => releaseRevision);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,64 @@ describe('interaction refresh work', () => {
expect(entry(runtime, 'components[0].slots.root')?.status).toBe('unresolved');
} finally { query.mockRestore(); }
});

it('skips DOM rescans, style recompiles, and projection reports during virtualized transcript scrolling without watchers', async () => {
const storage = new TestStorage(), skin = source('a');
skin.assets = { art: { mimeType: 'image/svg+xml', source: { kind: 'data', data: 'data:image/svg+xml;base64,PHN2Zy8+' } } };
skin.surfaces = [{ surface: 'shell', backgroundAssetId: 'art' }, { surface: 'chat', backgroundSource: 'shell', baseOpacity: 0.3 }];
skin.components = [
{ component: 'navigation-panel', slots: { root: { assetId: 'art', backgroundPosition: '15% 25%' } } },
{ component: 'icon-button', tokens: { 'color.content.primary': '#444444' } },
];
await install(storage, skin);
document.body.innerHTML = '<main data-openbitfun-surface="shell"><aside data-openbitfun-component="navigation-panel" data-openbitfun-part="root"></aside><section id="chat" data-openbitfun-surface="chat"><div id="scroller"></div></section></main>';
const runtime = new VisualSkinRuntime(storage); runtimes.push(runtime);
await runtime.activate('a'); await tick();
const scroller = document.getElementById('scroller')!;
const style = document.querySelector('style[data-openbitfun-skin-runtime]')!;
const initialCss = style.textContent;
const snapshots: number[] = [];
const unsubscribe = runtime.subscribe(() => snapshots.push(1));
const query = vi.spyOn(document, 'querySelectorAll');
try {
for (let i = 0; i < 12; i++) {
const row = document.createElement('div');
row.setAttribute('data-openbitfun-component', 'virtual-item');
row.setAttribute('data-openbitfun-part', 'root');
row.innerHTML = '<div data-openbitfun-product-component="user-message-item" data-openbitfun-product-part="root"><button data-openbitfun-component="icon-button" data-openbitfun-part="root">Copy</button></div>';
scroller.append(row);
row.dispatchEvent(new Event('pointerover', { bubbles: true }));
if (scroller.childElementCount > 4) scroller.firstElementChild?.remove();
}
await tick();
expect(query).not.toHaveBeenCalled();
expect(style.textContent).toBe(initialCss);
expect(snapshots).toHaveLength(0);

// Subscribing a visible projection watcher later reconciles current DOM state on demand.
const stopWatching = runtime.watchProjection(() => true);
await tick();
expect(entry(runtime, 'components[1]')?.message).toContain('4 mounted component(s)');
stopWatching();
} finally { unsubscribe(); query.mockRestore(); }
});

it('recompiles part rules when a child part mounts inside an already-mounted component owner', async () => {
const storage = new TestStorage(), skin = source('a');
skin.assets = { art: { mimeType: 'image/svg+xml', source: { kind: 'data', data: 'data:image/svg+xml;base64,PHN2Zy8+' } } };
skin.components = [{ component: 'button', slots: { 'leading-icon': { assetId: 'art', backgroundPosition: '25% 75%' } } }];
await install(storage, skin);
document.body.innerHTML = '<button id="owner" data-openbitfun-component="button" data-openbitfun-part="root"><span>Wrap</span></button>';
const runtime = new VisualSkinRuntime(storage); runtimes.push(runtime);
await runtime.activate('a'); await tick();
const wrap = document.querySelector('#owner > span')!;
const icon = document.createElement('span');
icon.id = 'late-icon';
icon.setAttribute('data-openbitfun-part', 'leading-icon');
wrap.append(icon);
await tick();
expect(paintPosition('late-icon')).toBe('25% 75%');
});
});

describe('current mode diagnostics', () => {
Expand Down
Loading
Loading