From de3dde461f09fe591b506e9ea62c1662b35a8ceb Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 22 Oct 2026 12:24:58 -0400 Subject: [PATCH] fix(session-ui): drop the hidden timestamp gap from pending message meta --- .../session-message-projection.spec.ts | 13 +++++-- .../src/message/message-content.tsx | 39 ++++++++++--------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/packages/session-ui/component-tests/session-message-projection.spec.ts b/packages/session-ui/component-tests/session-message-projection.spec.ts index 38713895171..df8bc59f22b 100644 --- a/packages/session-ui/component-tests/session-message-projection.spec.ts +++ b/packages/session-ui/component-tests/session-message-projection.spec.ts @@ -49,7 +49,7 @@ story("smoothly delivers a pending footer with and without hover", async ({ moun const message = timeline.locator('[data-component="user-message"]') const footer = timeline.locator('[data-slot="user-message-copy-wrapper"]') const timestamp = timeline.locator('[data-slot="user-message-meta-tail"]') - const pending = timeline.locator('[data-slot="user-message-meta"] [data-slot="user-message-transition"]') + const pending = timeline.locator('[data-slot="user-message-transition"]:has([data-slot="user-message-pending"])') await page.mouse.move(0, 0) await expect(footer).toHaveCSS("height", "20px") @@ -65,7 +65,12 @@ story("smoothly delivers a pending footer with and without hover", async ({ moun if (hover) await message.hover() if (!hover) await page.mouse.move(0, 0) - await expect(timestamp).toHaveCSS("opacity", hover ? "1" : "0") + // Pending stands in for the unsent time, so the actions follow the labels without a gap held for it. + await expect(timestamp).toBeHidden() + const label = await timeline.locator('[data-slot="user-message-meta-item"]').last().boundingBox() + const actions = await timeline.locator('[data-slot="user-message-actions"]').boundingBox() + if (!label || !actions) throw new Error("Pending footer geometry is unavailable") + expect(actions.x - label.x - label.width).toBeLessThanOrEqual(9) await timeline.getByLabel("Delivery state").selectOption("delivered") const middle = await message.evaluate((element) => { @@ -73,7 +78,9 @@ story("smoothly delivers a pending footer with and without hover", async ({ moun animation.pause() animation.currentTime = 100 } - const pending = element.querySelector('[data-slot="user-message-meta"] [data-slot="user-message-transition"]')! + const pending = element.querySelector( + '[data-slot="user-message-transition"]:has([data-slot="user-message-pending"])', + )! const footer = element.querySelector('[data-slot="user-message-copy-wrapper"]')! return { diff --git a/packages/session-ui/src/message/message-content.tsx b/packages/session-ui/src/message/message-content.tsx index a2a5a961631..c6330fa0462 100644 --- a/packages/session-ui/src/message/message-content.tsx +++ b/packages/session-ui/src/message/message-content.tsx @@ -662,24 +662,27 @@ export function CurrentUserMessageDisplay(props: { - - 0 || waiting()}> - - - - - - + {/* A pending steer has not been sent, so Pending stands in for the time instead of reserving its width. */} + + + 0}> + + + + + + + {renderActions()}