@conscience-technology/ovenn 0.7.4 → 0.7.5

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.
Files changed (90) hide show
  1. package/assets/components/AIMessage/AIMessage.module.css +10 -0
  2. package/assets/components/AIMessage/AIMessage.tsx +6 -2
  3. package/assets/components/Breadcrumb/Breadcrumb.module.css +82 -23
  4. package/assets/components/Breadcrumb/Breadcrumb.tsx +44 -26
  5. package/assets/components/Breadcrumb/index.ts +1 -0
  6. package/assets/components/Button/Button.module.css +2 -4
  7. package/assets/components/Callout/Callout.module.css +44 -18
  8. package/assets/components/Callout/Callout.tsx +9 -4
  9. package/assets/components/Callout/index.ts +1 -1
  10. package/assets/components/Canvas/Canvas.module.css +13 -0
  11. package/assets/components/Canvas/Canvas.tsx +378 -94
  12. package/assets/components/Canvas/clipboard.ts +5 -1
  13. package/assets/components/Canvas/collision.ts +5 -1
  14. package/assets/components/Canvas/graph.ts +14 -5
  15. package/assets/components/Canvas/history.ts +11 -4
  16. package/assets/components/Canvas/index.ts +2 -1
  17. package/assets/components/Canvas/types.ts +36 -1
  18. package/assets/components/CanvasEdge/tokens.css +14 -1
  19. package/assets/components/CanvasNode/tokens.css +13 -10
  20. package/assets/components/ChatInput/ChatInput.tsx +1 -1
  21. package/assets/components/ColorField/ColorField.module.css +6 -1
  22. package/assets/components/ColorPicker/ColorPicker.module.css +3 -0
  23. package/assets/components/CommandPalette/CommandPalette.module.css +114 -0
  24. package/assets/components/CommandPalette/CommandPalette.tsx +206 -21
  25. package/assets/components/CommandPalette/index.ts +1 -0
  26. package/assets/components/Drawer/Drawer.module.css +30 -0
  27. package/assets/components/Drawer/Drawer.tsx +75 -16
  28. package/assets/components/Drawer/index.ts +1 -0
  29. package/assets/components/Icon/Icon.tsx +3 -0
  30. package/assets/components/Input/Input.module.css +3 -3
  31. package/assets/components/Select/Select.module.css +1 -1
  32. package/assets/components/SocialLoginButton/SocialLoginButton.module.css +198 -0
  33. package/assets/components/SocialLoginButton/SocialLoginButton.tsx +86 -0
  34. package/assets/components/SocialLoginButton/assets/amazon.svg +1 -0
  35. package/assets/components/SocialLoginButton/assets/apple.svg +3 -0
  36. package/assets/components/SocialLoginButton/assets/discord.svg +3 -0
  37. package/assets/components/SocialLoginButton/assets/facebook-white.png +0 -0
  38. package/assets/components/SocialLoginButton/assets/facebook.png +0 -0
  39. package/assets/components/SocialLoginButton/assets/github.svg +3 -0
  40. package/assets/components/SocialLoginButton/assets/google-mark.png +0 -0
  41. package/assets/components/SocialLoginButton/assets/kakao.svg +3 -0
  42. package/assets/components/SocialLoginButton/assets/line-icon.png +0 -0
  43. package/assets/components/SocialLoginButton/assets/line-white.png +0 -0
  44. package/assets/components/SocialLoginButton/assets/linkedin-white.png +0 -0
  45. package/assets/components/SocialLoginButton/assets/linkedin.png +0 -0
  46. package/assets/components/SocialLoginButton/assets/microsoft.svg +6 -0
  47. package/assets/components/SocialLoginButton/assets/naver.png +0 -0
  48. package/assets/components/SocialLoginButton/assets/slack.svg +17 -0
  49. package/assets/components/SocialLoginButton/assets/spotify.svg +3 -0
  50. package/assets/components/SocialLoginButton/assets/twitch.svg +21 -0
  51. package/assets/components/SocialLoginButton/assets/wechat.png +0 -0
  52. package/assets/components/SocialLoginButton/assets/x.svg +3 -0
  53. package/assets/components/SocialLoginButton/index.ts +2 -0
  54. package/assets/components/SocialLoginButton/provider-tokens.css +30 -0
  55. package/assets/components/SocialLoginButton/providers.ts +23 -0
  56. package/assets/components/_data.ts +1 -1
  57. package/assets/components/component-registry.json +30 -1
  58. package/assets/components/index.ts +1 -0
  59. package/assets/components/tokens.css +13 -6
  60. package/assets/prompts/ASSEMBLY.md +2 -0
  61. package/assets/prompts/CATALOG.md +1 -0
  62. package/assets/prompts/axes/material.md +4 -4
  63. package/assets/prompts/axes/shape.md +2 -2
  64. package/assets/prompts/components/_variants.md +1 -1
  65. package/assets/prompts/components/ai-message.md +6 -2
  66. package/assets/prompts/components/breadcrumb.md +11 -5
  67. package/assets/prompts/components/button.md +1 -1
  68. package/assets/prompts/components/callout.md +8 -4
  69. package/assets/prompts/components/canvas-edge.md +1 -1
  70. package/assets/prompts/components/canvas-node.md +1 -1
  71. package/assets/prompts/components/canvas.md +24 -8
  72. package/assets/prompts/components/command-palette.md +52 -44
  73. package/assets/prompts/components/drawer.md +15 -1
  74. package/assets/prompts/components/list-item.md +1 -1
  75. package/assets/prompts/components/social-login-button.md +117 -0
  76. package/assets/prompts/design-examples/ai-chat-full-page.png +0 -0
  77. package/assets/prompts/design-examples/catalog.json +9 -9
  78. package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.module.css +37 -1
  79. package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.tsx +113 -18
  80. package/assets/prompts/design-examples/sources/ai-chat-full-page/FullPageChat.tsx +2 -2
  81. package/assets/prompts/design-examples/sources/ai-chat-full-page/REFERENCE.md +3 -1
  82. package/assets/prompts/design-examples/sources/ai-chat-full-page/useChatDemo.ts +99 -51
  83. package/assets/prompts/tokens/material.md +5 -2
  84. package/assets/prompts/tokens/radius.md +1 -1
  85. package/assets/prompts/use-cases/chat-chat-input.md +382 -74
  86. package/assets/prompts/use-cases/data-list-item.md +38 -431
  87. package/assets/prompts/use-cases/feedback-drawer.md +112 -33
  88. package/assets/prompts/use-cases/overlay-command-palette.md +2004 -0
  89. package/assets/prompts/use-cases/structure-canvas.md +1016 -0
  90. package/package.json +1 -1
@@ -0,0 +1,117 @@
1
+ # Social Login Button
2
+
3
+ ### 원칙
4
+
5
+ 외부 계정으로 로그인할 때 써요. `provider`를 고르면 해당 서비스의 로고와 문구가 표시돼요. 실제 로그인은 앱의 클릭 핸들러에 연결해 주세요.
6
+
7
+ ### Props
8
+
9
+ | Prop | 값 | 기본값 |
10
+ |---|---|---|
11
+ | `provider` | `google`, `apple`, `kakao`, `naver`, `microsoft`, `line`, `facebook`, `github`, `x`, `discord`, `linkedin`, `slack`, `twitch`, `wechat`, `amazon`, `spotify` | 필수 |
12
+ | `variant` | 서비스별 색상 옵션 | `default` |
13
+ | `locale` | `ko`, `en` | `en` |
14
+ | `label` | 커스텀 버튼에 적용할 로그인 문구 | 서비스와 언어에 맞는 문구 |
15
+ | `size` | `sm` (40px), `md` (48px) | `md` |
16
+ | `fullWidth`, `loading`, `disabled` | boolean | false |
17
+ | `onClick` | 네이티브 버튼 클릭 핸들러 | 없음 |
18
+
19
+ 표준 버튼 속성과 `ref`도 전달할 수 있어요.
20
+
21
+ ### 로그인 화면의 버튼 높이
22
+
23
+ 일반 로그인 버튼과 소셜 로그인 버튼을 같은 로그인 영역에 배치할 때는 아래 조합으로 높이를 맞춰 주세요. 같은 밀도 설정을 적용하면 높이도 함께 조정돼요.
24
+
25
+ | `SocialLoginButton` | 공용 `Button` | 기본 밀도 높이 |
26
+ |---|---|---|
27
+ | `sm` | `lg` | 40px |
28
+ | `md` | `xl` | 48px |
29
+
30
+ 기존 `SocialLoginButton` 코드의 `lg`는 `sm`의 별칭이고, `xl`은 `md`의 별칭이에요.
31
+
32
+ 서비스 ID 목록은 `socialLoginProviders`에서, 화면에 표시할 이름은 `socialLoginProviderName(provider, locale)`에서 가져올 수 있어요.
33
+
34
+ ### 색상 옵션
35
+
36
+ 서비스마다 고를 수 있는 `variant`가 달라요. `default`는 공통 테마를 따르고, 카카오는 기본값에서도 노란색으로 표시돼요. 아래 조합은 `SocialLoginVariant<Provider>` 타입으로 확인하거나 `socialLoginColorOptions`에서 가져올 수 있어요.
37
+
38
+ | 서비스 | `default` 외 옵션 |
39
+ |---|---|
40
+ | Google | `light`, `neutral`, `dark` |
41
+ | Apple | `black`, `white`, `white-outline` |
42
+ | 카카오 | `yellow` |
43
+ | 네이버 | `green`, `white` |
44
+ | Microsoft | `light`, `dark` |
45
+ | LINE | `green` |
46
+ | Facebook | `blue` |
47
+ | GitHub | `dark` |
48
+ | LinkedIn | `blue` |
49
+ | Slack | `light`, `dark` |
50
+ | Amazon | `gold`, `light-gray`, `dark-gray` |
51
+
52
+ 색상 옵션은 공식 자료의 색을 공통 버튼 형태에 적용한 Ovenn 변형이다. GitHub 다크는 [흰색 Invertocat](https://brand.github.com/foundations/logo)을 활용한 Ovenn 조합이다. Facebook 블루는 [Meta 로그인 버튼](https://developers.facebook.com/docs/facebook-login/web/login-button) 외형을 참고한 옵션이다. 네이버와 LINE의 녹색 옵션은 공식 배경색과 흰색 문구를 사용한다. 이 조합의 일반 크기 글자 대비는 각각 약 3.1:1과 2.3:1이다. WCAG AA 일반 텍스트 대비가 필요한 화면은 `default`를 사용한다. Amazon 골드의 그라데이션은 [공식 웹 버튼 이미지](https://images-na.ssl-images-amazon.com/images/G/01/lwa/btnLWA_gold_156x32.png)의 색상을 사용한다.
53
+
54
+ ```tsx
55
+ <SocialLoginButton provider="apple" variant="black" onClick={startAppleLogin} />
56
+ <SocialLoginButton provider="naver" variant="green" locale="ko" onClick={startNaverLogin} />
57
+ ```
58
+
59
+ ### 서비스별 문구와 웹 버튼
60
+
61
+ 공식 SDK나 지정 버튼이 필요한 경우에는 서비스에서 제공하는 버튼을 써 주세요.
62
+
63
+ | 서비스 | 기본 문구와 연동 참고 | 공식 문서 |
64
+ |---|---|---|
65
+ | Google | Google 계정으로 로그인 / Sign in with Google. Google의 G를 표시한다. Google Identity Services 연동에서는 SDK 버튼을 우선 사용한다. | [브랜드 가이드](https://developers.google.com/identity/branding-guidelines?hl=ko) |
66
+ | Apple | Apple로 로그인 / Sign in with Apple. 실제 연동에서 Apple이 제공하는 웹 버튼이나 공식 로고를 사용한다. | [웹 버튼](https://developer.apple.com/documentation/signinwithapple/displaying-sign-in-with-apple-buttons-on-the-web), [Apple Developer 로고](https://developer.apple.com/apple-logo.svg) |
67
+ | 카카오 | 카카오 로그인 / Login with Kakao. 공식 말풍선과 노란 배경을 적용한다. | [디자인 가이드](https://developers.kakao.com/docs/ko/kakaologin/design-guide) |
68
+ | 네이버 | 네이버 로그인 / Log in with NAVER. 영문 공식 버튼 이미지의 대문자 NAVER를 따른다. | [버튼 가이드 및 공식 N 자산](https://developers.naver.com/docs/login/bi/bi.md) |
69
+ | Microsoft | Microsoft로 로그인 / Sign in with Microsoft. 회사나 학교 계정 전용인 경우 버튼 주변에서 계정 유형을 안내한다. | [브랜딩 지침](https://learn.microsoft.com/en-us/entra/identity-platform/howto-add-branding-in-apps) |
70
+ | LINE | LINE으로 로그인 / Log in with LINE. 공식 녹색 아이콘에 고대비 텍스트를 조합한다. | [버튼 가이드](https://developers.line.biz/en/docs/line-login/login-button/) |
71
+ | Facebook | 페이스북으로 로그인 / Log in with Facebook. Meta SDK는 Log in with Facebook과 Continue with Facebook 문구를 모두 지원한다. | [Meta Login Button](https://developers.facebook.com/docs/facebook-login/web/login-button), [브랜드 리소스](https://www.meta.com/brand/resources/facebook/logo/) |
72
+ | LinkedIn | LinkedIn으로 로그인 / Sign in with LinkedIn. 공식 버튼 리소스는 연동 문서에서 받는다. | [로그인 통합 가이드](https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2), [공식 정사각형 아이콘](https://static.licdn.com/scds/common/u/images/logos/favicons/v1/favicon.ico) |
73
+ | Slack | 슬랙으로 로그인 / Sign in with Slack. 한국어는 Ovenn의 현지화 문구이며 영문은 가이드의 문구를 따른다. | [버튼 가이드](https://docs.slack.dev/authentication/sign-in-with-slack/#button-design-guidelines), [공식 심볼](https://a.slack-edge.com/1f40066/marketing/img/nav/logo.svg) |
74
+ | Amazon | 아마존으로 로그인 / Login with Amazon. 한국어는 Ovenn의 현지화 문구다. 공용 버튼에서는 현재 Amazon Smile을 표시한다. 실제 로그인 연동에는 Amazon이 제공한 버튼을 사용한다. | [버튼 가이드](https://developer.amazon.com/docs/login-with-amazon/button.html), [Amazon Smile](https://sustainability.aboutamazon.com/) |
75
+ | GitHub | GitHub로 로그인 / Sign in with GitHub. | [로고 정책](https://docs.github.com/en/site-policy/other-site-policies/github-logo-policy), [Invertocat](https://brand.github.com/foundations/logo) |
76
+ | X | X로 로그인 / Sign in with X. | [브랜드 툴킷](https://about.x.com/en/who-we-are/brand-toolkit) |
77
+ | Discord | Discord로 로그인 / Sign in with Discord. 공식 Clyde 심볼을 적용한다. | [브랜드 가이드](https://discord.com/branding) |
78
+ | Twitch | Twitch로 로그인 / Sign in with Twitch. | [브랜드 리소스](https://brand.twitch.tv/) |
79
+ | WeChat | WeChat으로 로그인 / Sign in with WeChat. | [공식 앱 아이콘](https://wechat.design/tool/brand/) |
80
+ | Spotify | Spotify로 로그인 / Sign in with Spotify. 공식 단색 심볼을 최소 21px로 표시한다. | [디자인 가이드](https://developer.spotify.com/documentation/design) |
81
+
82
+ ### Do
83
+
84
+ - 소셜 로그인 버튼끼리는 같은 `size`를 쓰고, 일반 로그인 버튼과는 위 표에 따라 높이를 맞춰 주세요. 같은 열에 쌓는 버튼은 너비도 맞춰 주세요.
85
+ - 로그인 요청 중에는 `loading`을 켜 주세요. 버튼의 접근 가능한 이름과 너비가 유지되고 추가 클릭을 막아요.
86
+ - 인증을 연결하기 전에 서비스의 SDK와 버튼 사용 조건을 확인해 주세요.
87
+ - Icon Family를 바꿔도 서비스 로고는 그대로 표시돼요.
88
+
89
+ ### Don't
90
+
91
+ - Google, Apple, 카카오, 네이버, Microsoft, LINE, Facebook, LinkedIn, Slack, Amazon은 기본 문구를 고정한다.
92
+ - 실제로 로그인할 수 있는 서비스만 제품 화면에 표시해 주세요.
93
+
94
+ ### Fallback
95
+
96
+ 사용자 언어에 맞춰 `locale`을 전달해 주세요. `label`을 생략하면 서비스별 기본 문구가 표시돼요.
97
+
98
+ ### 예시
99
+
100
+ ```tsx
101
+ <SocialLoginButton
102
+ provider="kakao"
103
+ locale="ko"
104
+ fullWidth
105
+ loading={isSigningIn}
106
+ onClick={startKakaoLogin}
107
+ />
108
+ ```
109
+
110
+ ### 관련
111
+
112
+ - [[components/button]]이 기본 버튼 동작과 로딩 상태를 담당한다.
113
+
114
+ <!-- component-contract -->
115
+ ```json
116
+ {"roles":["action"],"native":[],"hints":["socialLogin","oauth","signIn"],"requires":[]}
117
+ ```
@@ -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-09",
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": "f7108555ef486d92627a651d1b6df56a061e69d99b45e261c908a26d47478d1e",
117
- "ChatExperience.tsx": "e2c5dd647957fa0ba5d7019ec9e8ec56e9f80de22fa5a830563c7a82f4cd12f7",
118
- "ChatExperience.module.css": "911b780c8443c0232f90566b4e0c03dafccb194bfe086bbb8c666a03a20f56de",
119
- "useChatDemo.ts": "d8a410d0c14b26df6c26fdd1b15b64d2cc6b74ca1453d8ed5b6e776860395fa4",
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": "1a3e21aa009b0290fd091e3a735ddab5b4ae064af8919417eeda5d736d58e79c"
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-4);
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 { useChatDemo } from "./useChatDemo";
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) => t.replies[t.questions.indexOf(text)] ?? t.fallbackReply;
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 { threads, activeThread, setActiveId, createThread, renameThread, deleteThread, setDraft, send, stop, edit, regenerate, isStreaming } = useChatDemo(getReply, getTitle);
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 > 0 || thread.draft.trim());
177
- const visibleThreads = historyThreads.filter((thread) => [thread.title, thread.draft, ...thread.messages.map((message) => message.text)].join(" ").toLocaleLowerCase().includes(normalizedSearch));
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
- {threads.some((thread) => thread.messages.length > 0 || thread.draft.trim()) && (
258
+ {historyThreads.length > 0 && (
201
259
  <>
202
260
  <DropdownMenu.Separator />
203
261
  <DropdownMenu.Group>
204
- {[...threads].reverse()
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
- {thread.title || Array.from(thread.draft.trim()).slice(0, 18).join("")}
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
- }}>{thread.title || Array.from(thread.draft.trim()).slice(0, 18).join("")}</MenuItem>
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·저장소·인증에 연결되어 있지 않다. 새로고침하면 대화가 초기화된다. 첨부 버튼은 연결되지 않았다. 이름 변경·삭제·검색·모바일 전환은 구현되어 있으나 이 등록이 모든 동작·테마·보조기술 검증을 뜻하지 않는다. 대표 캡처는 1440×900 라이트 모드의 한 쓰레드 대화 상태다.
21
+ 응답은 로컬 시나리오이며 실제 AI API·저장소·인증에 연결되어 있지 않다. 새로고침하면 대화가 초기화된다. 파일과 이미지 첨부는 브라우저 안에서만 표시하며 파일 내용을 분석하지 않는다. `/fail`을 보내면 실패와 재시도를 확인할 수 있다. 이름 변경·삭제·검색·모바일 전환은 구현되어 있으나 이 등록이 모든 동작·테마·보조기술 검증을 뜻하지 않는다. 대표 캡처는 1440×900 라이트 모드의 한 쓰레드 대화 상태다.