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
1 change: 1 addition & 0 deletions apps/showcase_ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"test:layout": "node scripts/layout-audit/layout-audit.mjs",
"test:run-header": "node scripts/run-header-audit.mjs",
"test:step-timeline": "node scripts/run-header-audit.mjs --timeline",
"test:live-run": "node scripts/run-header-audit.mjs --live",
"test:controls": "node scripts/layout-audit/screenshots.mjs screenshots controls --controls",
"test:device-pane": "node scripts/run-header-audit.mjs --evidence",
"test:preview-path": "node scripts/preview-path.test.mjs",
Expand Down
18 changes: 9 additions & 9 deletions apps/showcase_ui/scripts/keyboard-walkthrough/walkthrough.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ try {
start_time: current.start_time, end_time: current.end_time, device_serial: current.device_ref.serial }];
mock.status = { status: 'idle', session_id: null };
await send('Page.navigate', { url: `${base}/workspace` });
await expectTrue('Workspace shows the same run with its new-task box', `!!document.querySelector('app-run-view [data-section="outcome"]') && !!document.querySelector('textarea.dock-textarea')`);
await expectTrue('Workspace shows the same run with its new-task box', `!!document.querySelector('app-run-view [data-section="outcome"]') && !!document.querySelector('textarea.composer-input')`);
await expectTrue('first Workspace visit opens What\'s New', `!!document.querySelector('dialog.whats-new-dialog[open]')`);
await press('Escape');
await expectTrue('Escape dismisses What\'s New', `!document.querySelector('dialog.whats-new-dialog[open]')`);
Expand All @@ -373,7 +373,7 @@ try {
await tabUntil('Skip to new task', focusNamed('Skip to new task'));
await expectTrue('the skip link shows itself while focused', `document.activeElement.getBoundingClientRect().height >= 44`);
await press('Enter');
await expectTrue('Enter put focus in the new-task box', `document.activeElement.matches('textarea.dock-textarea')`);
await expectTrue('Enter put focus in the new-task box', `document.activeElement.matches('textarea.composer-input')`);
await tabUntil('Skip to run list', focusNamed('Skip to run list'), { back: true, max: 80 });
await press('Enter');
await expectTrue('Enter put focus on the first tab of the list', `document.activeElement.matches('.run-list-pane [role="tab"]')`);
Expand All @@ -400,14 +400,14 @@ try {

log('Task dock: stays open, and clipboard keyboard operation');
await send('Page.navigate', { url: `${base}/workspace` });
await expectTrue('empty task dock is expanded', `!!document.querySelector('.workspace-floating-bar-wrapper.is-expanded textarea') && getComputedStyle(document.querySelector('.expanded-card-content')).display !== 'none'`);
const dockWidth = await evaluate(`document.querySelector('.floating-dock-card').getBoundingClientRect().width`);
await expectTrue('empty task dock is expanded', `!!document.querySelector('.composer textarea') && getComputedStyle(document.querySelector('.composer-row')).display !== 'none'`);
const dockWidth = await evaluate(`document.querySelector('.composer-card').getBoundingClientRect().width`);
await press('Tab');
await expectTrue('focus loss does not collapse or resize the dock', `!document.querySelector('.is-dormant') && document.querySelector('.floating-dock-card').getBoundingClientRect().width === ${dockWidth}`);
await tabUntil('task textarea', focusIs('textarea.dock-textarea'));
await expectTrue('focus loss does not collapse or resize the dock', `!document.querySelector('.is-dormant') && document.querySelector('.composer-card').getBoundingClientRect().width === ${dockWidth}`);
await tabUntil('task textarea', focusIs('textarea.composer-input'));
await evaluate(`(() => {
window.dockPasteEvents = [];
document.querySelector('textarea.dock-textarea').addEventListener('paste', event => {
document.querySelector('textarea.composer-input').addEventListener('paste', event => {
window.dockPasteEvents.push({
trusted: event.isTrusted,
types: Array.from(event.clipboardData?.types ?? []),
Expand All @@ -429,12 +429,12 @@ try {
await tabUntil('Remove image', focusIs('button.btn-remove-image'));
await press('Enter');
await expectTrue('Enter removes the pasted preview', `!document.querySelector('ul.attached-images')`);
await tabUntil('task textarea', focusIs('textarea.dock-textarea'));
await tabUntil('task textarea', focusIs('textarea.composer-input'));
await evaluate(`navigator.clipboard.writeText('clipboard task text')`);
await pasteShortcut(send);
await sleep(120);
await expectTrue('native text paste delivers a trusted text clipboard payload', `window.dockPasteEvents.length === 2 && window.dockPasteEvents[1].trusted && window.dockPasteEvents[1].types.includes('text/plain') && window.dockPasteEvents[1].files.length === 0`);
await expectTrue('platform paste shortcut of text remains text without an attachment', `document.querySelector('textarea.dock-textarea').value === 'clipboard task text' && !document.querySelector('ul.attached-images')`);
await expectTrue('platform paste shortcut of text remains text without an attachment', `document.querySelector('textarea.composer-input').value === 'clipboard task text' && !document.querySelector('ul.attached-images')`);

log('\nKeyboard walkthrough passed.');
await cleanup(0);
Expand Down
4 changes: 2 additions & 2 deletions apps/showcase_ui/scripts/layout-audit/layout-audit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ const CONTRAST_SELF_TEST = `(() => {
})()`;

const BLUR = `[...document.querySelectorAll('*')].filter((e) => { const c = getComputedStyle(e); return (c.backdropFilter && c.backdropFilter !== 'none') || /blur/.test(c.filter); }).map((e) => e.className?.toString() || e.tagName).slice(0, 5)`;
const TARGETS = `[...document.querySelectorAll('.floating-nav-switcher .nav-tab-btn, .tab-selector-btn, .dock-circle-btn, .profile-toggle-pill, app-run-library button, app-run-library summary, app-run-library input, app-run-library select, app-run-view .action-button, app-run-view .secondary-button, app-run-view summary')]
const TARGETS = `[...document.querySelectorAll('.floating-nav-switcher .nav-tab-btn, .tab-selector-btn, .composer-btn, .composer .segment, app-run-library button, app-run-library summary, app-run-library input, app-run-library select, app-run-view .action-button, app-run-view .secondary-button, app-run-view summary')]
.map((e) => [e, e.getBoundingClientRect()]).filter(([e, r]) => r.width > 0 && r.height > 0 && !e.disabled)
.filter(([, r]) => r.height < 43.5 || r.width < 43.5).map(([e, r]) => (e.getAttribute('aria-label') || e.textContent || e.className).trim().slice(0, 24) + ' ' + Math.round(r.width) + 'x' + Math.round(r.height))`;
const BOXES = `(() => { const r = (s) => { const e = document.querySelector(s); if (!e) return null; const b = e.getBoundingClientRect(); return { l: b.left, t: b.top, r: b.right, b: b.bottom, w: b.width, h: b.height }; };
return { list: r('.run-list-pane'), detail: r('.detail-pane'), run: r('.run-surface'), dock: r('.workspace-floating-bar-wrapper'), scrollH: document.documentElement.scrollHeight, overflowX: document.documentElement.scrollWidth - innerWidth }; })()`;
return { list: r('.run-list-pane'), detail: r('.detail-pane'), run: r('.run-surface'), dock: r('.composer'), scrollH: document.documentElement.scrollHeight, overflowX: document.documentElement.scrollWidth - innerWidth }; })()`;

function checkPanes(where, route, width, b) {
const TOLERANCE = 2;
Expand Down
Loading
Loading