Skip to content

Commit 85ded0e

Browse files
committed
fix(app-shell): Studio's rails mark a customization with a word, no fill, instead of a glyph that read as an add button
The compact customization mark now prints 定制 / Customized for a customized row and 新增 / Added for an added one, in the kind's colour with no background. Its accessible name and tooltip keep the full text and the sentence naming the pair. New studio key engine.customizationMark.customizedShort (en, zh). Claude-Session: https://claude.ai/code/session_01L6bhgXtD8kC2LpK5YoB2sK Co-authored-by: Claude <noreply@anthropic.com>
1 parent b6caa14 commit 85ded0e

6 files changed

Lines changed: 39 additions & 21 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(app-shell): Studio's rails mark a customized row with the word 定制 / Customized and an added row with 新增 / Added, no fill, instead of a filled square with a glyph that read as an add button (#30070)
7+
8+
Clause-②: yes (widening) — new studio i18n key `engine.customizationMark.customizedShort` (en, zh)
9+
Metadata-protocol: none
10+
11+
The compact customization mark the pillar rails draw (and the Interfaces rail's navigation-override mark, which wraps it) now prints one short coloured word with no background. Its tooltip and accessible name are unchanged: the full text ("已定制(HotCRM)") followed by the sentence naming the customization package. It is not a control: a click on it is a click on its row.

‎ui/packages/app-shell/src/views/studio-design/CustomizationMark.tsx‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
import * as React from 'react';
18-
import { Layers3, PencilRuler, Plus } from 'lucide-react';
1918
import { cn } from '@object-ui/components';
2019
import { customizationPackageId } from '@objectstack/spec/kernel';
2120
import { t, tFormat } from '../metadata-admin/i18n.js';
@@ -36,18 +35,20 @@ const KIND_CLASS: Record<CustomizationMarkChipKind, string> = {
3635
customizationOf: 'bg-muted text-muted-foreground',
3736
};
3837

39-
/** objectstack#29693 — the glyph the compact mark draws in place of its text. */
40-
const KIND_ICON: Record<CustomizationMarkChipKind, React.ElementType> = {
41-
customized: PencilRuler,
42-
added: Plus,
43-
customizationOf: Layers3,
38+
/** The compact mark's colour: its word alone, no fill, so it never reads as a button. */
39+
const KIND_TEXT_CLASS: Record<CustomizationMarkChipKind, string> = {
40+
customized: 'text-violet-700 dark:text-violet-300',
41+
added: 'text-emerald-700 dark:text-emerald-300',
42+
customizationOf: 'text-muted-foreground',
4443
};
4544

4645
/**
47-
* objectstack#29693 — `compact` (the pillar rails): the mark is its glyph
48-
* alone, so it never takes a row's name ("已定制(ObjectStack Showcase)" left a
49-
* selected flow row no room for its label). Its text is its accessible name
50-
* and leads its tooltip, before the sentence naming the pair.
46+
* `compact` (the pillar rails): the mark prints one short word with no
47+
* background (objectstack#30070: 定制 for customized, 新增 for added), so it
48+
* reads as a status, never as a button, and never takes a row's name
49+
* (objectstack#29693). Its full text is its accessible name and leads its
50+
* tooltip, before the sentence naming the pair. It is not a control: a click
51+
* on it is a click on its row.
5152
*/
5253
export function CustomizationMark({
5354
kind,
@@ -64,7 +65,7 @@ export function CustomizationMark({
6465
pairId?: string;
6566
locale: string;
6667
className?: string;
67-
/** Draw the glyph alone, the text in its accessible name and tooltip. */
68+
/** Print one short word, no fill; the full text is its accessible name and leads its tooltip. */
6869
compact?: boolean;
6970
}): React.ReactElement {
7071
const base = baseName ?? '';
@@ -76,7 +77,6 @@ export function CustomizationMark({
7677
? tFormat(`engine.customizationMark.${kind}Title`, locale, { baseName: base, pair: pairId })
7778
: undefined;
7879
if (compact) {
79-
const Icon = KIND_ICON[kind];
8080
return (
8181
<span
8282
data-testid="customization-mark"
@@ -85,9 +85,9 @@ export function CustomizationMark({
8585
role="img"
8686
aria-label={label}
8787
title={title ? `${label}\n${title}` : label}
88-
className={cn('inline-flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px]', KIND_CLASS[kind], className)}
88+
className={cn('inline-flex shrink-0 items-center whitespace-nowrap text-[11px] font-medium leading-none', KIND_TEXT_CLASS[kind], className)}
8989
>
90-
<Icon className="h-3 w-3" aria-hidden="true" />
90+
{kind === 'customized' ? t('engine.customizationMark.customizedShort', locale) : label}
9191
</span>
9292
);
9393
}

‎ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.oneSurface-28572.test.tsx‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ describe('the Interfaces rail lists a base and its pair as one list (objectstack
464464
});
465465
});
466466

467-
describe('the rail mark never takes the row’s name (objectstack#29693)', () => {
468-
it('is its glyph alone: the row prints only its label, and the mark’s text is its name and leads its tooltip', async () => {
467+
describe('the rail mark never takes the row’s name (objectstack#29693, objectstack#30070)', () => {
468+
it('prints one short word with no fill and no glyph: its full text is its name and leads its tooltip', async () => {
469469
renderAt(`/studio/${BASE}/interfaces`);
470470
await interfacesReady();
471471
const row = rowOf(ifRail(), 'dashboard', 'pipeline')!;
@@ -475,11 +475,16 @@ describe('the rail mark never takes the row’s name (objectstack#29693)', () =>
475475
expect(mark).toHaveAttribute('data-compact');
476476
expect(mark).toHaveAccessibleName(label);
477477
expect(mark.getAttribute('title')?.split('\n')[0]).toBe(label);
478-
expect(mark.textContent).toBe('');
478+
expect(mark.textContent).toBe(t('engine.customizationMark.customizedShort', 'en'));
479479
expect(within(row).queryByText(label)).toBeNull();
480480
const added = within(rowOf(ifRail(), 'dashboard', 'wins')!).getByTestId('customization-mark');
481481
expect(added).toHaveAccessibleName(t('engine.customizationMark.added', 'en'));
482-
expect(added.textContent).toBe('');
482+
expect(added.textContent).toBe(t('engine.customizationMark.added', 'en'));
483+
// A status, not a control: no filled block, no glyph that reads as an add button.
484+
for (const m of [mark, added]) {
485+
expect(m.querySelector('svg')).toBeNull();
486+
expect(m.className).not.toMatch(/(^|\s)bg-/);
487+
}
483488
});
484489
});
485490

‎ui/packages/app-shell/src/views/studio-design/StudioRailCustomizations.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ export function railCustomizationsOf(
115115
}
116116

117117
/**
118-
* A row's mark in the rail's trailing slot, or nothing. objectstack#29693 —
119-
* compact (its glyph, the text in its name and tooltip), so it never takes the
120-
* row's label.
118+
* A row's mark in the rail's trailing slot, or nothing. Compact (one short
119+
* word, no fill; the full text in its name and tooltip), so it never takes the
120+
* row's label and never reads as a button.
121121
*/
122122
export function RailCustomizationMark({
123123
row,

‎ui/packages/i18n/src/namespaces/studio/en.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,6 +3677,7 @@ const STUDIO_EN: Record<string, string> = {
36773677
// objectstack ADR-0146 D3 (#28568) — the customization marks, counts and
36783678
// filter of the All metadata area, from a base's customization read.
36793679
'engine.customizationMark.customized': 'Customized ({baseName})',
3680+
'engine.customizationMark.customizedShort': 'Customized',
36803681
'engine.customizationMark.customizedTitle': 'The customization package {pair} overrides this item of {baseName}',
36813682
'engine.customizationMark.added': 'Added',
36823683
'engine.customizationMark.addedTitle': 'Added to {baseName} by its customization package {pair}',

‎ui/packages/i18n/src/namespaces/studio/zh.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,6 +3254,7 @@ const STUDIO_ZH: Record<string, string> = {
32543254
// objectstack ADR-0146 D3 (#28568) — the customization marks, counts and
32553255
// filter of the All metadata area, from a base's customization read.
32563256
'engine.customizationMark.customized': '已定制({baseName})',
3257+
'engine.customizationMark.customizedShort': '定制',
32573258
'engine.customizationMark.customizedTitle': '定制包 {pair} 覆盖了 {baseName} 的此项',
32583259
'engine.customizationMark.added': '新增',
32593260
'engine.customizationMark.addedTitle': '由 {baseName} 的定制包 {pair} 新增',

0 commit comments

Comments
 (0)