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/25 23:40:25 UTC
(maka) 01/02: Revert "fix(ui): slow a task row's running ring and center its time (#5718)"
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a commit to branch fix/sidebar-trailing-slot
in repository https://gitbox.apache.org/repos/asf/maka.git
commit 7b69ee8d3d89bdff43e4d8004085c51d0b195e8e
Author: AstroHan <le...@outlook.com>
AuthorDate: Sat Sep 26 07:30:57 2026 +0800
Revert "fix(ui): slow a task row's running ring and center its time (#5718)"
This reverts commit cd94498521df191578a06692f8f87f910673c901.
Generated-by: Claude Code
---
apps/desktop/src/renderer/styles/base.css | 4 --
apps/desktop/src/renderer/styles/sidebar.css | 30 ++---------
packages/core/src/__tests__/relative-time.test.ts | 3 +-
packages/core/src/relative-time.ts | 11 +---
.../__tests__/session-history-row-actions.test.tsx | 2 +-
packages/ui/stories/session-list-panel.stories.tsx | 62 ----------------------
6 files changed, 7 insertions(+), 105 deletions(-)
diff --git a/apps/desktop/src/renderer/styles/base.css b/apps/desktop/src/renderer/styles/base.css
index a483f150a6..1a3e2d334c 100644
--- a/apps/desktop/src/renderer/styles/base.css
+++ b/apps/desktop/src/renderer/styles/base.css
@@ -71,10 +71,6 @@
}
.maka-running-indicator {
display: inline-flex;
- /* The astryx Spinner reads its period from this token (525ms stock). A
- row's running state stays on screen for the whole run, unlike a
- transient loading spinner, so it turns slower. */
- --duration-slow-min: 1.3s;
}
button {
transition:
diff --git a/apps/desktop/src/renderer/styles/sidebar.css b/apps/desktop/src/renderer/styles/sidebar.css
index e7d7f2ab89..906ae740fa 100644
--- a/apps/desktop/src/renderer/styles/sidebar.css
+++ b/apps/desktop/src/renderer/styles/sidebar.css
@@ -385,14 +385,6 @@
min-height: var(--h-control-sm, 24px);
}
-.maka-session-row {
- /* One trailing column for the signal slot and the ⋯ that covers it on
- hover. Fixed so the ring, the dot, the timestamp and the menu all share
- the column's center axis; wide enough for the longest scan token
- ("59min" ≈ 41px). */
- --_trailing-column: calc(var(--spacing) * 11); /* 44px */
-}
-
/*
* The signal slot: the row's state at rest, or its timestamp when it has no
* state; the ⋯ menu on hover or keyboard focus.
@@ -414,18 +406,15 @@
align-items: center;
justify-content: center;
flex: none;
- width: var(--_trailing-column);
+ 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;
- /* Blink centers the font's em box and SF's digit mass hangs ~0.5px below
- its center, so next to the geometrically centered running ring the time
- reads low. Nudge the ink; the slot stays put. */
- transform: translateY(-0.5px);
}
@media (hover: hover) {
@@ -454,13 +443,10 @@
}
/* Nothing here can reveal the menu later, so it stays up and the slot moves
- aside to sit next to it. The margin clears the menu's new left edge: column
- axis inset plus its 24px and the cluster gap. */
+ aside to sit next to it. */
@media (hover: none) {
.maka-session-row[data-actionable="true"] .maka-session-row-end {
- margin-inline-end: calc(
- (var(--_trailing-column) + var(--h-control-sm, 24px)) / 2 + var(--space-1)
- );
+ margin-inline-end: calc(var(--h-control-sm, 24px) + var(--space-1));
}
}
@@ -481,14 +467,6 @@
width: var(--h-control-sm, 24px);
}
-/* On a task row the menu covers the trailing column, so it takes the column's
- center axis — the same line the ring, the dot and the timestamp sit on. */
-.maka-session-row > .maka-session-row-action {
- inset-inline-end: calc(
- var(--space-2) + (var(--_trailing-column) - var(--h-control-sm, 24px)) / 2
- );
-}
-
/* A collapsible project keeps Astryx's 24px disclosure after endContent. Match
* the placeholder's original slot immediately before that disclosure: row
* gutter + disclosure + SideNavItem gap. Empty projects have no disclosure and
diff --git a/packages/core/src/__tests__/relative-time.test.ts b/packages/core/src/__tests__/relative-time.test.ts
index 13f5a44e0f..9cb6cc031d 100644
--- a/packages/core/src/__tests__/relative-time.test.ts
+++ b/packages/core/src/__tests__/relative-time.test.ts
@@ -98,8 +98,7 @@ describe('relative timestamp labels', () => {
assert.equal(delay, 60_000);
assert.equal(formatRelativeTimestamp(futureTs, NOW, 'en'), 'just now');
assert.equal(formatCompactTimestamp(futureTs, NOW, 'en'), 'just now');
- // The sidebar's compact scan column spells en just-now as "now".
- assert.equal(formatSidebarTimestamp(futureTs, NOW, 'en'), 'now');
+ assert.equal(formatSidebarTimestamp(futureTs, NOW, 'en'), 'just now');
});
it('keeps timestamp refresh delays within the scheduler bound', () => {
diff --git a/packages/core/src/relative-time.ts b/packages/core/src/relative-time.ts
index d527d37631..e2d41d4fdd 100644
--- a/packages/core/src/relative-time.ts
+++ b/packages/core/src/relative-time.ts
@@ -53,15 +53,6 @@ const JUST_NOW: UiCatalog<string> = {
en: 'just now',
};
-// The sidebar column is sized to the scan tokens ("59min"); the spelled-out
-// "just now" is wider than any of them, so the slot gets its own compact en
-// label.
-const SIDEBAR_JUST_NOW: UiCatalog<string> = {
- 'zh-CN': '刚刚',
- 'zh-TW': '剛剛',
- en: 'now',
-};
-
/** Future timestamps are treated as age zero and therefore display as just now. */
function relativeAgeMs(ts: number, now: number): number {
return Math.max(0, now - ts);
@@ -179,7 +170,7 @@ export function formatCompactTimestamp(ts: number, now: number, locale: UiLocale
*/
export function formatSidebarTimestamp(ts: number, now: number, locale: UiLocale): string {
const diffMs = relativeAgeMs(ts, now);
- if (diffMs < JUST_NOW_MS) return SIDEBAR_JUST_NOW[locale];
+ if (diffMs < JUST_NOW_MS) return JUST_NOW[locale];
const bucket = sidebarTimeBucket(diffMs);
return `${bucket.value}${bucket.suffix}`;
}
diff --git a/packages/ui/src/__tests__/session-history-row-actions.test.tsx b/packages/ui/src/__tests__/session-history-row-actions.test.tsx
index 545a69073c..d63e907afa 100644
--- a/packages/ui/src/__tests__/session-history-row-actions.test.tsx
+++ b/packages/ui/src/__tests__/session-history-row-actions.test.tsx
@@ -201,7 +201,7 @@ for (const lastMessageAt of [undefined, Date.UTC(2026, 6, 24)]) {
</LocaleProvider>,
));
- assert.equal(document.querySelector('.maka-session-row-time-label')?.textContent, 'now');
+ assert.equal(document.querySelector('.maka-session-row-time-label')?.textContent, 'just now');
} finally {
Date.now = originalDateNow;
}
diff --git a/packages/ui/stories/session-list-panel.stories.tsx b/packages/ui/stories/session-list-panel.stories.tsx
index 0f16d6f9b6..ff6d1ee7d9 100644
--- a/packages/ui/stories/session-list-panel.stories.tsx
+++ b/packages/ui/stories/session-list-panel.stories.tsx
@@ -339,48 +339,6 @@ export const ConversationStates: Story = {
})} />
</StoryFrame>
),
- play: async ({ canvasElement }) => {
- const indicator = canvasElement.querySelector<HTMLElement>(
- '[data-session-id="status-running"] .maka-running-indicator',
- );
- if (!indicator) throw new Error('running indicator is missing');
- // The ring reads its period from --duration-slow-min; base.css slows the
- // row's permanent indicator to 1.3s. The ink-ladder contract fails any
- // getPropertyValue read of a custom property, so this scans the rule —
- // recursively, because the app's sheets nest their rules inside @layer.
- const walk = (rules: readonly CSSRule[]): CSSRule[] =>
- rules.flatMap((rule) => [
- rule,
- ...('cssRules' in rule ? walk(Array.from((rule as CSSGroupingRule).cssRules)) : []),
- ]);
- const rule = walk(
- Array.from(canvasElement.ownerDocument.styleSheets).flatMap((sheet) => {
- try {
- return Array.from(sheet.cssRules);
- } catch {
- return [];
- }
- }),
- ).find(
- (rule) =>
- rule instanceof CSSStyleRule &&
- rule.selectorText === '.maka-running-indicator' &&
- rule.cssText.includes('1.3s'),
- );
- expect(rule).toBeDefined();
-
- // The trailing column is one axis: the running ring and another row's
- // status dot share its center, so a state swap never shifts sideways.
- const dot = canvasElement.querySelector<HTMLElement>(
- '[data-session-id="status-waiting"] [data-session-status]',
- );
- if (!dot) throw new Error('status dot is missing');
- const centerX = (element: Element) => {
- const box = element.getBoundingClientRect();
- return box.x + box.width / 2;
- };
- expect(Math.abs(centerX(indicator) - centerX(dot))).toBeLessThanOrEqual(1);
- },
};
// Real path: switching between two ordinary Sessions in a populated rail. The
@@ -519,26 +477,6 @@ export const LongTitlesAndNarrow: Story = {
})} />
</StoryFrame>
),
- play: async ({ canvasElement }) => {
- const time = canvasElement.querySelector<HTMLElement>(
- '[data-session-id="long-title-active"] .maka-session-row-time-label',
- );
- if (!time) throw new Error('time label is missing');
- // sidebar.css lifts the digit ink ~0.5px onto the running ring's axis.
- expect(getComputedStyle(time).transform).toContain('-0.5');
-
- // The timestamp is centered on the trailing column's axis too — the same
- // line the blocked row's status dot is centered on.
- const dot = canvasElement.querySelector<HTMLElement>(
- '[data-session-id="long-title-stale"] [data-session-status]',
- );
- if (!dot) throw new Error('status dot is missing');
- const centerX = (element: Element) => {
- const box = element.getBoundingClientRect();
- return box.x + box.width / 2;
- };
- expect(Math.abs(centerX(time) - centerX(dot))).toBeLessThanOrEqual(1);
- },
};
// Real path: time-sort with both flagged and unflagged sessions — two
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org