You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/09/16 10:12:01 UTC

(maka) branch main updated: test(desktop): fix workhub fold gutter flake (#5393)

This is an automated email from the ASF dual-hosted git repository.

Astro-Han pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/maka.git


The following commit(s) were added to refs/heads/main by this push:
     new a4700a7890 test(desktop): fix workhub fold gutter flake (#5393)
a4700a7890 is described below

commit a4700a78904ffdab826cf9440e53acb5fedf128f
Author: NekoPunch <95...@users.noreply.github.com>
AuthorDate: Wed Sep 16 03:11:57 2026 -0700

    test(desktop): fix workhub fold gutter flake (#5393)
    
    The fold sampler read the final gutter from a fixed 500ms window, but a
    loaded runner starts the 420ms dock animation late enough that the last
    frame is still in the easing tail (11.98 instead of 12).
    
    Generated-by: Claude Code
---
 apps/desktop/e2e/workhub-layout.spec.ts | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/apps/desktop/e2e/workhub-layout.spec.ts b/apps/desktop/e2e/workhub-layout.spec.ts
index 6edbd66e43..237edb3b1c 100644
--- a/apps/desktop/e2e/workhub-layout.spec.ts
+++ b/apps/desktop/e2e/workhub-layout.spec.ts
@@ -308,6 +308,8 @@ test('WorkHub uses its coordination model and shared attachment composer', async
   await expect.poll(() => workhub.evaluate(() => innerHeight)).toBe(compactHeight);
   // Sample the real native resize, including repeated folds. The composer
   // must stay inside the window while its original 12px gutter interpolates.
+  const composerGutter = () => workhub.evaluate(() => innerHeight - document.querySelector('.workHubComposerSurface')!.getBoundingClientRect().bottom);
+  const viewportInset = () => workhub.evaluate(() => parseFloat(getComputedStyle(document.querySelector('.workHubLive')!).getPropertyValue('--workhub-viewport-inset')));
   for (const expanded of [true, false, true]) {
     const motion = await workhub.getByRole('button', { name: expanded ? /展开对话|Expand conversation/ : /收起对话|Collapse conversation/ }).evaluate((button) => new Promise<{ bottom: number; left: number; height: number; inset: number }[]>((resolve) => {
       const frames: { bottom: number; left: number; height: number; inset: number }[] = [];
@@ -324,10 +326,11 @@ test('WorkHub uses its coordination model and shared attachment composer', async
     }));
     expect(motion.every(({ bottom, left }) => bottom >= -0.5 && bottom <= 12.5 && left >= -0.5 && left <= 12.5)).toBe(true);
     expect(motion.some(({ bottom }) => bottom > 0.5 && bottom < 11.5)).toBe(true);
-    expect(motion.at(-1)!.bottom).toBeCloseTo(expanded ? 12 : 0);
     expect(new Set(motion.map(({ height }) => height)).size).toBeLessThanOrEqual(2);
     expect(motion.some(({ inset }) => inset > 0)).toBe(true);
-    expect(motion.at(-1)!.inset).toBe(0);
+    // A loaded runner starts the dock animation late, so the resting position is polled.
+    await expect.poll(composerGutter).toBeCloseTo(expanded ? 12 : 0);
+    await expect.poll(viewportInset).toBe(0);
   }
   const keptEditor = await workhub.evaluate(async () => {
     const editor = document.querySelector('.maka-composer-editor [contenteditable]');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org