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/24 15:16:09 UTC
(maka) branch main updated: fix(ui): center a task row's state on the menu axis (#5706)
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 167cb91910 fix(ui): center a task row's state on the menu axis (#5706)
167cb91910 is described below
commit 167cb91910fbc11920fc0a5bdf327add2adec6f4
Author: AstroHan <le...@outlook.com>
AuthorDate: Thu Sep 24 23:16:04 2026 +0800
fix(ui): center a task row's state on the menu axis (#5706)
Since #5686 the sidebar's trailing signal slot also holds the row's
status dot or running spinner, but it kept the flex-end justification
it had when it only held the timestamp. The 24px slot right-aligned an
8px dot (and the 14px spinner), so the state sat 8px (5px) right of the
center of the ⋯ button that replaces it on hover, and the two jumped
sideways on every swap.
Center the slot so indicators share the ⋯ axis, and push only the
timestamp to the end so short English times keep a right-aligned column.
The ProjectGroups story now asserts the running indicator and the ⋯
button share a center; with the old justification it measures 5px.
Generated-by: Claude Code
---
apps/desktop/src/renderer/styles/sidebar.css | 3 ++-
packages/ui/stories/session-list-panel.stories.tsx | 12 +++++++++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/apps/desktop/src/renderer/styles/sidebar.css b/apps/desktop/src/renderer/styles/sidebar.css
index 9dd73c718b..906ae740fa 100644
--- a/apps/desktop/src/renderer/styles/sidebar.css
+++ b/apps/desktop/src/renderer/styles/sidebar.css
@@ -404,13 +404,14 @@
.maka-session-row-signal {
display: inline-flex;
align-items: center;
- justify-content: flex-end;
+ justify-content: center;
flex: none;
min-width: var(--h-control-sm, 24px);
min-height: var(--h-control-sm, 24px);
}
.maka-session-row-time-label {
+ margin-inline-start: auto;
color: var(--muted-foreground);
font: var(--typography-caption);
white-space: nowrap;
diff --git a/packages/ui/stories/session-list-panel.stories.tsx b/packages/ui/stories/session-list-panel.stories.tsx
index 0be3d974b9..ff6d1ee7d9 100644
--- a/packages/ui/stories/session-list-panel.stories.tsx
+++ b/packages/ui/stories/session-list-panel.stories.tsx
@@ -705,9 +705,15 @@ export const ProjectGroups: Story = {
const taskRow = taskControl.closest<HTMLElement>('[data-session-id]');
if (!taskRow) throw new Error('task row is missing');
- const timestamp = taskRow.querySelector<HTMLElement>('.maka-session-row-signal');
- if (!timestamp) throw new Error('task timestamp is missing');
+ const signal = taskRow.querySelector<HTMLElement>('.maka-session-row-signal');
+ const indicator = signal?.querySelector<HTMLElement>('.maka-running-indicator');
+ if (!signal || !indicator) throw new Error('task running indicator is missing');
const taskActionButton = within(taskRow).getByRole('button', { name: /任务操作$/ });
+ const centerX = (element: Element) => {
+ const box = element.getBoundingClientRect();
+ return box.x + box.width / 2;
+ };
+ expect(Math.abs(centerX(indicator) - centerX(taskActionButton))).toBeLessThanOrEqual(1);
taskActionButton.focus();
await userEvent.keyboard('{Enter}');
const renameTask = page.getByRole('menuitem', { name: '重命名' });
@@ -719,7 +725,7 @@ export const ProjectGroups: Story = {
'true',
);
await userEvent.hover(renameTask);
- await expect(timestamp).toHaveStyle({ visibility: 'hidden' });
+ await expect(signal).toHaveStyle({ visibility: 'hidden' });
await userEvent.click(renameTask);
await expect(await page.findByRole('dialog', { name: '重命名任务' }, {
timeout: 5_000,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org