Migrate semantic color tokens to 6×4 seeds with pure CSS color-mix() aliases
Replaced static 12-step ramps with primary, info, success, warning, error, and accent state seeds so ConfigProvider overrides cascade automatically.
要在长对话或长文档的边上放一条窄窄的导航、平时几乎不占宽度、悬停或聚焦时才展开时,用 Outline。一直完整显示的「本页目录」请用 Anchor。
Outline 是一个贴边放置的紧凑大纲导航组件,源自长对话与技术工作区中的侧边刻度条:平时只占用一条极窄的短横线刻度(不挤占正文宽度),鼠标移入或键盘聚焦时原位展开浮层卡片,显示每一节或每一轮提问的摘要、时间与预览,点击即可跳转。
既可以像 Anchor 一样通过 targetId + offsetTarget 自动跟随容器滚动,也可以只用 value + onSelect 与 VirtualList 等虚拟滚动列表配合(目标行尚未挂载到 DOM 时同样能跳转)。
每一轮关键发言对应一根刻度线:emphasized 把当前用户自己的提问画得更清晰,meta 展示时间,tooltip 在浮层行旁弹出完整预览。滚动面板时翡翠绿主刻度自动跟进并保持在轨道中央;移入右侧刻度条即可展开卡片跳转。
Migrate semantic color tokens to 6×4 seeds with pure CSS color-mix() aliases
Replaced static 12-step ramps with primary, info, success, warning, error, and accent state seeds so ConfigProvider overrides cascade automatically.
Verify dark mode surface contrast across canvas, card, modal, and raised popovers
Mapped canvas (#101014), card (#18181c), modal (#2c2c32), and raised popover (#48484e) surfaces so floating layers separate cleanly.
Switch dark mode solid primary button text ink to obsidian #101014 for APCA readability
Flipped base ink polarity on Mint #63e2b7 fills while keeping suppl anchors deep for fixed-white Switch thumbs.
Audit Tag and Badge subtle backgrounds so dark surfaces never stack muddy gray fills
Updated bordered tags to use crisp translucent hairlines over transparent ground in dark scopes.
Align ButtonGroup shared borders and split-button dividers with Naive UI behavior
Collapsed resting shared inner edges while keeping hover/focus rings intact, and added a 1px inner separator between adjacent solid buttons.
Check subpixel height consistency on soft secondary and tertiary horizontal ButtonGroups
Switched soft buttons inside groups to border-box background clipping so first, middle, and last buttons share identical height.
Keep only the official VirtualList implementation in docs, routes, and package exports
Removed experimental reference virtual lists and verified zero residual build plugins or native scrollbar regressions.
Ensure ScrollArea inside VirtualList and floating popovers hides native scrollbars everywhere
Passed the repository-wide no-native-scrollbars contract across all component stylesheets.
Extract a generic Outline rail component modeled on Raft's conversation outline strip
Built Outline with a 30px edge tick strip, hover/keyboard floating card, and active tick auto-centering.
Cap the floating card height with ScrollArea when a thread grows past ten turns
Wrapped both the rail and the floating card in ScrollArea with hover-triggered small scrollbars and inset gutters that clear the right-hand ticks.
Constrain Outline row width with PerformantEllipsis truncation and automatic full-text Tooltip
Locked card width to --p-outline-card-width and composed PerformantEllipsis so overlong rows truncate cleanly and reveal full text on hover.
Add keyboard ArrowUp, ArrowDown, Home, End, and Escape focus restoration to Outline
Roving tabIndex keeps a single Tab stop on the active tick, and Escape closes the card while returning focus cleanly.
Rebrand package scope to @pika-lab/react with .p-* classes and --p-* / --pw-* / --pl-* CSS variables
Migrated workspace packages, defaultClsPrefix, token scopes, and bilingual documentation to Pika.
Run full build, type-aware lint, SSR prerender, and unit test suite before opening preview
Verified all prerendered documentation routes and component contract tests pass with zero warnings.
通过 depth 表示章节缩进层级,placement="left" 切换到左侧贴边,或用受控 show 将浮层卡片固定展开。
Semantic state seeds define hue and polarity once at the root scope so overrides cascade without rebuilding ramps.
Light anchors crisp Jade (#18a058) while Dark shifts to Mint (#63e2b7) with dark ink on solid fills.
Deep suppl tokens keep fixed-white Switch thumbs and status badges legible in dark mode.
Terracotta (#c85a32 / #e89574) pairs warm earth tones with Jade without cold violet drift.
Four obsidian Z-elevation tiers separate canvas, card, modal, and floating popovers.
Canvas and sunken code wells sit below card surfaces so layout framing stays quiet.
Dialogs and floating menus step up in lightness instead of relying on heavy drop shadows.
Components consume only semantic alias roles so nested ConfigProvider scopes re-evaluate cleanly.
Local --pl-* slots isolate variant overrides from the public token surface.
Focus halos combine a crisp 1px border shift with a soft translucent outer ring.
Overlay scrollbars use native scroll containers with sticky zero-height gutter layers.
PerformantEllipsis defers DOM truncation measurement until pointer entry or focus.
Outline combines ScrollArea and PerformantEllipsis for dense navigation strips.
不传 targetId 时,Outline 完全由 value、onUpdateValue 和 onSelect 驱动——适合与 VirtualList 搭配,在回调里调用 listRef.current?.scrollTo({ key }) 按数据项定位。
Active ticks stay centered in the compact rail even when a thread grows past hundreds of turns.
| 名称 | 类型 | 默认值 | 说明 | 版本 |
|---|---|---|---|---|
items | readonly OutlineItem[] | 大纲条目列表;为空数组时不渲染。 | 未发布 | |
value | string | null | undefined | 当前激活条目的 key,设置后为受控模式。 | 未发布 |
defaultValue | string | null | null | 非受控模式下的初始激活 key。 | 未发布 |
onUpdateValue | (value: string | null) => void | undefined | 滚动监听或点击切换当前条目时触发。 | 未发布 |
onSelect | (key: string, item: OutlineItem) => void | undefined | 点击刻度或浮层行时触发。 | 未发布 |
placement | 'right' | 'left' | 'right' | 刻度条贴靠的边;浮层卡片向内侧展开。 | 未发布 |
show | boolean | undefined | 控制浮层卡片是否展开。 | 未发布 |
defaultShow | boolean | false | 非受控模式下浮层卡片初始是否展开。 | 未发布 |
onUpdateShow | (show: boolean) => void | undefined | 悬停、键盘聚焦、Escape 或外部点击改变展开状态时触发。 | 未发布 |
closeOnSelect | boolean | false | 点击条目后是否立即收起浮层卡片。 | 未发布 |
maxVisibleItems | number | 10 | 浮层卡片单屏最多展示的行数,超出后在内置 ScrollArea 中滚动。 | 未发布 |
maxRailHeight | number | string | 240 | 紧凑刻度条的最大高度,超出后自动居中滚动当前刻度。 | 未发布 |
bound | number | 24 | 使用 targetId 跟随滚动时,目标距容器顶部多少 px 内视为到达。 | 未发布 |
ignoreGap | boolean | true | 在两个目标之间的空白区保持上一个经过的条目处于激活态。 | 未发布 |
offsetTarget | OutlineOffsetTarget | window | targetId 所在的滚动容器(选择器、元素、ref 或返回元素的函数)。 | 未发布 |
zIndex | number | undefined | 浮层卡片的固定层级;不设时自动排在已有浮层之上。 | 未发布 |
aria-label | string | 语言包 Outline.label | nav 地标名称(中文默认「大纲」)。 | 未发布 |
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
key | string | 唯一标识,对应 value 与 onSelect 的第一个参数。 | |
label | ReactNode | 浮层卡片里的单行标题;字符串标题也会作为紧凑刻度按钮的无障碍名称。 | |
textValue | string | undefined | 当 label 是复杂 JSX 时,为紧凑刻度按钮提供纯文本无障碍名称。 |
meta | ReactNode | undefined | 浮层行尾辅助信息(如时间戳、序号)。 |
tooltip | ReactNode | (() => ReactNode) | undefined | 悬停浮层行时在侧边弹出的详细预览提示。 |
targetId | string | undefined | 滚动容器内对应元素的 id(可带或不带 #)。 |
emphasized | boolean | undefined | 在静止态画更醒目的刻度(例如标出“我发送的消息”或一级大节)。 |
depth | number | 0 | 层级缩进深度(0、1、2…),子级刻度更短、浮层文字自动缩进。 |