Commit Graph

196 Commits

Author SHA1 Message Date
Josh Wilhelmi
6dd303a321 feat: Multiple features, improvements, and bug fixes (#208)
* feat: Add token budget tracking and multiple improvements

## Features
- **Token Budget Visualization**: Added real-time token usage tracking with pie chart display showing percentage used (blue < 50%, orange < 75%, red ≥ 75%)
- **Show Thinking Toggle**: Added quick settings option to show/hide reasoning sections in messages
- **Cache Clearing Utility**: Added `/clear-cache.html` page for clearing service workers, caches, and storage

## Improvements
- **Package Upgrades**: Migrated from deprecated `xterm` to `@xterm/*` scoped packages
- **Testing Setup**: Added Playwright for end-to-end testing
- **Build Optimization**: Implemented code splitting for React, CodeMirror, and XTerm vendors to improve initial load time
- **Deployment Scripts**: Added `scripts/start.sh` and `scripts/stop.sh` for cleaner server management with automatic port conflict resolution
- **Vite Update**: Upgraded Vite from 7.0.5 to 7.1.8

## Bug Fixes
- Fixed static file serving to properly handle routes vs assets
- Fixed session state reset to preserve token budget on initial load
- Updated default Vite dev server port to 5173 (Vite's standard)

## Technical Details
- Token budget is parsed from Claude CLI `modelUsage` field in result messages
- Budget updates are sent via WebSocket as `token-budget` events
- Calculation includes input, output, cache read, and cache creation tokens
- Token budget state persists during active sessions but resets on session switch

* feat: Add session processing state persistence

Fixes issue where "Thinking..." banner and stop button disappear when
switching between sessions. Users can now navigate freely while Claude
is processing without losing the ability to monitor or stop the session.

Features:
- Processing state tracked in processingSessions Set (App.jsx)
- Backend session status queries via check-session-status WebSocket message
- UI state (banner + stop button) restored when returning to processing sessions
- Works after page reload by querying backend's authoritative process maps
- Proper cleanup when sessions complete in background

Backend Changes:
- Added sessionId to claude-complete, cursor-result, session-aborted messages
- Exported isClaudeSessionActive, isCursorSessionActive helper functions
- Exported getActiveClaudeSessions, getActiveCursorSessions for status queries
- Added check-session-status and get-active-sessions WebSocket handlers

Frontend Changes:
- processingSessions state tracking in App.jsx
- onSessionProcessing/onSessionNotProcessing callbacks
- Session status check on session load and switch
- Completion handlers only update UI if message is for current session
- Always clean up processing state regardless of which session is active

* feat: Make context window size configurable via environment variables

Removes hardcoded 160k token limit and makes it configurable through
environment variables. This allows easier adjustment for different
Claude models or use cases.

Changes:
- Added CONTEXT_WINDOW env var for backend (default: 160000)
- Added VITE_CONTEXT_WINDOW env var for frontend (default: 160000)
- Updated .env.example with documentation
- Replaced hardcoded values in token usage calculations
- Replaced hardcoded values in pie chart display

Why 160k? Claude Code reserves ~40k tokens for auto-compact feature,
leaving 160k available for actual usage from the 200k context window.

* fix: Decode HTML entities in chat message display

HTML entities like &lt; and &gt; were showing as-is instead of being
decoded to < and > characters. Added decodeHtmlEntities helper function
to properly display angle brackets and other special characters.

Applied to:
- Regular message content
- Streaming content deltas
- Session history loading
- Both string and array content types

* refactor: Align package.json with main branch standards

- Revert to main branch's package.json scripts structure
- Remove custom scripts/start.sh and scripts/stop.sh
- Update xterm dependencies to scoped @xterm packages (required for code compatibility)
  - Replace xterm with @xterm/xterm
  - Replace xterm-addon-fit with @xterm/addon-fit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: Replace CLI implementation with Claude Agents SDK

This commit completes the migration to the Claude Agents SDK, removing the legacy CLI-based implementation and making the SDK the exclusive integration method.

Changes:
- Remove claude-cli.js legacy implementation
- Add claude-sdk.js with full SDK integration
- Remove CLAUDE_USE_SDK feature flag (SDK is now always used)
- Update server/index.js to use SDK functions directly
- Add .serena/ to .gitignore for AI assistant cache

Benefits:
- Better performance (no child process overhead)
- Native session management with interrupt support
- Cleaner codebase without CLI/SDK branching
- Full feature parity with previous CLI implementation
- Maintains compatibility with Cursor integration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update server/claude-sdk.js

Whoops. This is correct.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update server/index.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/components/ChatInterface.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/components/ChatInterface.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/components/ChatInterface.jsx

Left my test code in, but that's fixed.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: Prevent stale token-usage data from updating state on session switch

- Add AbortController to cancel in-flight token-usage requests when session/project changes
- Capture session/project IDs before fetch and verify they match before updating state
- Handle AbortError gracefully without logging as error
- Prevents race condition where old session data overwrites current session's token budget

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update src/components/TokenUsagePie.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: viper151 <simosmik@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-30 14:01:55 +01:00
simos
a100648ccb Release 1.8.12 v1.8.12 2025-10-08 06:37:46 +02:00
viper151
7d0fd141ff Merge pull request #203 from SyedaAnshrahGillani/fix-accessibility-issues
feat: Improve accessibility and refactor settings management
2025-10-01 22:21:35 +02:00
SyedaAnshrahGillani
e5a05d9865 fix: Address coderabbitai feedback 2025-10-02 01:12:52 +05:00
SyedaAnshrahGillani
2d6c3b5755 refactor: Create useLocalStorage hook to reduce code duplication 2025-10-01 17:16:09 +05:00
SyedaAnshrahGillani
2a5d27ffc0 fix(accessibility): Use buttons for modal backdrops 2025-10-01 17:04:35 +05:00
viper151
3c9a4cab82 Fix: Prevent CLI option injection in --print argument
Fix: Prevent CLI option injection in --print argument
2025-09-23 11:31:51 +02:00
viper151
ce9ab0cd16 Merge branch 'main' into fix-injection 2025-09-23 11:29:43 +02:00
viper151
66fad9a6a2 Update .env.example 2025-09-23 11:29:15 +02:00
viper151
0fcf906ff0 Merge pull request #197 from johnhenry/johnhenry/env-claude-path
Feat: Use environment variable for Claude path
2025-09-23 11:26:44 +02:00
viper151
7e1f2940d3 Merge branch 'main' into johnhenry/env-claude-path 2025-09-23 11:25:56 +02:00
simos
533d589132 Release 1.8.10 v1.8.10 2025-09-23 10:54:35 +02:00
simos
d1f310161f fixes on changelog prettify 2025-09-23 10:54:00 +02:00
simos
b853e8cda1 Release 1.8.9 v1.8.9 2025-09-23 10:51:45 +02:00
simos
1610de1f22 prettifying change logs 2025-09-23 10:51:18 +02:00
viper151
3f743d8210 Merge branch 'main' into johnhenry/env-claude-path 2025-09-23 10:48:59 +02:00
simos
cbb18fb010 Release 1.8.8 v1.8.8 2025-09-23 10:38:53 +02:00
simos
d8d754274a modified: .release-it.json 2025-09-23 10:37:20 +02:00
simos
eb12aef641 modified: .release-it.json 2025-09-23 10:37:02 +02:00
simos
5e574dbdec modified: package.json 2025-09-23 10:36:04 +02:00
simos
af9e9eec02 modified: .release-it.json 2025-09-23 10:35:38 +02:00
simos
8c3ee770c3 fixing release-it 2025-09-23 10:35:14 +02:00
simos
58108c083c modified: package-lock.json 2025-09-23 10:33:08 +02:00
simos
af0ad6b4b6 fixes on npm 2025-09-23 10:28:24 +02:00
simos
36d9f47e29 Fixing release it 2025-09-23 10:24:55 +02:00
simos
1f25f1e79b Adding changelog to release-it 2025-09-23 10:22:16 +02:00
simos
d7ed1de1cb Release 1.8.6 v1.8.6 2025-09-23 10:17:02 +02:00
simos
9be54233d0 fixs for npmjs package 2025-09-23 10:14:26 +02:00
simos
c8bcad71e7 Release 1.8.5 v1.8.5 2025-09-23 02:16:12 +02:00
simos
a3f504aed2 adding executable 2025-09-23 02:15:32 +02:00
simos
f766ac1517 fixes 2025-09-23 02:13:36 +02:00
simos
680d8f6fb1 Release 1.8.4 v1.8.4 2025-09-23 02:09:10 +02:00
simos
1820f3bfa8 Release 1.8.3 v1.8.3 2025-09-23 01:40:58 +02:00
simos
376e055443 Adding files to npm package 2025-09-23 01:40:21 +02:00
simos
f4becdc218 Release 1.8.2 v1.8.2 2025-09-23 01:24:23 +02:00
simos
70b421e5a8 changes to package.json to support npm releases 2025-09-23 01:23:43 +02:00
John Henry
d74a99ef24 Merge branch 'main' into johnhenry/env-claude-path 2025-09-22 10:53:48 -07:00
simos
771f7e4d7b Fix: UI issues 2025-09-17 09:10:27 +00:00
simos
cab13a1534 Fix: UI fixes for mobile 2025-09-17 08:43:22 +00:00
simos
1eba594418 Feat: Improve the chat interface by grouping messages from AI 2025-09-17 08:04:43 +00:00
simos
ed5374a1bd Feat: Make the login modal full screen for better visibility 2025-09-17 08:04:21 +00:00
simos
573a04d2e5 Feat: Add search bar on file tree 2025-09-17 08:00:24 +00:00
John Henry
133af82935 Merge branch 'main' into johnhenry/env-claude-path 2025-09-15 14:30:59 -07:00
simos
79981693f3 Fix : mobile issues and git diff in the git panel 2025-09-15 20:57:49 +00:00
simos
fb1117a999 Fix:
Fixed mobile zoom on input
2025-09-15 20:31:33 +00:00
simos
40b8737732 Merge branch 'main' of https://github.com/siteboon/claudecodeui 2025-09-15 15:57:45 +00:00
simos
15b95c4d08 Fixing maximum depth of directories 2025-09-15 15:56:33 +00:00
viper151
3ff1db0331 Merge pull request #188 from takumi3488/fix/ios-pwa-status-bar-overlap
fix: iOS PWA status bar overlap issue on mobile devices
2025-09-15 17:41:48 +02:00
viper151
dab0068d8f Merge branch 'main' into fix/ios-pwa-status-bar-overlap 2025-09-15 17:40:44 +02:00
viper151
3daf21c3d1 Merge branch 'main' into johnhenry/env-claude-path 2025-09-15 17:40:05 +02:00