@conscience-technology/ovenn 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -4
- package/assets/components/AIMessage/AIMessage.module.css +10 -0
- package/assets/components/AIMessage/AIMessage.tsx +6 -2
- package/assets/components/AttachmentThumb/AttachmentThumb.tsx +1 -0
- package/assets/components/Breadcrumb/Breadcrumb.module.css +82 -23
- package/assets/components/Breadcrumb/Breadcrumb.tsx +44 -26
- package/assets/components/Breadcrumb/index.ts +1 -0
- package/assets/components/Button/Button.module.css +2 -4
- package/assets/components/Callout/Callout.module.css +44 -18
- package/assets/components/Callout/Callout.tsx +9 -4
- package/assets/components/Callout/index.ts +1 -1
- package/assets/components/Canvas/Canvas.module.css +13 -0
- package/assets/components/Canvas/Canvas.tsx +378 -94
- package/assets/components/Canvas/clipboard.ts +5 -1
- package/assets/components/Canvas/collision.ts +5 -1
- package/assets/components/Canvas/graph.ts +14 -5
- package/assets/components/Canvas/history.ts +11 -4
- package/assets/components/Canvas/index.ts +2 -1
- package/assets/components/Canvas/types.ts +36 -1
- package/assets/components/CanvasEdge/tokens.css +14 -1
- package/assets/components/CanvasNode/tokens.css +13 -10
- package/assets/components/ChatComposer/ChatComposer.tsx +1 -1
- package/assets/components/ChatInput/ChatInput.tsx +1 -1
- package/assets/components/ColorField/ColorField.module.css +6 -1
- package/assets/components/ColorPicker/ColorPicker.module.css +3 -0
- package/assets/components/CommandPalette/CommandPalette.module.css +114 -0
- package/assets/components/CommandPalette/CommandPalette.tsx +206 -21
- package/assets/components/CommandPalette/index.ts +1 -0
- package/assets/components/Drawer/Drawer.module.css +30 -0
- package/assets/components/Drawer/Drawer.tsx +75 -16
- package/assets/components/Drawer/index.ts +1 -0
- package/assets/components/FileIcon/FileIcon.tsx +1 -0
- package/assets/components/FileIcon/fileExtMap.ts +1 -0
- package/assets/components/Icon/Icon.tsx +3 -0
- package/assets/components/Input/Input.module.css +3 -3
- package/assets/components/Onboarding/OnboardingAxisPanel.tsx +1 -1
- package/assets/components/Onboarding/OnboardingPage.tsx +13 -11
- package/assets/components/Onboarding/actions.ts +9 -9
- package/assets/components/Select/Select.module.css +1 -1
- package/assets/components/SocialLoginButton/SocialLoginButton.module.css +198 -0
- package/assets/components/SocialLoginButton/SocialLoginButton.tsx +86 -0
- package/assets/components/SocialLoginButton/assets/amazon.svg +1 -0
- package/assets/components/SocialLoginButton/assets/apple.svg +3 -0
- package/assets/components/SocialLoginButton/assets/discord.svg +3 -0
- package/assets/components/SocialLoginButton/assets/facebook-white.png +0 -0
- package/assets/components/SocialLoginButton/assets/facebook.png +0 -0
- package/assets/components/SocialLoginButton/assets/github.svg +3 -0
- package/assets/components/SocialLoginButton/assets/google-mark.png +0 -0
- package/assets/components/SocialLoginButton/assets/kakao.svg +3 -0
- package/assets/components/SocialLoginButton/assets/line-icon.png +0 -0
- package/assets/components/SocialLoginButton/assets/line-white.png +0 -0
- package/assets/components/SocialLoginButton/assets/linkedin-white.png +0 -0
- package/assets/components/SocialLoginButton/assets/linkedin.png +0 -0
- package/assets/components/SocialLoginButton/assets/microsoft.svg +6 -0
- package/assets/components/SocialLoginButton/assets/naver.png +0 -0
- package/assets/components/SocialLoginButton/assets/slack.svg +17 -0
- package/assets/components/SocialLoginButton/assets/spotify.svg +3 -0
- package/assets/components/SocialLoginButton/assets/twitch.svg +21 -0
- package/assets/components/SocialLoginButton/assets/wechat.png +0 -0
- package/assets/components/SocialLoginButton/assets/x.svg +3 -0
- package/assets/components/SocialLoginButton/index.ts +2 -0
- package/assets/components/SocialLoginButton/provider-tokens.css +30 -0
- package/assets/components/SocialLoginButton/providers.ts +23 -0
- package/assets/components/TableRowEdit/TableRowEdit.tsx +2 -2
- package/assets/components/ThemeController.tsx +2 -2
- package/assets/components/TimelineView/TimelineView.tsx +4 -2
- package/assets/components/Tooltip/Tooltip.module.css +1 -0
- package/assets/components/_data.ts +1 -1
- package/assets/components/_utils.css +1 -0
- package/assets/components/component-registry.json +30 -1
- package/assets/components/index.ts +1 -0
- package/assets/components/side-effect-css.d.ts +5 -0
- package/assets/components/themeBootScript.ts +7 -1
- package/assets/components/tokens.css +14 -6
- package/assets/prompts/ASSEMBLY.md +4 -0
- package/assets/prompts/CASCADE.md +2 -2
- package/assets/prompts/CATALOG.md +2 -1
- package/assets/prompts/PRINCIPLES.md +4 -8
- package/assets/prompts/RULES.md +19 -1
- package/assets/prompts/SLOTS.md +2 -4
- package/assets/prompts/WORKFLOW_DESIGN.md +0 -4
- package/assets/prompts/axes/icon.md +1 -1
- package/assets/prompts/axes/material.md +4 -4
- package/assets/prompts/axes/motion.md +1 -1
- package/assets/prompts/axes/shape.md +2 -2
- package/assets/prompts/axes/voice.md +1 -1
- package/assets/prompts/components/_variants.md +4 -4
- package/assets/prompts/components/accordion.md +4 -4
- package/assets/prompts/components/ai-message.md +6 -2
- package/assets/prompts/components/attachment-item.md +2 -2
- package/assets/prompts/components/breadcrumb.md +11 -5
- package/assets/prompts/components/button.md +3 -3
- package/assets/prompts/components/callout.md +8 -4
- package/assets/prompts/components/canvas-edge.md +1 -1
- package/assets/prompts/components/canvas-node.md +1 -1
- package/assets/prompts/components/canvas.md +24 -8
- package/assets/prompts/components/card.md +1 -2
- package/assets/prompts/components/chart-bar.md +1 -1
- package/assets/prompts/components/chat-input.md +1 -1
- package/assets/prompts/components/checkbox.md +5 -5
- package/assets/prompts/components/color-field.md +2 -2
- package/assets/prompts/components/command-palette.md +55 -47
- package/assets/prompts/components/context-menu.md +5 -5
- package/assets/prompts/components/date-picker.md +2 -2
- package/assets/prompts/components/drawer.md +17 -3
- package/assets/prompts/components/dropdown-menu.md +3 -3
- package/assets/prompts/components/event-list-item.md +4 -4
- package/assets/prompts/components/file-icon.md +2 -2
- package/assets/prompts/components/gallery-item.md +1 -1
- package/assets/prompts/components/hint.md +3 -3
- package/assets/prompts/components/kanban.md +2 -3
- package/assets/prompts/components/list-item.md +12 -12
- package/assets/prompts/components/menu-item.md +2 -2
- package/assets/prompts/components/message-table.md +4 -4
- package/assets/prompts/components/onboarding.md +3 -3
- package/assets/prompts/components/page-header.md +6 -7
- package/assets/prompts/components/quotation-bar.md +1 -1
- package/assets/prompts/components/select.md +1 -1
- package/assets/prompts/components/shortcut.md +3 -3
- package/assets/prompts/components/sidebar.md +5 -4
- package/assets/prompts/components/social-login-button.md +117 -0
- package/assets/prompts/components/stepper.md +1 -1
- package/assets/prompts/components/tab-strip.md +2 -2
- package/assets/prompts/components/table-row-edit.md +6 -6
- package/assets/prompts/components/table-row-select.md +1 -1
- package/assets/prompts/components/tabs.md +5 -2
- package/assets/prompts/components/textarea.md +1 -1
- package/assets/prompts/components/toast.md +3 -3
- package/assets/prompts/components/tooltip.md +3 -3
- package/assets/prompts/components/topbar.md +1 -1
- package/assets/prompts/design-examples/ai-chat-full-page.png +0 -0
- package/assets/prompts/design-examples/catalog.json +9 -9
- package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.module.css +37 -1
- package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.tsx +113 -18
- package/assets/prompts/design-examples/sources/ai-chat-full-page/FullPageChat.tsx +2 -2
- package/assets/prompts/design-examples/sources/ai-chat-full-page/REFERENCE.md +3 -1
- package/assets/prompts/design-examples/sources/ai-chat-full-page/useChatDemo.ts +99 -51
- package/assets/prompts/primitives/scroll.md +1 -1
- package/assets/prompts/recipes/README.md +5 -6
- package/assets/prompts/recipes/meta-line.md +2 -2
- package/assets/prompts/recipes/page-header.md +2 -2
- package/assets/prompts/recipes/section-header.md +1 -1
- package/assets/prompts/themes/_SCHEMA.md +2 -2
- package/assets/prompts/tokens/material.md +5 -2
- package/assets/prompts/tokens/radius.md +1 -1
- package/assets/prompts/use-cases/chat-chat-input.md +382 -74
- package/assets/prompts/use-cases/data-list-item.md +38 -431
- package/assets/prompts/use-cases/feedback-drawer.md +112 -33
- package/assets/prompts/use-cases/overlay-command-palette.md +2004 -0
- package/assets/prompts/use-cases/structure-canvas.md +1016 -0
- package/assets/skills/ovenn-validate/SKILL.md +1 -1
- package/assets/skills/ovenn-validate/scripts/lib/component-usage.js +7 -1
- package/assets/skills/ovenn-validate/scripts/lib/engine.mjs +105 -0
- package/assets/skills/ovenn-validate/scripts/lib/engine.test.mjs +46 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-utils.mjs +5 -3
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.mjs +28 -5
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.test.mjs +15 -0
- package/assets/skills/ovenn-validate/scripts/rules/ghost-tokens.mjs +7 -0
- package/assets/skills/ovenn-validate/scripts/rules/hardcoded.mjs +61 -30
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.mjs +7 -4
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.test.mjs +3 -0
- package/assets/skills/ovenn-validate/scripts/validate.mjs +8 -136
- package/assets/skills/ovenn-wireframe/SKILL.md +1 -1
- package/bin/ovenn.js +8 -0
- package/package.json +2 -2
- package/src/commands/check.js +70 -0
- package/src/commands/info.js +32 -7
- package/src/commands/init.js +26 -30
- package/src/commands/setup-checks.js +80 -0
- package/src/commands/update.js +90 -18
- package/src/data/ctds-releases.json +1 -0
- package/src/utils/assets.js +5 -0
- package/src/utils/component-usage.js +7 -1
- package/src/utils/design-workflow.js +6 -2
- package/src/utils/doctor.js +7 -1
- package/src/utils/legacy-ctds.js +169 -0
- package/src/utils/managed-assets.js +16 -3
- package/src/utils/route.js +17 -0
- package/src/utils/rules-context.js +91 -0
- package/src/utils/update-transaction.js +16 -3
- package/assets/prompts/FEEDBACK_PROCESS.md +0 -19
- package/assets/prompts/GUIDE.md +0 -307
- package/assets/prompts/MEMORY.md +0 -202
- package/assets/prompts/TEMPLATE_PREVIEWS.md +0 -21
- package/assets/prompts/components/README.md +0 -84
|
@@ -36,9 +36,9 @@ const [activeId, setActiveId] = useState<string>(openDocs[0].id);
|
|
|
36
36
|
- **활성 색을 `--primary`로 덮지 않는다**: 활성은 `--fg-strong` + `--bg-muted` 무채. 브랜드 컬러는 CTA와 위계가 충돌 ([[components/tabs]]와 동일 원칙).
|
|
37
37
|
- **라벨 가로 폭을 숫자(px)로 고정 금지**: 폰트 축이 바뀌면 깨짐. `ch` 단위 사용.
|
|
38
38
|
- **x 아이콘을 상시 노출하지 말 것**: 시각 노이즈. hover·active에만, 활성 탭은 늘 보이는 게 맞다.
|
|
39
|
-
- **`<svg>` 인라인 금지**: leadingIcon은 Icon·이미지·브랜드 svg는 OK지만 "아이콘용 raw svg"는
|
|
39
|
+
- **`<svg>` 인라인 금지**: leadingIcon은 Icon·이미지·브랜드 svg는 OK지만 "아이콘용 raw svg"는 금지.
|
|
40
40
|
- **trailing에 생짜 `<button>` 넣지 말 것**: Button·IconButton·DropdownMenu 트리거 등 Ovenn 컴포넌트 경유. 자리별 간격·디바이더는 wrapper가 담당하니 소비처는 버튼만 넘김.
|
|
41
|
-
-
|
|
41
|
+
- 탭 사이에 문자 구분자를 넣지 않는다([[RULES]] §3). 탭 자체가 구분된 블록이다.
|
|
42
42
|
|
|
43
43
|
### Fallback
|
|
44
44
|
자리 애매하면 **Topbar 아래 2번째 줄**(shell 2단), size 애매하면 **md** (shell chrome에서도 sm보다 md가 안정적: Topbar와 같은 리듬).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
### 원칙
|
|
4
4
|
Notion·Excel 톤의 **edit 모드** 행. [[components/table-row]]가 "읽는 행"(행 전체 클릭)이라면 이 컴포넌트는 "편집 가능한 셀 그리드": 상호작용 단위가 **행이 아니라 셀**이다. 세로 구분선이 **강제**되는 유일한 Row 타입으로, 사용자가 edit 모드임을 즉시 인지할 수 있게 한다.
|
|
5
5
|
|
|
6
|
-
**외곽은 line, 높이는 md
|
|
6
|
+
**외곽은 line, 기본 높이는 md**: variant 축은 없고 size(sm·md·lg)는 행 최소 높이만 바꾼다. lg는 TableRow와 API를 맞추려 받지만 편집 행에는 권장하지 않는다. pill(plate) 조합은 edit의 정체성(스프레드시트 톤, 세로선 그리드)과 어긋나 지원하지 않는다. 레이아웃·fade mask는 [[components/table-row]]의 CSS를 상속: 헤더와의 폭·정렬 동기화 규칙은 동일. 셀 안쪽 콘텐츠는 [[components/table-cell]] 포맷터 또는 Input/Select/DatePicker 같은 편집 컨트롤을 호출 측에서 `columns[].render(data)`로 꽂아 쓴다.
|
|
7
7
|
|
|
8
8
|
### Do
|
|
9
9
|
- 편집 행 위 헤더는 `TableHeader variant="grid"`로 조합하면 상단 가로선과 여백 없는 세로 경계가 편집 행의 열 경계로 이어진다.
|
|
@@ -22,9 +22,9 @@ Notion·Excel 톤의 **edit 모드** 행. [[components/table-row]]가 "읽는
|
|
|
22
22
|
- 세로 구분선을 끄지 않는다. edit 모드의 **정체성**: 끄면 navigate 모드와 시각 구분이 사라져 사용자가 편집 가능 여부를 인지하지 못함.
|
|
23
23
|
- [HARD] 셀 안에 또 다른 anchor/button을 중첩하지 않는다. 셀 자체가 포커스 타겟(`tabIndex=0`): nested interactive는 접근성·키보드 탐색 파괴.
|
|
24
24
|
- [HARD] `activeCellKey`를 여러 개로 동시에 유지하지 않는다. "지금 편집 중"은 한 번에 하나. 멀티셀 선택이 필요하면 별도 selection state로 분리(미래 기능).
|
|
25
|
-
- hover가 selected/active 셀을 덮지 않는다: 컴포넌트 CSS가
|
|
25
|
+
- hover가 selected/active 셀을 덮지 않는다: 컴포넌트 CSS가 보장.
|
|
26
26
|
- `background`를 직접 지정하지 않는다. selected/active는 축 토큰(`--primary-subtle`)으로 자동.
|
|
27
|
-
-
|
|
27
|
+
- variant를 쓰려 하지 않는다: prop이 없다. 큰 밀도가 필요하면 edit 대신 [[components/table-row]]의 size로 해결.
|
|
28
28
|
|
|
29
29
|
### Fallback
|
|
30
30
|
- 셀 콘텐츠 애매하면 [[components/table-cell]] 중 `TableCellText`. 편집 시만 [[components/input]]으로 교체.
|
|
@@ -36,9 +36,9 @@ Notion·Excel 톤의 **edit 모드** 행. [[components/table-row]]가 "읽는
|
|
|
36
36
|
- [[components/table-header]]: columns·order·widths·selectable 세트 (variant=grid 권장)
|
|
37
37
|
- [[components/table-cell]]: 각 셀 콘텐츠 포맷터
|
|
38
38
|
- [[components/input]], [[components/select]], [[components/date-picker]]: 활성 셀의 편집 컨트롤로 꽂음
|
|
39
|
-
- [[axes/density]]: space-* 토큰을 통해 자동 반영 (
|
|
39
|
+
- [[axes/density]]: space-* 토큰을 통해 자동 반영 (size는 행 최소 높이만 조절)
|
|
40
40
|
- [[tokens/color]]: `--primary-subtle`/`--primary`(active cell), `--border`(세로 구분선), `--hover`(셀 hover), `--fg-disabled`
|
|
41
|
-
-
|
|
41
|
+
- selected/active 위 hover가 상태 톤을 덮지 않음
|
|
42
42
|
|
|
43
43
|
### Props 시그니처
|
|
44
44
|
```tsx
|
|
@@ -52,7 +52,7 @@ type TableRowColumn<T> = TableHeaderColumn & {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
<TableRowEdit<T>
|
|
55
|
-
size="sm | md"
|
|
55
|
+
size="sm | md | lg" // default: md (min-height sm=control-h-md, md=control-h-lg, lg=size-11)
|
|
56
56
|
columns={TableRowColumn<T>[]} // 헤더와 동일 스펙 + render + editable + 생략
|
|
57
57
|
order={string[]} // 헤더와 공유
|
|
58
58
|
widths={Record<string, number>} // 헤더와 공유
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
- **columns는 TableRow와 동일 스펙**: 같은 `TableRowColumn<T>[]`를 Header와 Row 모두에 전달. 폭·정렬·render가 자동 동기화.
|
|
11
11
|
- **체크박스 UI 없음**: 행 자체가 토글 영역: 선택된 상태는 배경 톤으로만 표현. 헤더에도 `selectable=false` (기본).
|
|
12
12
|
- **선택 배경은 `--primary-subtle`**: 기본 hover와 선택이 구분된다. hover가 선택을 덮지 않는다.
|
|
13
|
-
- **hover가 selected를 덮지 않도록**: selected 위에서 hover해도 배경 톤 유지.
|
|
13
|
+
- **hover가 selected를 덮지 않도록**: selected 위에서 hover해도 배경 톤 유지.
|
|
14
14
|
- **키보드 Space로 토글**: Enter는 안 받음: Finder·Explorer도 선택은 Space. 접근성 트리는 `role="row"` + `aria-selected`.
|
|
15
15
|
- **전체 선택/해제는 외부 UI로**: Row 자체엔 "select all" 개념이 없음. 상위 툴바에 버튼으로 두거나 헤더의 `selectable`을 켜고 TableRow(navigate)와 섞어 쓰는 패턴은 지양.
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
variant 애매하면 `underline`, size 애매하면 `md`.
|
|
36
36
|
|
|
37
37
|
### 관련
|
|
38
|
-
- [[components/button]] · [[components/
|
|
38
|
+
- [[components/button]] · [[components/control-group]]: 동일한 `--control-h-*` 사이즈 토큰 공유
|
|
39
39
|
- [[components/chip]]: 여러 개 동시 선택이면 토글 Chip. Tabs는 항상 1개만 활성.
|
|
40
40
|
- [[axes/density]]: `--control-h-*`가 트리거 높이·segmented 컨테이너 높이에 매핑
|
|
41
41
|
- [[axes/shape]]: segmented 컨테이너/트리거 radius가 Shape 축에 반응
|
|
@@ -47,7 +47,7 @@ variant 애매하면 `underline`, size 애매하면 `md`.
|
|
|
47
47
|
<Tabs
|
|
48
48
|
stretch={boolean} // default: false. true면 부모 전체 폭
|
|
49
49
|
variant="underline | segmented | text" // default: underline
|
|
50
|
-
size="xs | sm | md | lg"
|
|
50
|
+
size="xs | sm | md | lg | xl | 2xl | 3xl" // default: md
|
|
51
51
|
orientation="horizontal | vertical" // default: horizontal. vertical은 좌측 탭 + 우측 패널
|
|
52
52
|
value={string} // controlled
|
|
53
53
|
defaultValue={string} // uncontrolled 초기값
|
|
@@ -81,6 +81,9 @@ variant 애매하면 `underline`, size 애매하면 `md`.
|
|
|
81
81
|
| `sm` | control-h-sm | 밀도 높은 대시보드, 사이드 패널 안, 카드 헤더 |
|
|
82
82
|
| `md` | control-h-md | **기본.** 페이지 섹션 탭, 대부분의 스위처 |
|
|
83
83
|
| `lg` | control-h-lg | 랜딩·마케팅 상단, 태블릿·터치 |
|
|
84
|
+
| `xl` | auto (`text-lg`) | 섹션 제목을 탭으로 바꾸는 자리. 컨트롤 높이 대신 글자 크기가 위계를 만든다 |
|
|
85
|
+
| `2xl` | auto (`text-xl`) | 페이지 상단의 큰 제목형 탭 |
|
|
86
|
+
| `3xl` | auto (`text-2xl`) | 랜딩·히어로의 제목형 탭 |
|
|
84
87
|
|
|
85
88
|
### 접근성
|
|
86
89
|
- 루트가 자동으로 `role=tablist` / `role=tab` / `role=tabpanel`과 `aria-selected` / `aria-controls` / `aria-labelledby` 를 붙인다.
|
|
@@ -25,7 +25,7 @@ size 애매하면 `md`, variant 애매하면 `outline`, autoResize 애매하면
|
|
|
25
25
|
|
|
26
26
|
### 관련
|
|
27
27
|
- [[components/input]]: 한 줄 입력, 모든 시각·width·label 규약 공유
|
|
28
|
-
-
|
|
28
|
+
- 입력 부품의 `label`·`description`·`warning` props: label·description·warning 자리
|
|
29
29
|
- [[primitives/scroll]]: 단일 콘텐츠 scroll 룰 (root padding 0 + textarea padding 전담)
|
|
30
30
|
- [[axes/density]]: padding·font-size가 Density에 반응
|
|
31
31
|
- [[axes/shape]]: radius가 Shape 축에 반응
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Toast
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
휘발성 피드백: 사용자 액션의 결과를 짧게 알리고 자동으로 사라진다. 흐름을 끊지 않는다. [[components/callout]]은 상주 안내, [[
|
|
4
|
+
휘발성 피드백: 사용자 액션의 결과를 짧게 알리고 자동으로 사라진다. 흐름을 끊지 않는다. [[components/callout]]은 상주 안내, [[recipes/page-banner]]는 페이지 폭 경고, Toast는 **일회성 결과 신호**.
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- action과 닫기 X는 추가 gap 없이 인접하게 배치하며 클릭 영역은 유지한다.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- Toast 표면색에 tone별 tint 금지: 색은 아이콘·action 버튼에만.
|
|
21
21
|
- action Button 2개 이상 두지 않는다: Toast 폭에서 신호 분산.
|
|
22
22
|
- action variant에 `primary`·`destructive` solid 금지: inverse 표면에서 색 신호가 깨짐.
|
|
23
|
-
- 긴 본문(2줄 초과) 금지: Toast는 1~2줄까지. 그 이상이면 [[components/callout]] 또는 [[
|
|
23
|
+
- 긴 본문(2줄 초과) 금지: Toast는 1~2줄까지. 그 이상이면 [[components/callout]] 또는 [[recipes/page-banner]].
|
|
24
24
|
- [HARD] `placement="top-center"`에 `description` 전달 금지: Viewport가 숨긴다. multiline 신호 필요하면 placement부터 `bottom-right`로.
|
|
25
25
|
- 비동기 로딩 상태(spinner Toast)로 쓰지 않는다: Toast는 완료 신호 전용.
|
|
26
26
|
- 플로팅이지만 `data-side` 기반 `.m-float` 유틸은 쓰지 않는다: Toast는 placement별 slide-in 전용 애니.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
### 관련
|
|
34
34
|
- [[components/callout]]: 상주 안내 카드. Toast는 휘발.
|
|
35
|
-
- [[
|
|
35
|
+
- [[recipes/page-banner]]: 페이지 폭 전역 경고. Toast는 코너 소형.
|
|
36
36
|
- [[components/button]]: `action` 슬롯의 요소.
|
|
37
37
|
- [[axes/motion]]: placement별 slide-in·fade-out 파라미터 스왑.
|
|
38
38
|
- [[tokens/z-index]]: `z-toast` 레이어 (Modal 위, Tooltip 아래).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Tooltip
|
|
2
2
|
|
|
3
3
|
### 원칙
|
|
4
|
-
hover·focus 시 뜨는 **짧은 보조 설명**. Radix Tooltip 위에 얹은 compound. 라벨이 없는 [[components/icon-button]]의 의미 설명, 축약된 단어의 보충, 단축키 힌트에 사용. **클릭 액션은 담지 않는다**: 그건
|
|
4
|
+
hover·focus 시 뜨는 **짧은 보조 설명**. Radix Tooltip 위에 얹은 compound. 라벨이 없는 [[components/icon-button]]의 의미 설명, 축약된 단어의 보충, 단축키 힌트에 사용. **클릭 액션은 담지 않는다**: 그건 Popover(Ovenn 공용 부품 없음, `@radix-ui/react-popover`로 로컬 조합).
|
|
5
5
|
|
|
6
6
|
### Do
|
|
7
7
|
- 라벨이 없는 아이콘 버튼엔 반드시 Tooltip + `aria-label` 둘 다.
|
|
@@ -13,7 +13,7 @@ hover·focus 시 뜨는 **짧은 보조 설명**. Radix Tooltip 위에 얹은 co
|
|
|
13
13
|
|
|
14
14
|
### Don't
|
|
15
15
|
- [HARD] 모바일/터치에서 hover에만 의존하는 힌트는 쓰지 않는다. 중요한 정보는 Label·description으로 제공한다. 클릭 완료 후 잠시 표시하는 결과 피드백은 허용한다.
|
|
16
|
-
- [HARD] 액션 버튼이 담긴 Tooltip 금지:
|
|
16
|
+
- [HARD] 액션 버튼이 담긴 Tooltip 금지: Popover(Ovenn 공용 부품 없음, `@radix-ui/react-popover`로 로컬 조합)로.
|
|
17
17
|
- content에 긴 문단 금지. 설명이 길면 Dialog 또는 Popover.
|
|
18
18
|
- [HARD] hover 시 사라지는 중요 정보 금지: WCAG 2.5.3 (호버 지속성) 위반.
|
|
19
19
|
- 표면 등장·퇴장을 별도 애니메이션으로 재작성하지 않는다. `.m-float`이 전담한다. 액션 결과의 내부 콘텐츠 전환은 아래 표준을 따른다.
|
|
@@ -24,7 +24,7 @@ side 애매하면 `top`, align 애매하면 `center`, delayDuration을 생략하
|
|
|
24
24
|
### 관련
|
|
25
25
|
- [[components/icon-button]]: 가장 흔한 트리거 (aria-label 보충)
|
|
26
26
|
- [[components/shortcut]]: content 안쪽 단축키 힌트
|
|
27
|
-
-
|
|
27
|
+
- Popover(Ovenn 공용 부품 없음, `@radix-ui/react-popover`로 로컬 조합): 액션·입력이 담긴 자리 (Tooltip 대신)
|
|
28
28
|
- [[axes/motion]]: Content in/out은 `.m-float` 유틸
|
|
29
29
|
|
|
30
30
|
### Props 시그니처
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
- zone 밖에 **자식을 바로 넣지 않는다**. `<Topbar><Breadcrumb/>...</Topbar>` 같은 구조 금지: 반드시 Leading/Center/Trailing 중 하나로 감싼다.
|
|
23
23
|
- `h1`·큰 hero head·환영 메시지("good morning")·페이지 섹션 타이틀을 Topbar 안에 넣지 않는다: Topbar는 **얇은 축**이고 큰 타이포가 들어가는 순간 `align-items` 전쟁이 벌어진다. 이걸 로컬 CSS로 때우는 순간(`align-items: flex-start`, `padding-bottom` override 등) Topbar의 "축" 약속이 깨지고, 아래 body와의 수직 리듬도 어긋난다. hero는 body의 첫 섹션으로 꺼낸다.
|
|
24
24
|
- 수직 스택(eyebrow + title 세로 두 줄 같은 조합)을 Topbar 안에 넣지 않는다. 수직 리듬은 body의 섹션 head에서.
|
|
25
|
-
- **[HARD] Topbar 안 identity 트리거(MenuItem avatar preset)에 `description`
|
|
25
|
+
- **[HARD] Topbar 안 identity 트리거(MenuItem avatar preset)에 `description` 금지**: 2줄 모드가 Topbar "얇은 축" 리듬을 깬다. 2줄이 필요하다 느껴지면 자리 자체가 틀림: 콘텐츠 소속감이 필요한 자리면 PageHeader(body 안), 네비게이션 소속감이면 Sidebar.Footer 로 옮긴다.
|
|
26
26
|
- 알림·검색·Breadcrumb 외의 **콘텐츠**(KPI·요약·공지 문구)를 Topbar에 끼우지 않는다. 그건 body hero 섹션 또는 Callout의 자리.
|
|
27
27
|
- Topbar에 로컬 `padding`·`align-items`를 override해서 "큰 요소 끼운 걸 수습"하지 않는다: 수습이 필요한 순간 그 요소가 Topbar의 자리가 아니라는 신호.
|
|
28
28
|
- 자체 bg/border/shadow 추가 금지: AppFrame variant가 쥐고 있는 자리.
|
|
Binary file
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"adaptation": "대상 제품의 AI API·영구 저장·권한·첨부 처리를 연결한다. 카드 분기는 별도 사용사례이므로 풀페이지와 구별한다. 대화 간격과 셸 폭은 대상 업무 밀도에 맞춰 조정하고 실제 상태를 검증한다.",
|
|
59
59
|
"limitations": [
|
|
60
60
|
"실제 AI API·인증·영구 저장은 연결하지 않았다. 새로고침하면 대화가 초기화된다.",
|
|
61
|
-
"
|
|
62
|
-
"모든 테마·실제 모바일
|
|
61
|
+
"첨부는 브라우저 안에서만 표시하며 파일 내용을 분석하지 않는다.",
|
|
62
|
+
"모든 테마·실제 모바일 키보드·스크린리더는 검증하지 않았다.",
|
|
63
63
|
"대표 캡처는 1440×900 라이트 모드의 한 쓰레드 대화 상태다."
|
|
64
64
|
],
|
|
65
65
|
"coverage": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"status": "implemented",
|
|
68
68
|
"details": [
|
|
69
69
|
"새 대화·검색·쓰레드 전환·이름 변경·삭제를 로컬 상태에 연결한다.",
|
|
70
|
-
"
|
|
70
|
+
"메시지와 첨부 전송·응답 스트리밍·중지·메시지 편집과 재생성을 제공한다. /fail로 실패와 재시도를 재현할 수 있다. 개별 검증 범위는 참고 문서의 한계를 따른다."
|
|
71
71
|
],
|
|
72
72
|
"evidence": [
|
|
73
73
|
"sources/ai-chat-full-page/REFERENCE.md"
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"preview": "ai-chat-full-page.png",
|
|
88
|
-
"previewCapturedAt": "2026-11-
|
|
88
|
+
"previewCapturedAt": "2026-11-13",
|
|
89
89
|
"files": [
|
|
90
90
|
{
|
|
91
91
|
"path": "FullPageChat.tsx",
|
|
@@ -113,12 +113,12 @@
|
|
|
113
113
|
}
|
|
114
114
|
],
|
|
115
115
|
"previewSourceDigests": {
|
|
116
|
-
"FullPageChat.tsx": "
|
|
117
|
-
"ChatExperience.tsx": "
|
|
118
|
-
"ChatExperience.module.css": "
|
|
119
|
-
"useChatDemo.ts": "
|
|
116
|
+
"FullPageChat.tsx": "86b1b6addfa1f4b8cf6f6c052c396915e11a6f77255a2919b6f30e4ed01235b6",
|
|
117
|
+
"ChatExperience.tsx": "0c8624e6a033aee012ff4af77287bda526579bd23760bee9b8675b364840ebdc",
|
|
118
|
+
"ChatExperience.module.css": "f3c922b047d4964b9d3b45bf5b7576ddb1b424bb3580ae41740c7a1aea60b84a",
|
|
119
|
+
"useChatDemo.ts": "8a9085db3efbc6a19b4bf514048174905d39aa6fd5531e0a5c8d3a83ab20ba17",
|
|
120
120
|
"useDemoTextStream.ts": "72dc072b80252d5eec581e0a4ba8c1c9a045f246ba1b41d0e83308981fb96cf3",
|
|
121
|
-
"REFERENCE.md": "
|
|
121
|
+
"REFERENCE.md": "2e4a41717f07c30a2e55ca3fb83e044a74bc4c5c601f27b4181dc393e9cdecc2"
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
]
|
|
@@ -82,6 +82,33 @@
|
|
|
82
82
|
overflow-wrap: anywhere;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
.sentAttachments {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-wrap: wrap;
|
|
88
|
+
justify-content: flex-end;
|
|
89
|
+
gap: var(--space-2);
|
|
90
|
+
min-width: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.sentAttachments > * {
|
|
94
|
+
max-width: 100%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.attachmentOnly > [data-user-message-body] {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.composer [data-slot="chat-input-attachments"] {
|
|
102
|
+
max-block-size: var(--size-24);
|
|
103
|
+
overflow: auto;
|
|
104
|
+
overscroll-behavior: contain;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.composer [data-slot="chat-input-attachments"] > *,
|
|
108
|
+
.composer [data-slot="chat-input-attachments"] > * > * {
|
|
109
|
+
max-inline-size: 100%;
|
|
110
|
+
}
|
|
111
|
+
|
|
85
112
|
.assistant.assistant [data-ai-message-body] {
|
|
86
113
|
font-size: var(--text-base);
|
|
87
114
|
line-height: var(--lh-base);
|
|
@@ -221,13 +248,22 @@
|
|
|
221
248
|
|
|
222
249
|
.fullPage .bottom {
|
|
223
250
|
width: 100%;
|
|
251
|
+
gap: var(--space-2);
|
|
224
252
|
max-width: var(--chat-page-width);
|
|
225
253
|
margin-inline: auto;
|
|
226
254
|
padding-bottom: max(var(--space-6), env(safe-area-inset-bottom));
|
|
227
255
|
}
|
|
228
256
|
|
|
257
|
+
.tokenNotice {
|
|
258
|
+
margin-inline: var(--chat-content-inset);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.tokenNoticeIcon {
|
|
262
|
+
color: var(--warning);
|
|
263
|
+
}
|
|
264
|
+
|
|
229
265
|
.fullPage .composer.composer {
|
|
230
|
-
--chat-input-padding-y: var(--space-
|
|
266
|
+
--chat-input-padding-y: var(--space-3);
|
|
231
267
|
}
|
|
232
268
|
|
|
233
269
|
|
|
@@ -8,7 +8,10 @@ import { IconButton } from "@/components/ovenn/IconButton";
|
|
|
8
8
|
import { Modal } from "@/components/ovenn/Modal";
|
|
9
9
|
import { UserMessage } from "@/components/ovenn/UserMessage";
|
|
10
10
|
import { AIMessage } from "@/components/ovenn/AIMessage";
|
|
11
|
-
import {
|
|
11
|
+
import { AttachmentItem } from "@/components/ovenn/AttachmentItem";
|
|
12
|
+
import { AttachmentThumb } from "@/components/ovenn/AttachmentThumb";
|
|
13
|
+
import { Callout } from "@/components/ovenn/Callout";
|
|
14
|
+
import { useChatDemo, type ChatDemoMessage } from "./useChatDemo";
|
|
12
15
|
import { Card } from "@/components/ovenn/Card";
|
|
13
16
|
import { AppFrame } from "@/components/ovenn/AppFrame";
|
|
14
17
|
import { Topbar } from "@/components/ovenn/Topbar";
|
|
@@ -31,6 +34,26 @@ const content = {
|
|
|
31
34
|
switchThread: "Switch thread",
|
|
32
35
|
createThread: "New chat",
|
|
33
36
|
messagesLabel: "Conversation",
|
|
37
|
+
composerLabel: "Write a message",
|
|
38
|
+
tokenWarning: "You’ve used 90% of your token limit.",
|
|
39
|
+
viewUsage: "View usage",
|
|
40
|
+
hideUsage: "Hide usage",
|
|
41
|
+
usage: "Example budget: 9,000 of 10,000 tokens used. 1,000 left.",
|
|
42
|
+
sample: [
|
|
43
|
+
"Can you organize the launch meeting notes?",
|
|
44
|
+
"Send the notes and I’ll separate the decisions, owners, and open questions.",
|
|
45
|
+
"The release is next Thursday. Design will finish the empty screens on Monday. Engineering needs the final copy by Tuesday. Support wants a checklist for common questions.",
|
|
46
|
+
"Decision: release next Thursday.\n\nDesign: finish empty screens on Monday.\nEngineering: confirm final copy on Tuesday.\nSupport: draft a checklist for common questions.\n\nThe checklist still needs an owner and a due date.",
|
|
47
|
+
"What should we cover in the review?",
|
|
48
|
+
"Open the empty screens with a fresh account and check that each screen explains the next step. Read the copy alongside the screens so the team can spot inconsistencies.\n\nWalk through one support question from start to finish. Bring unresolved issues to the review with the person who can decide what to do next.",
|
|
49
|
+
"Jin owns the checklist. Add a short review on Wednesday and write a message I can send to the team.",
|
|
50
|
+
"We’re planning to release next Thursday. Design will finish the empty screens on Monday, and Engineering needs the final copy by Tuesday.\n\nJin will prepare the support checklist. We’ll review the copy, empty screens, and checklist together on Wednesday.\n\nPlease flag anything that could move the release date before the review.",
|
|
51
|
+
],
|
|
52
|
+
failed: "Couldn’t generate a response.",
|
|
53
|
+
stopped: "Response stopped.",
|
|
54
|
+
retry: "Try again",
|
|
55
|
+
attachmentReply: "I received your attachments. Paste the part you want to work on and tell me what you need.",
|
|
56
|
+
retryReply: "The demo response is working again. Tell me what you’d like help with.",
|
|
34
57
|
threadTitles: ["Meeting notes", "Follow-up email", "Document summary"],
|
|
35
58
|
replies: [
|
|
36
59
|
"Share your meeting notes and I’ll organize them into decisions and action items.\n\nFor each action, include the task, owner, and due date when available.",
|
|
@@ -54,6 +77,26 @@ const content = {
|
|
|
54
77
|
switchThread: "대화 전환",
|
|
55
78
|
createThread: "새 대화",
|
|
56
79
|
messagesLabel: "대화 내용",
|
|
80
|
+
composerLabel: "메시지 작성",
|
|
81
|
+
tokenWarning: "토큰 한도의 90%를 사용했어요.",
|
|
82
|
+
viewUsage: "사용량 보기",
|
|
83
|
+
hideUsage: "사용량 닫기",
|
|
84
|
+
usage: "예시 사용량은 10,000 토큰 중 9,000개예요. 1,000개 남았어요.",
|
|
85
|
+
sample: [
|
|
86
|
+
"출시 회의 메모를 정리해 주세요.",
|
|
87
|
+
"메모를 보내주시면 결정 사항과 담당자, 아직 확인할 내용을 나눠 정리할게요.",
|
|
88
|
+
"다음 주 목요일에 출시해요. 디자인은 월요일까지 빈 화면을 마무리하고, 개발은 화요일까지 최종 문구가 필요해요. 고객지원팀은 자주 묻는 질문을 체크리스트로 정리하기로 했어요.",
|
|
89
|
+
"다음 주 목요일에 출시하기로 했어요.\n\n디자인팀은 월요일까지 빈 화면을 마무리해요.\n개발팀은 화요일까지 최종 문구를 확인해요.\n고객지원팀은 자주 묻는 질문을 정리해요.\n\n체크리스트 담당자와 마감일을 정하면 돼요.",
|
|
90
|
+
"검토할 때는 뭘 보면 좋을까요?",
|
|
91
|
+
"새 계정으로 빈 화면을 열고, 다음에 할 일이 분명한지 확인해요. 화면에 들어갈 문구도 같이 읽으면서 용어가 일관적인지 살펴보면 좋아요.\n\n고객 문의 하나를 골라 체크리스트를 처음부터 따라가 보세요. 결정이 필요한 항목은 담당자와 함께 수요일 검토에 가져오면 돼요.",
|
|
92
|
+
"체크리스트는 진이 맡기로 했어요. 수요일에 같이 검토하기로 한 내용도 넣어서 팀에 보낼 메시지를 써 주세요.",
|
|
93
|
+
"다음 주 목요일에 출시할 예정이에요. 디자인팀은 월요일까지 빈 화면을 마무리하고, 개발팀은 화요일까지 최종 문구를 확인해 주세요.\n\n진은 고객지원 체크리스트를 준비해 주세요. 수요일에는 문구, 빈 화면, 체크리스트를 함께 검토할게요.\n\n출시 일정에 영향을 줄 일이 있으면 수요일 검토 전에 알려주세요.",
|
|
94
|
+
],
|
|
95
|
+
failed: "응답을 생성하지 못했어요.",
|
|
96
|
+
stopped: "응답 생성을 중지했어요.",
|
|
97
|
+
retry: "다시 시도",
|
|
98
|
+
attachmentReply: "첨부를 받았어요. 작업할 내용을 붙여 넣고 어떤 도움이 필요한지 알려주세요.",
|
|
99
|
+
retryReply: "데모 응답이 다시 작동해요. 어떤 일이 필요한지 알려주세요.",
|
|
57
100
|
threadTitles: ["회의 메모 정리", "후속 메일 초안", "문서 요약"],
|
|
58
101
|
replies: [
|
|
59
102
|
"정리할 회의 메모를 보내주세요. 결정 사항과 실행 항목을 구분해 정리할게요.\n\n실행 항목마다 할 일, 담당자, 기한이 있다면 함께 알려주세요.",
|
|
@@ -69,7 +112,7 @@ const content = {
|
|
|
69
112
|
},
|
|
70
113
|
};
|
|
71
114
|
|
|
72
|
-
export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "ko"; presentation?: "card" | "page" }) {
|
|
115
|
+
export function ChatExperience({ lang, presentation = "card", material }: { lang: "en" | "ko"; presentation?: "card" | "page"; material?: "glass" | "solid" }) {
|
|
73
116
|
const isPage = presentation === "page";
|
|
74
117
|
const t = content[lang];
|
|
75
118
|
const [threadMenuOpen, setThreadMenuOpen] = useState(false);
|
|
@@ -97,9 +140,19 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
97
140
|
focusConversation.current = false;
|
|
98
141
|
}
|
|
99
142
|
}, [isMobile, mobileView]);
|
|
100
|
-
const getReply = (text: string
|
|
143
|
+
const getReply = (text: string, hasAttachments: boolean) => {
|
|
144
|
+
if (text === "/fail") return t.retryReply;
|
|
145
|
+
if (hasAttachments) return t.attachmentReply;
|
|
146
|
+
return t.replies[t.questions.indexOf(text)] ?? t.fallbackReply;
|
|
147
|
+
};
|
|
101
148
|
const getTitle = (text: string) => t.threadTitles[t.questions.indexOf(text)] ?? Array.from(text).slice(0, 18).join("");
|
|
102
|
-
const
|
|
149
|
+
const initialMessages = useRef<ChatDemoMessage[]>(isPage ? t.sample.map((text, index) => ({
|
|
150
|
+
id: `sample-${index}`, role: index % 2 === 0 ? "user" : "assistant", text,
|
|
151
|
+
})) : []);
|
|
152
|
+
const { threads, activeThread, setActiveId, createThread, renameThread, deleteThread, setDraft, attach, removeAttachment, send, stop, edit, regenerate, retry, isStreaming } = useChatDemo(getReply, getTitle, initialMessages.current);
|
|
153
|
+
const [noticeDismissed, setNoticeDismissed] = useState(false);
|
|
154
|
+
const showNotice = isPage && activeThread.id === "chat-0" && !noticeDismissed;
|
|
155
|
+
const [showUsage, setShowUsage] = useState(false);
|
|
103
156
|
const viewportRef = useRef<HTMLDivElement>(null);
|
|
104
157
|
const pageRef = useRef<HTMLDivElement>(null);
|
|
105
158
|
useLayoutEffect(() => {
|
|
@@ -147,18 +200,18 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
147
200
|
composerRef.current?.querySelector("textarea")?.focus({ preventScroll: true });
|
|
148
201
|
focusAfterSend.current = false;
|
|
149
202
|
}
|
|
150
|
-
}, [activeThread.id, activeThread.messages, isPage, isMobile, mobileView]);
|
|
203
|
+
}, [activeThread.id, activeThread.messages, activeThread.attachments, isPage, isMobile, mobileView]);
|
|
151
204
|
|
|
152
205
|
const saveScroll = () => {
|
|
153
206
|
newMessageIds.current.clear();
|
|
154
207
|
if (viewportRef.current && !(isPage && isMobile && mobileView === "threads")) scrollPositions.current.set(activeThread.id, viewportRef.current.scrollTop);
|
|
155
208
|
};
|
|
156
|
-
const sendPrompt = (text: string, focusInput = true) => {
|
|
157
|
-
if (!text.trim() || isStreaming) return;
|
|
209
|
+
const sendPrompt = (text: string, focusInput = true, useDraft = true) => {
|
|
210
|
+
if ((!text.trim() && !(useDraft && activeThread.attachments.length)) || isStreaming) return;
|
|
158
211
|
followLatest.current = true;
|
|
159
212
|
focusAfterSend.current = focusInput;
|
|
160
213
|
newMessageIds.current.add(`${activeThread.id}-${activeThread.messages.length}-user`);
|
|
161
|
-
send(text);
|
|
214
|
+
send(text, useDraft);
|
|
162
215
|
};
|
|
163
216
|
|
|
164
217
|
const toggleHistory = () => {
|
|
@@ -173,8 +226,13 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
173
226
|
setMobileView("chat");
|
|
174
227
|
};
|
|
175
228
|
const normalizedSearch = threadSearch.trim().toLocaleLowerCase();
|
|
176
|
-
const historyThreads = [...threads].reverse().filter((thread) => thread.title || thread.messages.length
|
|
177
|
-
const
|
|
229
|
+
const historyThreads = [...threads].reverse().filter((thread) => thread.title || thread.messages.length || thread.draft.trim() || thread.attachments.length);
|
|
230
|
+
const attachmentName = (item: (typeof activeThread.attachments)[number]) => item.kind === "file" ? item.filename : item.alt;
|
|
231
|
+
const threadLabel = (thread: typeof activeThread) => thread.title || getTitle(thread.draft.trim() || thread.attachments.map(attachmentName).find(Boolean) || t.title);
|
|
232
|
+
const visibleThreads = historyThreads.filter((thread) => [
|
|
233
|
+
thread.title, thread.draft, ...thread.attachments.map(attachmentName),
|
|
234
|
+
...thread.messages.flatMap((message) => [message.text, ...(message.attachments ?? []).map(attachmentName)]),
|
|
235
|
+
].join(" ").toLocaleLowerCase().includes(normalizedSearch));
|
|
178
236
|
|
|
179
237
|
const header = (
|
|
180
238
|
<div className={styles.header}>
|
|
@@ -197,18 +255,16 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
197
255
|
>
|
|
198
256
|
{t.createThread}
|
|
199
257
|
</DropdownMenu.Item>
|
|
200
|
-
{
|
|
258
|
+
{historyThreads.length > 0 && (
|
|
201
259
|
<>
|
|
202
260
|
<DropdownMenu.Separator />
|
|
203
261
|
<DropdownMenu.Group>
|
|
204
|
-
{
|
|
205
|
-
.filter((thread) => thread.messages.length > 0 || thread.draft.trim())
|
|
206
|
-
.map((thread) => (
|
|
262
|
+
{historyThreads.map((thread) => (
|
|
207
263
|
<DropdownMenu.Item
|
|
208
264
|
key={thread.id}
|
|
209
265
|
onSelect={() => { saveScroll(); setActiveId(thread.id); setThreadMenuOpen(false); }}
|
|
210
266
|
>
|
|
211
|
-
{
|
|
267
|
+
{threadLabel(thread)}
|
|
212
268
|
</DropdownMenu.Item>
|
|
213
269
|
))}
|
|
214
270
|
</DropdownMenu.Group>
|
|
@@ -236,9 +292,28 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
236
292
|
<div className={styles.messages} role="log" aria-live="polite" aria-relevant="additions text" aria-label={t.messagesLabel}>
|
|
237
293
|
{activeThread.messages.map((message) => message.role === "user" ? (
|
|
238
294
|
<UserMessage key={message.id} actionsVisibility="hover" textValue={message.text}
|
|
295
|
+
actions={message.text ? undefined : []}
|
|
296
|
+
className={message.text ? undefined : styles.attachmentOnly}
|
|
297
|
+
before={message.attachments?.length ? (
|
|
298
|
+
<div className={styles.sentAttachments}>
|
|
299
|
+
{message.attachments.map((item) => item.kind === "file" ? (
|
|
300
|
+
<AttachmentItem key={item.id} filename={item.filename} />
|
|
301
|
+
) : (
|
|
302
|
+
<AttachmentThumb key={item.id} src={item.src} alt={item.alt} size="lg" />
|
|
303
|
+
))}
|
|
304
|
+
</div>
|
|
305
|
+
) : undefined}
|
|
239
306
|
onEdit={(text) => edit(message.id, text)} animate={newMessageIds.current.has(message.id)}>
|
|
240
307
|
<span className={styles.messageText}>{message.text}</span>
|
|
241
308
|
</UserMessage>
|
|
309
|
+
) : message.interruption ? (
|
|
310
|
+
<Callout key={message.id} layout="inline"
|
|
311
|
+
tone={message.interruption === "failed" ? "destructive" : "neutral"}
|
|
312
|
+
title={t[message.interruption]}
|
|
313
|
+
actions={<Button size="sm" variant="ghost" disabled={isStreaming} onClick={() => {
|
|
314
|
+
viewportRef.current?.focus({ preventScroll: true });
|
|
315
|
+
retry(message.id);
|
|
316
|
+
}}>{t.retry}</Button>} />
|
|
242
317
|
) : (
|
|
243
318
|
<AIMessage key={message.id} actionsVisibility="hover" actions={[
|
|
244
319
|
{ kind: "copy", onClick: () => navigator.clipboard.writeText(message.text), successLabel: lang === "ko" ? "복사됨" : "Copied", errorLabel: lang === "ko" ? "복사 실패" : "Copy failed" },
|
|
@@ -258,13 +333,29 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
258
333
|
);
|
|
259
334
|
const bottom = (
|
|
260
335
|
<div className={styles.bottom}>
|
|
336
|
+
{showNotice && (
|
|
337
|
+
<Callout layout="inline" size="sm" variant="fill" tone="neutral"
|
|
338
|
+
icon={<Icon name="warning-circle" className={styles.tokenNoticeIcon} />} title={t.tokenWarning} className={styles.tokenNotice}
|
|
339
|
+
dismissible
|
|
340
|
+
dismissLabel={lang === "ko" ? "토큰 경고 닫기" : "Dismiss token warning"}
|
|
341
|
+
onDismiss={() => {
|
|
342
|
+
composerRef.current?.querySelector("textarea")?.focus({ preventScroll: true });
|
|
343
|
+
setNoticeDismissed(true);
|
|
344
|
+
}}
|
|
345
|
+
actions={<Button size="xs" variant="ghost" aria-expanded={showUsage} aria-controls="page-token-usage"
|
|
346
|
+
onClick={() => setShowUsage((open) => !open)}>
|
|
347
|
+
{showUsage ? t.hideUsage : t.viewUsage}
|
|
348
|
+
</Button>}>
|
|
349
|
+
<span id="page-token-usage" hidden={!showUsage}><br />{t.usage}</span>
|
|
350
|
+
</Callout>
|
|
351
|
+
)}
|
|
261
352
|
{!isPage && !hasMessages && (
|
|
262
353
|
<div className={styles.questions} role="group" aria-label={t.suggestionsLabel}>
|
|
263
354
|
{t.questions.map((question) => (
|
|
264
355
|
<RadioCard
|
|
265
356
|
key={question}
|
|
266
357
|
mode="button"
|
|
267
|
-
onClick={(event) => sendPrompt(question, event.detail === 0)}
|
|
358
|
+
onClick={(event) => sendPrompt(question, event.detail === 0, false)}
|
|
268
359
|
onFocus={(event) => event.currentTarget.scrollIntoView({ block: "nearest", inline: "nearest" })}
|
|
269
360
|
align="start"
|
|
270
361
|
size="md"
|
|
@@ -281,18 +372,22 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
281
372
|
separateSend={!isPage}
|
|
282
373
|
value={activeThread.draft}
|
|
283
374
|
onChange={setDraft}
|
|
375
|
+
attachments={activeThread.attachments}
|
|
376
|
+
onAttach={attach}
|
|
377
|
+
onRemoveAttachment={removeAttachment}
|
|
284
378
|
onSend={() => sendPrompt(activeThread.draft)}
|
|
285
379
|
isStreaming={isStreaming}
|
|
286
380
|
onStop={stop}
|
|
287
381
|
sendVariant="solid"
|
|
288
382
|
placeholder={t.placeholder}
|
|
383
|
+
inputProps={{ "aria-label": t.composerLabel }}
|
|
289
384
|
className={styles.composer}
|
|
290
385
|
/>
|
|
291
386
|
</div>
|
|
292
387
|
);
|
|
293
388
|
|
|
294
389
|
if (isPage) return (
|
|
295
|
-
<AppFrame ref={pageRef} variant="flat" layout="sidebar-first" className={styles.fullPage} data-ai-chat-page data-chat-thread={activeThread.id} data-mobile-view={mobileView} lang={lang}>
|
|
390
|
+
<AppFrame ref={pageRef} variant="flat" layout="sidebar-first" className={styles.fullPage} data-ai-chat-page data-chat-thread={activeThread.id} data-mobile-view={mobileView} data-material={material} lang={lang}>
|
|
296
391
|
<AppFrame.Topbar>
|
|
297
392
|
<Topbar size="sm">
|
|
298
393
|
<Topbar.Leading className={styles.threadHeading}>
|
|
@@ -354,7 +449,7 @@ export function ChatExperience({ lang, presentation = "card" }: { lang: "en" | "
|
|
|
354
449
|
setActiveId(thread.id);
|
|
355
450
|
focusConversation.current = isMobile;
|
|
356
451
|
setMobileView("chat");
|
|
357
|
-
}}>{
|
|
452
|
+
}}>{threadLabel(thread)}</MenuItem>
|
|
358
453
|
))}
|
|
359
454
|
</MenuItem.Section>
|
|
360
455
|
{visibleThreads.length === 0 && <EmptyState className={styles.historyEmpty} size="sm" icon={normalizedSearch ? "search" : "chat-circle"} title={normalizedSearch ? t.noResults : t.noChats} role="status" />}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
import { ThemeLocaleProvider } from "@/components/ovenn/ThemeController";
|
|
4
4
|
import { ChatExperience } from "./ChatExperience";
|
|
5
5
|
|
|
6
|
-
export function FullPageChat({ lang = "ko" }: { lang?: "ko" | "en" }) {
|
|
7
|
-
return <ThemeLocaleProvider lang={lang}><ChatExperience lang={lang} presentation="page" /></ThemeLocaleProvider>;
|
|
6
|
+
export function FullPageChat({ lang = "ko", material }: { lang?: "ko" | "en"; material?: "glass" | "solid" }) {
|
|
7
|
+
return <ThemeLocaleProvider lang={lang}><ChatExperience lang={lang} presentation="page" material={material} /></ThemeLocaleProvider>;
|
|
8
8
|
}
|
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
- 본문만 스크롤하고 하단 ChatInput을 유지하는 구성. 풀페이지에는 인사말·추천 질문을 넣지 않는다.
|
|
11
11
|
- 모바일에서는 제목의 caret으로 쓰레드 목록과 대화 화면을 전환한다. Drawer를 사용하지 않는다.
|
|
12
12
|
|
|
13
|
+
- 첫 스레드는 예시 대화와 토큰 잔량 경고를 보여준다. 경고는 메시지 영역과 입력창 사이에 배치한다. `sm` 크기의 중립 `fill` Callout으로 예시 사용량 90%를 표시한다.
|
|
14
|
+
|
|
13
15
|
## 소스와 의존성
|
|
14
16
|
|
|
15
17
|
catalog.json의 files.source가 저장소 원본이다. FullPageChat → ChatExperience → useChatDemo → useDemoTextStream 순으로 연결된다. 공유 Ovenn 컴포넌트와 tokens.css는 별도 의존성이며, 참고 코드를 복사할 때 현재 설치 API와 테마를 확인한다. ChatExperience의 카드 분기는 공용 소스에 포함되지만 이 승인 사례의 주 범위는 풀페이지다.
|
|
16
18
|
|
|
17
19
|
## 확인 한계
|
|
18
20
|
|
|
19
|
-
응답은 로컬 시나리오이며 실제 AI API·저장소·인증에 연결되어 있지 않다. 새로고침하면 대화가 초기화된다.
|
|
21
|
+
응답은 로컬 시나리오이며 실제 AI API·저장소·인증에 연결되어 있지 않다. 새로고침하면 대화가 초기화된다. 파일과 이미지 첨부는 브라우저 안에서만 표시하며 파일 내용을 분석하지 않는다. `/fail`을 보내면 실패와 재시도를 확인할 수 있다. 이름 변경·삭제·검색·모바일 전환은 구현되어 있으나 이 등록이 모든 동작·테마·보조기술 검증을 뜻하지 않는다. 대표 캡처는 1440×900 라이트 모드의 한 쓰레드 대화 상태다.
|