mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 05:07:23 +01:00
* feat: chatkit v0.1 — one chat for every product The fleet had 13 chats in 10 repos, each written fresh, each missing what another had fixed. This extracts loki /loki (composer, thread, messages, markdown, attachments) and adds heidi's microphone and orangecat's keyboard fix: - Composer: auto-growing 16px textarea, Enter/Shift+Enter/IME, Send and Stop in one slot, attachments with paste, mic always present, every label translatable, app-specific controls in slots. - useDictation: browser recogniser first; missing or SILENT (4 s watchdog, bounded permission wait) -> record and transcribe on the server; a dead recogniser remembered 30 days; every failure shown in words. - ChatThread/ChatMessage: stick-to-bottom + jump button, speaker names once two agents speak, Copy on answers, Retry on the last one, failed turns visible. - Markdown with no HTML path; javascript: links stay text. - styles.css: --ck-* variables defaulting to @bitbaum/design-tokens. - verify = format, lint, types, build, 18 unit/render tests and 21 browser checks (390px + desktop, light + dark, a sentence through a fake mic past a silent recogniser). Browser checks mutation-tested (14px input, 60 s watchdog) — both fail as they should. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(styles): --ck-* defaults at zero specificity on :root, so an app's own values win Declared on the chat's elements they overrode any app setting --ck-* at the root — the opposite of what the README promised. Found preparing loki, whose colour variables are full OKLCH colours under the design-token names and so must map them. New browser check: a :root --ck-accent reaches the chat. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
64 lines
1.6 KiB
HTML
64 lines
1.6 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta
|
|
name="viewport"
|
|
content="width=device-width, initial-scale=1, interactive-widget=resizes-content"
|
|
/>
|
|
<title>chatkit demo</title>
|
|
<link rel="stylesheet" href="../node_modules/@bitbaum/design-tokens/tokens.css" />
|
|
<link rel="stylesheet" href="../styles.css" />
|
|
<style>
|
|
/* Page chrome only — the chat's look comes from styles.css + tokens. */
|
|
body {
|
|
margin: 0;
|
|
font-family: system-ui, sans-serif;
|
|
}
|
|
.theme {
|
|
padding: 24px 16px;
|
|
background: hsl(var(--surface-page, 0 0% 98%));
|
|
color: hsl(var(--text-primary, 0 0% 10%));
|
|
}
|
|
.grid {
|
|
display: grid;
|
|
gap: 24px;
|
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
}
|
|
.demo-chat {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
height: 560px;
|
|
}
|
|
h2 {
|
|
font-size: 14px;
|
|
margin: 0 0 8px;
|
|
opacity: 0.6;
|
|
font-weight: 500;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<section class="theme">
|
|
<div class="grid">
|
|
<div>
|
|
<h2>Conversation — two agents</h2>
|
|
<div id="conversation"></div>
|
|
</div>
|
|
<div>
|
|
<h2>Empty — starters</h2>
|
|
<div id="empty"></div>
|
|
</div>
|
|
<div>
|
|
<h2>Failed turn — retry</h2>
|
|
<div id="failed"></div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<script src="./dist/demo.js"></script>
|
|
</body>
|
|
</html>
|