Skip to content

Commit 3ae62ac

Browse files
feat(ui): one 8px corner for every control, a white content area beside a light grey sidebar, and badges at weight 500 (#36047 slice 1) (#36093)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuYadPn6DUd9mNCVDjwzayER)_ repo:objectstack#1 · os-sales · session_01L6bhgVDwx4yqxWdY3Rurnk Part of #36047 (slice 1 of 2: theme tokens and shared controls; slice 2, the per-site text sizes and weights, lands last and carries `Fixes`). Clause-②: no Metadata-protocol: none ## 维护者速读 - 所有控件的圆角统一成 8:按钮、输入框、下拉、工具栏控件、菜单、页签条(原来 12);列表单元格里的关联小块(原来 4)、表单里选中的人员和关联小块、列表的「排序」「筛选」和已设条件小块(原来全圆)也都是 8。页签条里面的页签按钮、菜单里的一行是 6,和外框同心。 - 卡片仍是 14,弹出框、点击弹出的浮层(选择器等,仍是 20)、抽屉的圆角都不变。鼠标悬停出现的提示框和悬停卡片、下拉列表跟着控件从 12 变 8;弹框和抽屉右上角关闭按钮的小圆角从 10 变 6。单选/多选的彩色标签保持全圆(标签形状未改)。 - 内容区改成白底:列表页、记录页、看板、顶栏都是白的;侧边栏是唯一的浅灰面,和内容区之间有一条细线。深色主题下内容区是最深的一档,侧边栏亮一档。白底范围按 Sales 13:11 的选择:整个控制台都变白(裁定记录 7063106408),不只是列表页和记录页。首页、仪表盘、报表、搜索、通知、文档页、设置和 Studio、登录注册页、公开表单页(`/f/:slug`)、公开分享的记录页(`/s/:token`)的底色也一起变白(它们的布局不动);设备授权页和首次安装设置页自己用另一种灰,仍是灰底;卡片、弹框本来就是白的,靠描边分开。 - 彩色标签的字重从 600 降到 500(字号、形状、颜色不变)。 - 字号 13→14/12、其他 600→500 不在这个 PR,在片 2,最后落地。 ## What changes **Theme tokens** (`ui/apps/console/src/index.css`, the iOS theme layer) - `--radius-md: 0.5rem` and `--radius-sm: 0.375rem` are set on `:root`, instead of being derived from `--radius` (`calc(var(--radius) - 2px)` / `- 4px`, which gave 12px and 10px). `--radius` stays 0.875rem, so `rounded-lg` cards keep their 14px corner. The checkbox's own `--radius-sm` override is unchanged. - What follows the two tokens beyond the controls: tooltips (`TooltipContent`) and hover cards (`HoverCardContent`) are `rounded-md`, so they go 12 → 8px; select and command lists and their rows follow `rounded-md` / `rounded-sm`; the dialog and sheet close buttons (`rounded-sm`) go 10 → 6px. `Popover` content keeps 20px through the console's popper-wrapper rule, so the combobox and lookup pickers are unchanged. - `--background` is white (`0 0% 100%`, was `240 24% 97%`). The sidebar is `240 12% 96%` (was `240 24% 98%`), drawn at 70% by the frosted rule, so it reads as a light grey beside white; its existing 1px border is the hairline. Dark: `--background` stays `240 6% 6%`, the sidebar is `240 6% 11%` (was 8%), one step lighter. **Every page whose content background changes** (Sales chose the whole console, ruling of record 7063106408 on #36047, over list and record pages only). `--background` is the console's page canvas, so every page drawn on it goes from the grouped grey to white: - the top bar (its frosted fill is `--background` at 72%); - an app's pages: object lists (grid, kanban, calendar, gantt and the other list views), record pages and record drawers, dashboards, reports, the app home; - the console home, search results, notifications / inbox, the docs pages; - Setup and Studio pages (their layout is not changed; only the canvas behind them); - the sign-in, sign-up, password, e-mail-verification and OAuth-consent pages (`AuthShell` / `OAuthConsentPage` draw on `bg-background`); the device-authorization and first-run setup pages draw on `bg-muted` (`240 18% 94%`, unchanged) and stay grey; - the public form page (`/f/:slug`, `FormPage mode="public"`, which draws no canvas of its own) and the shared-record page (`/s/:token`, `SharedRecordPage` on `bg-background`); the internal `/forms/:name` is an app page; - inputs, outline buttons and the in-cell editor layer, which were already drawn on `bg-background` and now match the page they sit on. Cards (`--card`), popovers and dialogs were white already and are unchanged; they are told apart from the page by their border. The sidebar is the one surface that stays grey. In the dark theme the canvas value is unchanged (`240 6% 6%`); only the sidebar moves one step lighter. **Shared controls** - `Badge` (`@object-ui/components`, Shadcn-synced) is `font-medium` instead of `font-semibold`, through a declared local patch `badge-medium-weight` in `ui/scripts/shadcn-local-patches.mjs`. The upstream registry file is vendored as `scripts/__tests__/fixtures/shadcn-registry/badge.registry.txt` (pinned sha256, captured at the same shadcn-ui/ui commit as the other fixtures). Round-trip equality is pinned unavailable with its reason: the file already ships the undeclared `whitespace-nowrap` edit. `shadcn-components.json` names the patch. - Lookup chips in a list cell (`OBJECT_GRID_TABLE_DENSITY` in `@object-ui/plugin-grid`): `rounded` → `rounded-md`. - The people chip in `LookupField` and the selection tray chip (`@object-ui/fields`): `rounded-full` → `rounded-md`. - The list's empty Sort / Filter buttons and its condition chips (`ListConditionControls`, `@object-ui/plugin-list`): `rounded-full` → `rounded-md`. ## Why #36047 items 3 and 4 (maintainer-approved Attio comparison): one corner value for controls, and a white content area with the grey left only to the sidebar, changed on theme variables and shared components rather than page by page. Items 1 and 2 (two text sizes, two weights) are slice 2. ## Verification Measured in a real browser (CRM example, console dev server against it) before and after, 1440 and 375, light and dark: list (account), record page (opportunity), kanban (opportunity pipeline), create dialog. Computed values, screenshots and the script: `/mnt/project-files/build-seat1/36047/` (`before/`, `after/`, `measure.json`, `shots.cjs`). | | before | after | |---|---|---| | buttons, inputs, comboboxes in the content area | 12px (sort/filter pills 9999px) | 8px | | record page tab triggers | 10px | 6px | | cards (kanban card, record side card) | 14px / 16px | 14px / 16px | | create dialog | 20px | 20px (unchanged here; #35980 sets its own) | | content background, light | rgb(246,246,249) | rgb(255,255,255) | | sidebar, light | rgba(249,249,251,0.7) | rgba(244,244,246,0.7) | | content / sidebar, dark | rgb(14,14,16) / rgba(19,19,22,0.7) | rgb(14,14,16) / rgba(26,26,30,0.7) | | sidebar right border | 1px | 1px | | badge weight | 600 | 500 | Tests: `scripts/__tests__/shadcn-local-patches.test.ts` (the new `badge` family: fixture present, hash, anchors apply to registry bytes, marker, round-trip pinned), and every test file that mentions the changed classes or tokens, plus `packages/plugin-list/src` (192 files, 2180 tests, all pass). eslint on the changed files: 0 errors. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes (eslint on every changed file locally; CI's Lint UI is the full reading). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the 维护者速读 block is the maintainer's summary, in the maintainer's language). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgVDwx4yqxWdY3Rurnk)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgVDwx4yqxWdY3Rurnk <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgVDwx4yqxWdY3Rurnk --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 13d1e95 commit 3ae62ac

11 files changed

Lines changed: 117 additions & 15 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/components': patch
4+
'@object-ui/fields': patch
5+
'@object-ui/plugin-grid': patch
6+
'@object-ui/plugin-list': patch
7+
---
8+
9+
feat(ui): one 8px corner for every control, a white content area beside a light grey sidebar, and badges at weight 500
10+
11+
Clause-②: no
12+
Metadata-protocol: none
13+
14+
- **Controls share one corner, 8px.** Buttons, inputs, selects, toolbar controls, menus and tab lists are `rounded-md`, which the console theme now sets to 8px (it was 12px, derived from the 14px card corner). What sits inside one of them, a tab trigger in its list or a menu row, is `rounded-sm`, 6px. Cards keep their 14px corner, and dialogs, popovers and drawers keep theirs.
15+
- **Chips follow.** A lookup chip in a list cell (it was 4px), a person or record chip in a form's lookup field and its selection tray, and the list's Sort, Filter and condition chips (they were pills) take the same 8px corner. Coloured option badges stay pills.
16+
- **The content area is white.** The console's `--background` is white instead of the grouped grey, so a list, a record page, a kanban board and the top bar sit on white. The sidebar is the one light grey surface beside it, with its hairline border; in the dark theme the content area is the darkest step and the sidebar one step lighter.
17+
- **Badges are weight 500.** `Badge` was `font-semibold` (600), outside the console's two text weights; it is `font-medium` (500). This is a declared local patch on the Shadcn primitive (`badge-medium-weight` in `ui/scripts/shadcn-local-patches.mjs`), so it survives a registry sync.

‎ui/apps/console/src/index.css‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,20 +402,29 @@
402402
* ============================================================ */
403403
@layer base {
404404
:root {
405-
/* iOS uses larger, concentric corner radii */
405+
/* Large surfaces (cards, `rounded-lg`) keep the larger iOS corner. */
406406
--radius: 0.875rem;
407407

408-
/* iOS "grouped" canvas: soft system gray (≈ #F2F2F7) instead of pure
409-
white, so white cards/popovers float above it with real depth. */
410-
--background: 240 24% 97%;
408+
/* Controls share one 8px corner: buttons, inputs, selects, toolbar
409+
controls, menus and chips are `rounded-md`. What sits inside one (a tab
410+
trigger in its list, a menu row) is `rounded-sm`, 6px, so the corners
411+
stay concentric. Set here rather than derived from `--radius`, which
412+
would move the cards with them. */
413+
--radius-md: 0.5rem;
414+
--radius-sm: 0.375rem;
415+
416+
/* The content area is white; the sidebar is the one grey surface beside
417+
it (see `--sidebar` below), and cards are told apart by their border. */
418+
--background: 0 0% 100%;
411419
--secondary: 240 18% 94%;
412420
--muted: 240 18% 94%;
413421
--accent: 240 18% 94%;
414422
--border: 240 16% 90%;
415423
}
416424

417425
.dark {
418-
/* iOS dark uses near-black, not blue-black; cards sit slightly above. */
426+
/* iOS dark uses near-black, not blue-black; the content area is the
427+
darkest step and cards and the sidebar sit one step above it. */
419428
--background: 240 6% 6%;
420429
--card: 240 6% 10%;
421430
--popover: 240 6% 11%;
@@ -490,16 +499,18 @@ header.sticky {
490499
--ring: 211 100% 50%;
491500
--sidebar-primary: 211 100% 50%;
492501
--sidebar-ring: 211 100% 50%;
493-
/* iOS sidebar is a translucent vibrancy material → near-white base. */
494-
--sidebar: 240 24% 98%;
502+
/* The sidebar is a light grey beside the white content area, drawn at
503+
70% over it (the frosted rule below), so it reads as ≈ #F7F7F8. */
504+
--sidebar: 240 12% 96%;
495505
}
496506
.dark {
497507
/* iOS dark blue (#0A84FF) is a touch brighter for contrast. */
498508
--primary: 211 100% 60%;
499509
--ring: 211 100% 60%;
500510
--sidebar-primary: 211 100% 60%;
501511
--sidebar-ring: 211 100% 60%;
502-
--sidebar: 240 6% 8%;
512+
/* One step lighter than the content area's 6%. */
513+
--sidebar: 240 6% 11%;
503514
}
504515
}
505516

‎ui/packages/components/shadcn-components.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"source": "https://ui.shadcn.com/r/styles/default/badge.json",
5656
"dependencies": [],
5757
"registryDependencies": [],
58-
"localEdits": "Adds `whitespace-nowrap`: a badge is a single-line pill by definition, and without it CJK labels (e.g. 待审批) break per-character inside a cramped table cell and stack vertically (objectui#2762 P0-1). The reasoning is also comment-documented in the file."
58+
"localEdits": "Adds `whitespace-nowrap`: a badge is a single-line pill by definition, and without it CJK labels (e.g. 待审批) break per-character inside a cramped table cell and stack vertically (objectui#2762 P0-1). The reasoning is also comment-documented in the file. Declared patch `badge-medium-weight` (objectstack#36047, scripts/shadcn-local-patches.mjs) sets the weight to `font-medium` (500)."
5959
},
6060
"breadcrumb": {
6161
"source": "https://ui.shadcn.com/r/styles/default/breadcrumb.json",

‎ui/packages/components/src/ui/badge.tsx‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎ui/packages/fields/src/widgets/LookupField.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,7 @@ export function LookupField({ value, onChange, field, readonly, error: fieldErro
22382238
<span
22392239
key={idx}
22402240
data-testid="people-field-chip"
2241-
className="inline-flex items-center gap-1.5 rounded-full border bg-background py-0.5 pl-0.5 pr-1.5 text-sm"
2241+
className="inline-flex items-center gap-1.5 rounded-md border bg-background py-0.5 pl-0.5 pr-1.5 text-sm"
22422242
>
22432243
<Avatar className="size-6 shrink-0">
22442244
{avatarUrl && <AvatarImage src={avatarUrl} alt={String(chipLabel || '')} />}

‎ui/packages/fields/src/widgets/SelectionTray.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function SelectionTray({
9797
<span
9898
key={String(id)}
9999
data-testid="selection-chip"
100-
className="inline-flex items-center gap-1.5 rounded-full border bg-background py-0.5 pl-0.5 pr-1.5 text-sm"
100+
className="inline-flex items-center gap-1.5 rounded-md border bg-background py-0.5 pl-0.5 pr-1.5 text-sm"
101101
>
102102
<Avatar className="size-6 shrink-0">
103103
{avatarUrl && <AvatarImage src={avatarUrl} alt={name} />}

‎ui/packages/plugin-grid/src/ObjectGrid.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ export const OBJECT_GRID_TABLE_DENSITY = [
643643
'[&_th:not(:last-child)]:inset-shadow-[-1px_0_0_0] [&_th:not(:last-child)]:inset-shadow-border/50 [&_td:not(:last-child)]:inset-shadow-[-1px_0_0_0] [&_td:not(:last-child)]:inset-shadow-border/50',
644644
// A referenced record (a lookup's link) is a small chip led by its name's
645645
// first letter; an option label keeps its colour, less saturated.
646-
'[&_td_a[data-record-link]]:inline-flex [&_td_a[data-record-link]]:h-5 [&_td_a[data-record-link]]:max-w-full [&_td_a[data-record-link]]:items-center [&_td_a[data-record-link]]:gap-1 [&_td_a[data-record-link]]:rounded [&_td_a[data-record-link]]:bg-muted [&_td_a[data-record-link]]:px-1.5 [&_td_a[data-record-link]]:text-foreground [&_td_a[data-record-link]]:hover:no-underline [&_td_a[data-record-link]]:hover:bg-accent',
646+
'[&_td_a[data-record-link]]:inline-flex [&_td_a[data-record-link]]:h-5 [&_td_a[data-record-link]]:max-w-full [&_td_a[data-record-link]]:items-center [&_td_a[data-record-link]]:gap-1 [&_td_a[data-record-link]]:rounded-md [&_td_a[data-record-link]]:bg-muted [&_td_a[data-record-link]]:px-1.5 [&_td_a[data-record-link]]:text-foreground [&_td_a[data-record-link]]:hover:no-underline [&_td_a[data-record-link]]:hover:bg-accent',
647647
'[&_td_a[data-record-link]]:before:flex [&_td_a[data-record-link]]:before:h-3.5 [&_td_a[data-record-link]]:before:w-3.5 [&_td_a[data-record-link]]:before:shrink-0 [&_td_a[data-record-link]]:before:items-center [&_td_a[data-record-link]]:before:justify-center [&_td_a[data-record-link]]:before:rounded-sm [&_td_a[data-record-link]]:before:bg-muted-foreground/20 [&_td_a[data-record-link]]:before:text-[10px] [&_td_a[data-record-link]]:before:font-medium [&_td_a[data-record-link]]:before:content-[attr(data-initial)]',
648648
'[&_td_[data-select-badge]]:saturate-[.6]',
649649
].join(' ');

‎ui/packages/plugin-list/src/conditions/ListConditionControls.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ export interface ConditionChipRowProps {
506506
}
507507

508508
const CHIP_CLASS =
509-
'inline-flex h-6 max-w-[280px] shrink-0 items-center gap-1 rounded-full border px-2 text-[13px] leading-none';
509+
'inline-flex h-6 max-w-[280px] shrink-0 items-center gap-1 rounded-md border px-2 text-[13px] leading-none';
510510

511511
/**
512512
* A control of the condition row below `sm`: 44 px on both sides (WCAG 2.5.5),
@@ -517,7 +517,7 @@ const ROW_TOUCH_TARGET = 'max-sm:h-11 max-sm:min-w-11';
517517

518518
/** 「Sort」, 「Filter」 and 「+」 before anything is set: dashed, so they do not read as a condition in force. */
519519
const EMPTY_BUTTON_CLASS =
520-
'max-sm:h-11 max-sm:min-w-11 inline-flex h-6 shrink-0 items-center gap-1 rounded-full border border-dashed px-2 text-[13px] leading-none text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring';
520+
'max-sm:h-11 max-sm:min-w-11 inline-flex h-6 shrink-0 items-center gap-1 rounded-md border border-dashed px-2 text-[13px] leading-none text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring';
521521

522522
export function ConditionChipRow({
523523
sort,
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import * as React from "react"
2+
import { cva, type VariantProps } from "class-variance-authority"
3+
4+
import { cn } from "@/lib/utils"
5+
6+
const badgeVariants = cva(
7+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8+
{
9+
variants: {
10+
variant: {
11+
default:
12+
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13+
secondary:
14+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15+
destructive:
16+
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17+
outline: "text-foreground",
18+
},
19+
},
20+
defaultVariants: {
21+
variant: "default",
22+
},
23+
}
24+
)
25+
26+
export interface BadgeProps
27+
extends React.HTMLAttributes<HTMLDivElement>,
28+
VariantProps<typeof badgeVariants> {}
29+
30+
function Badge({ className, variant, ...props }: BadgeProps) {
31+
return (
32+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
33+
)
34+
}
35+
36+
export { Badge, badgeVariants }

‎ui/scripts/__tests__/shadcn-local-patches.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ const REGISTRY_FIXTURES: Record<string, RegistryFixture> = {
231231
sha256: '0a16955983c96c27e2a315ac3c930f624ff28f41a2815aa17151aa3bc574ebba',
232232
roundTrip: true,
233233
},
234+
badge: {
235+
url: 'https://ui.shadcn.com/r/styles/default/badge.json',
236+
repoPath: 'apps/v4/public/r/styles/default/badge.json',
237+
// Captured for objectstack#36047 at the same commit as the families above,
238+
// from `raw.githubusercontent.com`.
239+
headSha: '8a7701ec27eb9cb8e0377db769fbe6d744113c52',
240+
sha256: 'db977d821af56ae3fb7952182d9c0a076a10c75c38bc2d2b000827e720423d32',
241+
// `badge.tsx` carries the undeclared `whitespace-nowrap` edit and its
242+
// comment (objectui#2762), so byte-equality is not available.
243+
roundTrip: 'ships the undeclared `whitespace-nowrap` edit and its comment (objectui#2762)',
244+
},
234245
};
235246

236247
/** The captured registry bytes for `name`, exactly as served (pre-rewrite). */

0 commit comments

Comments
 (0)