diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index 697b12229..07b10a3c4 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -583,17 +583,20 @@ button:disabled:where(:not([data-slot="button"])) { cursor: default; opacity: .4 .onboarding-progress li { height: 3px; border-radius: 999px; background: var(--color-border); } .onboarding-progress li.is-done { background: var(--color-ink); } .onboarding-who-options { display: grid; gap: 8px; } -.onboarding-who-option { height: auto; min-height: 56px; gap: 2px; white-space: normal; align-items: flex-start; flex-direction: column; justify-content: center; text-align: left; padding: 10px 14px; border-radius: var(--radius-lg); } +/* Unselected = the birth-time source option's plain edge (the outline button's dark-mode edge read heavier than the selected one). */ +.onboarding-who-option { border-color: var(--color-border); background: var(--color-canvas); height: auto; min-height: 56px; gap: 2px; white-space: normal; align-items: flex-start; flex-direction: column; justify-content: center; text-align: left; padding: 10px 14px; border-radius: var(--radius-lg); } .onboarding-who-option b { font-weight: 600; } .onboarding-who-option small { color: var(--color-ink-tertiary); font-size: var(--type-caption); } -/* BUG-2081 / owner 11-20: chosen = the sidebar row's neutral fill and an ink border, no accent bar. */ -.onboarding-who-option.is-selected, .onboarding-who-option.is-selected:hover { border-color: var(--color-ink); background: var(--color-sidebar-selected); } +/* BUG-2081: the sidebar row's neutral fill, no accent bar. Owner 2026-11-22: same selected look as the birth-time source and ayanamsa options: terracotta edge on the selected fill. */ +.onboarding-who-option.is-selected, .onboarding-who-option.is-selected:hover { border-color: var(--color-action); background: var(--color-sidebar-selected); } .onboarding-who-more { display: grid; gap: var(--space-4); } /* BUG-2144: the first question sits right above the composer, as wide as its column, three equal cards in a row (stacked at 640px and below). */ .starter-questions { display: grid; justify-items: center; gap: 8px; width: min(var(--session-column-width), 100%); margin: 0 auto var(--space-3); } .starter-questions-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; } -.starter-questions-list .starter-question { width: 100%; height: auto; min-height: 56px; padding: 10px 12px; border-radius: var(--radius-lg); background: var(--color-canvas); white-space: normal; align-items: flex-start; justify-content: flex-start; text-align: left; font-size: var(--type-body-sm); font-weight: 400; line-height: 1.45; } +.starter-questions-list .starter-question { width: 100%; height: auto; min-height: 56px; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-lg); background: var(--color-canvas-soft); box-shadow: none; color: var(--color-ink-secondary); white-space: normal; align-items: flex-start; justify-content: flex-start; text-align: left; font-size: var(--type-body-sm); font-weight: 400; line-height: 1.45; } +/* Owner 2026-11-22: no outline on the starter cards; a soft fill, the selected fill on hover. */ +.starter-questions-list .starter-question:hover, .starter-questions-list .starter-question:focus-visible { border-color: transparent; background: var(--color-sidebar-selected); color: var(--color-ink); } @media (max-width: 640px) { .starter-questions-list { grid-template-columns: minmax(0, 1fr); } .starter-questions-list .starter-question { min-height: 44px; } diff --git a/frontend/tests/onboarding-three-screens-2144.test.tsx b/frontend/tests/onboarding-three-screens-2144.test.tsx index 67bab813f..5e76e549e 100644 --- a/frontend/tests/onboarding-three-screens-2144.test.tsx +++ b/frontend/tests/onboarding-three-screens-2144.test.tsx @@ -298,3 +298,42 @@ test("the sky reveal says 「点一下跳过」 in the bottom-right; tap and Esc assert.match(converge, /layer\.addEventListener\("cancel", cancel\);/); assert.match(style, /\.birth-sky-skip \{ position: absolute; right: max\(16px, env\(safe-area-inset-right\)\); bottom: max\(16px, env\(safe-area-inset-bottom\)\);[^}]*pointer-events: none;/); }); + +test("selected states follow the product conventions; starter cards have no outline (owner 2026-11-22)", () => { + const rule = (selector: string) => { + const start = css.indexOf(`${selector} {`); + assert.notEqual(start, -1, selector); + return css.slice(start, css.indexOf("}", start)); + }; + // 原值(首版截图):.onboarding-who-option.is-selected 是 ink 边框 + 选中底色。 + // 新值:赤陶边 + 选中底色,与 .birth-time-source-option.is-selected、.profile-gender-option.is-selected、ayanamsa 选项一致。 + // 原因:负责人 2026-11-22 看截图,选中的「先看我自己」没用产品的高亮。 + // Unselected: the source option's plain edge and canvas (the outline button's dark edge read heavier than the selected one). + assert.match(rule(".onboarding-who-option"), /^\.onboarding-who-option \{ border-color: var\(--color-border\); background: var\(--color-canvas\);/); + const who = rule(".onboarding-who-option.is-selected, .onboarding-who-option.is-selected:hover"); + assert.match(who, /border-color: var\(--color-action\); background: var\(--color-sidebar-selected\);/); + for (const existing of [".birth-time-source-option.is-selected", ".profile-gender-option.is-selected"]) { + assert.match(rule(existing), /border-color: var\(--color-action\);[^}]*background: var\(--color-sidebar-selected\)/); + } + assert.match(rule('.ayanamsa-preference-option[aria-checked="true"]'), /border-color: var\(--color-action\); background: var\(--color-sidebar-selected\);/); + + // 这个时间 / 记得的是 are the existing segmented control; the relation is the shared PersonRelationField. + const fields = read("components/onboarding-birth-time-fields.tsx"); + assert.equal((fields.match(/className="is-segmented is-three"/g) ?? []).length, 2); + assert.match(css, /\.birth-time-uncertainty-list\.is-segmented \.birth-time-uncertainty-option\.is-selected \{ background: var\(--color-canvas\); color: var\(--color-ink\); font-weight: 600; \}/); + assert.match(css, /\.birth-time-uncertainty-list\.is-segmented\.is-three \{ grid-template-columns: repeat\(3, minmax\(0, 1fr\)\); \}/); + assert.match(shellSource, /