mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-16 05:01:03 +03:00
fix(session-ui): drop the hidden timestamp gap from pending message meta
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -662,24 +662,27 @@ export function CurrentUserMessageDisplay(props: {
|
||||
</For>
|
||||
</span>
|
||||
</Show>
|
||||
<span data-slot="user-message-meta-tail">
|
||||
<Show when={metaLabels().length > 0 || waiting()}>
|
||||
<span data-slot="user-message-meta-separator" aria-hidden="true">
|
||||
{"\u00B7"}
|
||||
</span>
|
||||
</Show>
|
||||
<Tooltip
|
||||
appearance="compact"
|
||||
value={fulltimefmt().format(props.message.time.created)}
|
||||
placement="top"
|
||||
triggerTabIndex={0}
|
||||
openDelay={800}
|
||||
>
|
||||
<time dir="auto" dateTime={new Date(props.message.time.created).toISOString()}>
|
||||
{stamp()}
|
||||
</time>
|
||||
</Tooltip>
|
||||
</span>
|
||||
{/* A pending steer has not been sent, so Pending stands in for the time instead of reserving its width. */}
|
||||
<UserMessageTransition active={!waiting()}>
|
||||
<span data-slot="user-message-meta-tail">
|
||||
<Show when={metaLabels().length > 0}>
|
||||
<span data-slot="user-message-meta-separator" aria-hidden="true">
|
||||
{"\u00B7"}
|
||||
</span>
|
||||
</Show>
|
||||
<Tooltip
|
||||
appearance="compact"
|
||||
value={fulltimefmt().format(props.message.time.created)}
|
||||
placement="top"
|
||||
triggerTabIndex={0}
|
||||
openDelay={800}
|
||||
>
|
||||
<time dir="auto" dateTime={new Date(props.message.time.created).toISOString()}>
|
||||
{stamp()}
|
||||
</time>
|
||||
</Tooltip>
|
||||
</span>
|
||||
</UserMessageTransition>
|
||||
</span>
|
||||
</span>
|
||||
{renderActions()}
|
||||
|
||||
Reference in New Issue
Block a user