fix(ui): fit Linux status-bar metrics and await child layout in smoke

This commit is contained in:
Ouroboros 2026-09-18 02:44:29 +03:00
parent cc425e7c56
commit 72446fc49d
3 changed files with 30 additions and 3 deletions

View file

@ -13,7 +13,8 @@ def progress(task, text, **extra):
@pytest.mark.parametrize('width', [390, 1440])
def test_observed_executor_role_activity_and_project_pointer_live_replay(subscription_ui, width):
@pytest.mark.parametrize('linux_metrics', [False, True], ids=['native-font', 'linux-metrics'])
def test_observed_executor_role_activity_and_project_pointer_live_replay(subscription_ui, width, linux_metrics):
ui = subscription_ui
page = ui['page']
page.set_viewport_size({'width':width,'height':800})
@ -64,6 +65,13 @@ def test_observed_executor_role_activity_and_project_pointer_live_replay(subscri
assert activity.evaluate('e=>getComputedStyle(e).webkitLineClamp') == '1'
pointer=page.locator('#executor-proof .project-work-pointer')
assert 'UI coherence' in pointer.inner_text()
if linux_metrics:
# DejaVu Sans renders these two labels at 137px / 81px. Exercise that
# real Linux geometry on every host without bundling another font.
page.add_style_tag(content='''
#executor-proof .project-work-coverage { min-width: 137px; }
#executor-proof .chat-panel-statusbar .status-badge { min-width: 81px; }
''')
# One-line pointer: the label ellipsizes instead of wrapping the status bar open.
label=pointer.locator('.project-work-pointer-label')
assert label.evaluate('e=>[getComputedStyle(e).whiteSpace,getComputedStyle(e).textOverflow]')==['nowrap','ellipsis']
@ -85,6 +93,6 @@ def test_observed_executor_role_activity_and_project_pointer_live_replay(subscri
page.evaluate('''frame=>{for(const fn of executorProof.handlers.get('chat')||[])fn({...frame,chat_id:101})}''',terminal)
page.wait_for_function("document.querySelector('#executor-proof [data-task-id=child]').textContent.includes('Observed: Cursor Grok 4.6')")
assert 'Coordinator: gpt-6-astra' in card.inner_text()
capture(page,f'executor-card-{width}')
capture(page,f'executor-card-{width}-{"linux-metrics" if linux_metrics else "native-font"}')
page.evaluate('executorProof.instance.destroy()')
assert page.locator('#executor-proof .project-work-pointer').count()==0

View file

@ -552,6 +552,24 @@ def run_chat_viewport_smoke(
"ts": "2026-08-03T10:04:00+00:00",
}
_emit_ws_frame(page, late_child_frame)
# Observe this mount's real height change before testing the
# viewport; elapsed animation frames alone do not establish it.
# A missing or zero-height child still fails.
try:
page.wait_for_function("""minimum => {
const parent = document.querySelector('.chat-live-card[data-task-id="vp-parent"]');
const child = parent?.querySelector(':scope > .chat-subagents > [data-task-id="vp-late-child"]');
return child && child.getBoundingClientRect().height > 0
&& parent.getBoundingClientRect().height > minimum;
}""", arg=parent_before_mount + 30, timeout=10_000)
except PlaywrightError as exc:
geometry = parent.evaluate("""(card, before) => {
const child = card.querySelector('[data-task-id="vp-late-child"]');
return {before, after: card.getBoundingClientRect().height,
expanded: card.dataset.expanded, childHeight: child?.getBoundingClientRect().height,
childParent: child?.parentElement?.dataset.subagentsFor};
}""", parent_before_mount)
raise AssertionError(f"Late child did not grow its parent: {geometry}") from exc
assert parent.evaluate("card => card.getBoundingClientRect().height") > parent_before_mount + 30
assert abs(card_top(page, anchor_id) - anchor_before) <= 6
parent.evaluate("""card => { window.__subagentNoopMutations = []; window.__subagentNoopObserver = new MutationObserver(records => window.__subagentNoopMutations.push(...records)); window.__subagentNoopObserver.observe(card, {attributes: true, attributeOldValue: true, childList: true, characterData: true, subtree: true}); }""")

View file

@ -7199,7 +7199,8 @@ textarea.chat-input {
text-overflow: ellipsis;
}
.project-work-coverage { font-size: var(--type-meta); color: var(--text-meta); }
.chat-panel-statusbar { flex-wrap: wrap; gap: var(--space-2); }
/* Compact horizontal spacing leaves room for wider native system-font metrics. */
.chat-panel-statusbar { flex-wrap: wrap; gap: var(--space-2) var(--space-1); }
.chat-live-executor-chip { max-width: 100%; white-space: normal; }
.chat-live-meta-text, .chat-live-executor-chip .harness-identity-label { overflow-wrap: anywhere; }
.chat-bubble .message:not(:has(> *)),