Commit Graph

242 Commits

Author SHA1 Message Date
Nicolas Varrot
72e9bce4c5 fix: bust service worker cache on each build with version+timestamp
The SW cache name was hardcoded to 'pinchchat-v1', meaning PWA users
would get stale cached assets forever. Now the cache name includes
the package version and build timestamp, so each build creates a new
cache and old ones are cleaned up on activation.

Also adds:
- Periodic SW update check (every 30 min)
- Auto-reload when new SW version is detected
2026-02-13 11:57:32 +00:00
Nicolas Varrot
13f5c4ac0c fix: textarea overflow and width in highlighted input container 2026-02-13 11:52:39 +00:00
Nicolas Varrot
beced29c91 fix: textarea not expanding in flex layout with syntax highlight enabled 2026-02-13 11:51:55 +00:00
Nicolas Varrot
daa0ce7494 chore: remove unused dependencies (radix-ui, class-variance-authority)
Remove 5 unused production dependencies:
- @radix-ui/react-collapsible
- @radix-ui/react-scroll-area
- @radix-ui/react-separator
- @radix-ui/react-tooltip
- class-variance-authority

These were leftover from initial scaffolding and never imported.
Reduces install footprint and dependency count.
2026-02-13 11:41:25 +00:00
Nicolas Varrot
879d73e3ac chore: bump version to v1.33.0 2026-02-13 11:30:35 +00:00
Nicolas Varrot
f8324b760c feat: add C, C++, and Java syntax highlighting support
Add c, cpp, and java to the highlight.js language bundle for code block
rendering. These are among the most commonly used languages in AI coding
conversations and were previously unsupported, falling back to plain text.

Also adds aliases: h (C headers), cc/cxx/c++/hpp/hxx (C++ variants).
2026-02-13 11:30:18 +00:00
Nicolas Varrot
6fb2f83716 fix: add Docker HEALTHCHECK for container health monitoring
- Add HEALTHCHECK instruction to Dockerfile (wget localhost:80, 30s interval)
- Add healthcheck config to docker-compose.yml
- Enables Docker/orchestrator health monitoring and auto-restart on failure
2026-02-13 11:12:43 +00:00
Nicolas Varrot
ccabb8699f perf: memoize ChatMessage component and hoist ReactMarkdown plugin arrays
- Wrap ChatMessageComponent with React.memo to skip re-renders when props unchanged
- Hoist remarkPlugins and rehypePlugins arrays to module scope to avoid
  creating new array references on every render (prevents unnecessary
  ReactMarkdown re-processing)
- Use proper PluggableList type from unified instead of any
2026-02-13 10:58:11 +00:00
Nicolas Varrot
1c09ccde22 fix: improve accessibility — add ARIA attributes to ThemeSwitcher, ThinkingBlock, ThinkingIndicator, ErrorBoundary, SessionIcon
- ThemeSwitcher: aria-expanded, aria-haspopup, aria-pressed on theme/accent buttons, Escape to close, dialog role
- ThinkingBlock: aria-expanded on toggle, region role on content
- ThinkingIndicator: role=status, aria-label, decorative icon aria-hidden
- ErrorBoundary: role=alert on error state
- SessionIcon: aria-hidden on decorative SVG brand icons
2026-02-13 10:42:10 +00:00
Nicolas Varrot
3657476fd9 docs: add pull request template 2026-02-13 10:25:10 +00:00
Nicolas Varrot
66a6b1fd94 docs: add Customization section to README (themes, accents, preferences) 2026-02-13 10:11:48 +00:00
Nicolas Varrot
6ce633e714 docs: update CHANGELOG for v1.32.0–v1.32.2 2026-02-13 09:55:26 +00:00
Nicolas Varrot
63af0b0dde chore: bump version to v1.32.2 2026-02-13 09:40:34 +00:00
Nicolas Varrot
cbb46115a0 fix: render markdown lists with proper bullet/number styles
Tailwind's preflight resets list-style to none on ul/ol elements.
Add explicit list-style-type rules for markdown-body: disc for ul,
decimal for ol, with circle/square for nested levels.
Also add li margin for spacing.

Closes feedback #61
2026-02-13 09:40:22 +00:00
Nicolas Varrot
a64a235d6c chore: bump version to v1.32.1 2026-02-13 09:28:04 +00:00
Nicolas Varrot
5acc5a820d fix: improve light theme readability for tool badges and user bubbles
- Expose resolvedTheme in ThemeContext for theme-aware rendering
- Tool call badges: darker text colors and higher bg opacity in light theme
- User message bubbles: increased bg opacity and border strength in light theme
- Progress bars and send button already use accent CSS variables (no change needed)

Closes feedback #60
2026-02-13 09:27:42 +00:00
Nicolas Varrot
0a0acbe4e0 chore: bump version to v1.32.0 2026-02-13 09:12:24 +00:00
Nicolas Varrot
b783ae181b feat: optimistic message rendering with send status indicators
- User messages appear instantly with 'sending' state (dimmed, clock icon)
- Transitions to 'sent' (checkmark) when server acknowledges
- Shows error state (alert icon, retry visible) if send fails
- Applied to both primary and secondary sessions
2026-02-13 09:12:09 +00:00
Nicolas Varrot
495dd0352f docs: add debugging section to troubleshooting guide 2026-02-13 08:57:41 +00:00
Nicolas Varrot
85a14224ad fix: theme switcher portal — max z-index, remove backdrop-blur to fix compositing 2026-02-13 08:46:13 +00:00
Nicolas Varrot
885cd0ea22 fix: render theme switcher via portal to escape overflow/stacking context 2026-02-13 08:44:26 +00:00
Nicolas Varrot
f2162c6731 test: add i18n and highlight.js test suites (18 cases, 95 total) 2026-02-13 08:42:59 +00:00
Nicolas Varrot
317096499c fix: theme switcher click handling — prevent click-outside from swallowing button clicks 2026-02-13 08:36:12 +00:00
Nicolas Varrot
97ceb08b86 docs: release v1.31.1 — theme variable fix in App.tsx 2026-02-13 08:27:31 +00:00
Nicolas Varrot
3fcaa1eef8 fix: replace remaining hardcoded zinc color classes with theme variables in App.tsx 2026-02-13 08:26:54 +00:00
Nicolas Varrot
e698e64bc8 test: add unit tests for image, utils, and credentials modules (22 cases) 2026-02-13 08:11:17 +00:00
Nicolas Varrot
3fad7b1e0a test: expand exportChat coverage with tool_result and edge case tests 2026-02-13 07:56:54 +00:00
Nicolas Varrot
bb9393c138 test: add systemEvent utility tests (21 cases) 2026-02-13 07:40:45 +00:00
Nicolas Varrot
0e4ae0ed7f ci: add test coverage reporting with v8 provider
- Add vitest.config.ts with v8 coverage provider
- Add npm run test:coverage script
- Add coverage step to CI (Node 22, reports in job summary)
- Coverage tracks src/lib/ utilities (currently ~21% lines)
- Install @vitest/coverage-v8 dev dependency
2026-02-13 07:27:02 +00:00
Nicolas Varrot
41f3952548 docs: update CONTRIBUTING.md with lint and test steps, remove duplicate PR template 2026-02-13 07:10:33 +00:00
Nicolas Varrot
141bc4e8fc docs: release v1.31.0 — unit test infrastructure 2026-02-13 06:59:02 +00:00
Nicolas Varrot
c4725e65c2 feat: add Vitest unit tests for utility functions
- Set up Vitest with 27 tests across 3 test suites
- relativeTime: edge cases, time buckets, future timestamps
- sessionDisplayName: labels, kinds, channels, UUID truncation
- messagesToMarkdown: roles, blocks, tool calls, system events
- Add test and test:watch npm scripts
- Add test step to CI workflow
2026-02-13 06:58:39 +00:00
Nicolas Varrot
f05db6aa6d refactor: replace console.log with debug logger in gateway client
WebSocket debug logs are now silent by default. Enable with:
  localStorage.setItem('pinchchat:debug', '1')

Reduces console noise in production while keeping full debug
visibility available for developers.
2026-02-13 06:41:26 +00:00
Nicolas Varrot
6b0261f9c1 perf: reduce bundle size by using custom highlight.js subset
Replace highlight.js/lib/common (36 languages) with a curated subset
of 16 languages relevant for coding-assistant chat UIs. Both ToolCall
(direct hljs) and ChatMessage (rehype-highlight) now share the same
custom bundle from src/lib/highlight.ts.

Languages included: bash, css, diff, dockerfile, go, ini, javascript,
json, markdown, python, rust, shell, sql, typescript, xml, yaml.

Markdown chunk: 477KB → 336KB (-30%, -45KB gzipped)
2026-02-13 06:11:46 +00:00
Nicolas Varrot
8679fdc3a0 docs: add pull request template for contributors 2026-02-13 05:55:01 +00:00
Nicolas Varrot
7819383812 docs: release v1.30.1 — accessibility aria-labels 2026-02-13 05:42:56 +00:00
Nicolas Varrot
de6976bae8 fix: add missing aria-labels to icon-only buttons for accessibility
- Sidebar close button: aria-label for screen readers
- Sidebar search clear button: aria-label
- ChatMessage raw JSON copy button: aria-label
- Added i18n keys: sidebar.close, sidebar.clearSearch (EN + FR)
2026-02-13 05:42:23 +00:00
Nicolas Varrot
72f410566a docs: add ARCHITECTURE.md with codebase map for contributors 2026-02-13 05:26:47 +00:00
Nicolas Varrot
78dd2d3b11 docs: release v1.30.0 — PWA service worker 2026-02-13 05:12:00 +00:00
Nicolas Varrot
5a4c5ba457 feat: add service worker for PWA support (offline caching, installability)
- Add sw.js with stale-while-revalidate caching for static assets
- Network-first for HTML navigation, skip API/WS requests
- Register service worker in main.tsx on page load
- Enhanced manifest.json with orientation, categories, and all icon sizes
- App is now installable as a standalone PWA on mobile and desktop
2026-02-13 05:11:39 +00:00
Nicolas Varrot
33d72d65bd docs: release v1.29.2 — image loading & error states 2026-02-13 04:57:22 +00:00
Nicolas Varrot
5f3f73e4c9 fix: add loading skeleton and error fallback for images
- Show a pulsing placeholder while images load
- Display a graceful error state with ImageOff icon when images fail to load
- Prevents broken image icons from cluttering the chat
2026-02-13 04:56:47 +00:00
Nicolas Varrot
d106f51d9c docs: release v1.29.1 — secure external links 2026-02-13 04:42:54 +00:00
Nicolas Varrot
dfbfc375da fix: open external links in new tab with rel=noopener noreferrer
Markdown links pointing to external URLs (http/https) now open in a
new tab with target=_blank and rel='noopener noreferrer' for security.
Internal/relative links are unaffected.
2026-02-13 04:42:39 +00:00
Nicolas Varrot
ad6f81d4d7 docs: update landing page Recent Updates with v1.18-v1.29 features
Replace outdated feature cards (v1.4-v1.13) with the latest additions:
- Themes & accent colors (v1.20-v1.29)
- Thinking/reasoning display (v1.18-v1.25)
- Split view (v1.28)
- Message search (v1.22)
- Syntax highlighting input (v1.27)
- Drag & drop sessions (v1.26)
- Agent avatars (v1.19)
- Raw JSON & metadata viewer (v1.15-v1.24)
- Keyboard shortcuts (v1.13, kept)
2026-02-13 04:26:50 +00:00
Nicolas Varrot
c36c9fc86b docs: release v1.29.0 — system theme option 2026-02-13 04:13:16 +00:00
Nicolas Varrot
2157d7ebd5 feat: add System theme option that follows OS color scheme
Adds a 'System' option to the theme switcher that automatically uses
light or dark theme based on the OS prefers-color-scheme setting.
Dynamically updates when the OS preference changes (e.g. scheduled
dark mode). i18n labels added for EN/FR.
2026-02-13 04:13:01 +00:00
Nicolas Varrot
aa37d7b313 docs: add Contributor Covenant Code of Conduct 2026-02-13 03:58:13 +00:00
Nicolas Varrot
e0a418d332 docs: release v1.28.2 — zero lint warnings 2026-02-13 03:42:08 +00:00
Nicolas Varrot
1770e95d0a fix: resolve all ESLint warnings (setState in useEffect)
Suppress 3 react-hooks/set-state-in-effect warnings with targeted
eslint-disable comments. These are intentional patterns:
- ChatInput: restore draft text on session switch
- MessageSearch: reset active index on query change
- ToolCall: sync open state with global collapse/expand toggle

Lint now passes with 0 errors and 0 warnings.
2026-02-13 03:41:39 +00:00