Skip to content

Conversation

@Jardi-nohup
Copy link

No description provided.

arturren and others added 30 commits October 12, 2025 21:55
This reverts commit 5d45365.
…nd OpenAI Usage API sync

- Implement toggleable left sidebar for token usage visualization
- Add Prisma schema with UsageSession, UsageLog, and DailyAggregate tables
- Create API endpoints for usage logging, stats, history, and OpenAI sync
- Build UsageSidebar component with recharts for trend visualization
- Integrate session tracking into ChatKitPanel with real-time updates
- Add pricing calculator utility supporting all major OpenAI models
- Include comprehensive setup documentation and test scripts
- Configure Vercel Postgres support with Node.js runtime for API routes

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

Co-Authored-By: Claude <[email protected]>
- Resolved package.json conflicts: kept both pg and prisma dependencies
- Integrated PromptSidebar from remote with usage tracking sidebar
- Combined ChatKitPanel changes for session tracking and prompt sidebar
- Regenerated package-lock.json with all dependencies

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

Co-Authored-By: Claude <[email protected]>
- Add two minimal icon buttons (Templates and Token Usage) in top-left
- Toggle between three states: Templates sidebar, Usage sidebar, or no sidebar
- Move PromptSidebar and UsageSidebar to App.tsx for centralized control
- Remove PromptSidebar from ChatKitPanel (now controlled by parent)
- Update UsageSidebar to work as integrated sidebar (no backdrop/close button)
- Add PM_DATABASE_URL_RO environment variable for prompt management
- Persist sidebar mode preference in localStorage
- Match icon button style with existing minimal UI design

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

Co-Authored-By: Claude <[email protected]>
lkssmdt and others added 12 commits November 12, 2025 17:47
…ite design

- Move toggle buttons to top bar (aligned with chat interface)
- Use red (#bb0a30) for active state, gray for inactive
- Deemphasize buttons: smaller icons (w-4 h-4), no borders/shadows
- Panel renders below buttons in content area (not overlapping)
- Update UsageSidebar to minimal white design:
  - Remove all dark mode styles
  - Smaller text sizes (xs, text-[10px])
  - Light gray backgrounds (gray-50)
  - Reduced padding and spacing
  - Subtle gray chart line instead of red
- Reduce sidebar width to 256px for more compact design
- Update layout to flex-col with top bar and content area

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

Co-Authored-By: Claude <[email protected]>
- Move toggle buttons to fixed position (left-4 top-4)
- Position sidebar panel directly below buttons with gap
- Use fixed positioning for entire left sidebar area
- Add rounded corners and shadow to panel boxes
- Panel height: calc(100vh-5rem) to fit below buttons
- Buttons and panel now align with chat history button on right
- Main chat panel takes full width without sidebar affecting layout

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

Co-Authored-By: Claude <[email protected]>
- Added tiktoken library for accurate token counting
- Created /api/usage/report endpoint to receive token usage data
- Updated UsageSidebar to auto-refresh every 10 seconds
- Modified App.tsx to report token usage to server
- Added live token accumulation in current session display
- ChatKitPanel now tracks and reports estimated tokens per response
- Token data is persisted to database for historical tracking

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

Co-Authored-By: Claude <[email protected]>
- Created comprehensive test suite for usage tracking
- Tests reporting, fetching stats, and multi-request sessions
- Validates database persistence and cost calculations

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

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants