12 Commits

Author SHA1 Message Date
Jordan Bentley
59ee612f79
Merge main into token-tracking PR
- Merged latest main branch changes into token-tracking feature branch
- Resolved conflicts in session types, database schema, and UI components
- Combined token tracking features with commit mode functionality
- Added new commit mode columns to database and session interfaces
- Integrated project view and commit mode indicator components
- Preserved token usage display functionality from PR
- Updated session creation to include base commit/branch parameters

๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 19:34:35 -04:00
Jordan Bentley
81e31d0d32
When building PRs, create unsigned dmgs 2025-07-23 10:11:57 -04:00
Jordan Bentley
7f2e862b72
Revert "refactor: Comprehensive project root cleanup and organization (#93)"
This reverts commit 95c934cb2fb0ea9ba3aa52e27857db6492a444a0.
2025-07-22 11:51:46 -04:00
Jordan Bentley
859208196b
Revert "add -dev tag to version on non-release builds so that it doesn't get overwritten by autoupdate cache"
This reverts commit 8f50e52ddb86ec1a277eaa092ccc95720eaefc96.
2025-07-22 11:51:26 -04:00
Jordan Bentley
8f50e52ddb
add -dev tag to version on non-release builds so that it doesn't get overwritten by autoupdate cache 2025-07-21 13:36:19 -04:00
eshaffer321
95c934cb2f
refactor: Comprehensive project root cleanup and organization (#93)
This PR performs extensive cleanup of the project root directory to reduce
clutter and improve organization while maintaining all functionality.

## ๐Ÿ“ Directory Structure Improvements
- Move documentation files to `docs/`:
  - `MESSAGES_TAB_FIX.md` โ†’ `docs/MESSAGES_TAB_FIX.md`
- Create organized build structure:
  - `com.stravu.crystal.metainfo.xml` โ†’ `build/linux/`
  - `com.stravu.crystal.yml` โ†’ `build/linux/`
- Organize scripts and tests:
  - `check-license-compatibility.sh` โ†’ `scripts/`
  - `test-nested-process.sh` โ†’ `tests/`

## ๐Ÿงน Configuration File Cleanup
### Removed Redundant Files (5 files eliminated):
- Remove `frontend/vite.config.js` (duplicate of `vite.config.ts`)
- Remove `frontend/package-lock.json` (conflicts with pnpm workspace)
- Remove `.node-version` (duplicate of `.nvmrc`)
- Remove `.eslintignore` (workspace configs are sufficient)
- Remove `PR_DESCRIPTION.md` (PR-specific, not needed in repo)

### Playwright Configuration Consolidation:
- **Before**: 3 separate config files (`playwright.config.ts`, `playwright.ci.config.ts`, `playwright.ci.minimal.config.ts`)
- **After**: 1 environment-driven config using `CI` and `PLAYWRIGHT_MINIMAL` variables
- Updated package.json scripts to use environment variables instead of separate configs
- **67% reduction** in Playwright config files while maintaining all functionality

## ๐Ÿ”ง Reference Updates
- Update `docs/LICENSE-COMPATIBILITY.md` script references
- Update `scripts/build-flatpak.sh` Linux file paths
- Update `.github/workflows/license-compliance.yml` script path
- Update `.gitignore` to track `build/linux/` directory
- Update package.json test scripts for consolidated Playwright config

## โœจ Results
### File Count Reduction:
- **5 redundant configuration files** removed
- **3 Playwright configs** โ†’ **1 environment-driven config**
- **6 dot files** โ†’ **4 essential dot files**

### Better Organization:
- โœ… Clean project root with only essential files
- โœ… Logical directory structure (build/, docs/, scripts/, tests/)
- โœ… No duplicate or conflicting configuration files
- โœ… Environment-driven configuration over multiple files

### Maintained Functionality:
- โœ… All CI workflows updated and passing
- โœ… All build processes preserved
- โœ… All test configurations preserved
- โœ… Workspace isolation maintained

This cleanup significantly improves the developer experience while ensuring
no functionality is lost. The project is now better organized and easier
to navigate and maintain.

Co-authored-by: Erick Shaffer <erick.shaffer@meraki.net>
Co-authored-by: Jordan Bentley <151466993+jordan-BAIC@users.noreply.github.com>
2025-07-21 12:24:08 -04:00
Erick Shaffer
4182b9e0b3 Fix token tracking to show accurate usage and add empirical warnings
This PR fixes critical issues with token tracking and provides users with
actionable warnings based on real failure data.

1. **Incorrect token counting**: The system was adding cache tokens
   (cache_creation_input_tokens, cache_read_input_tokens) as if they were
   new tokens, causing inflated counts like 28125% usage. Cache tokens are
   cumulative state, not incremental additions.

2. **No user guidance**: Users had no warning when approaching context limits,
   leading to unexpected "Prompt is too long" errors.

- Show only raw token counts from Claude API (input + output)
- Remove percentage calculations and context window estimates
- Display running totals that users can trust

Based on analysis of 29 failed sessions, implemented three warning levels:
- โœ… Safe: < 80K tokens
- โš ๏ธ Caution: 80K-95K tokens (yellow warning)
- ๐Ÿšจ Danger: > 95K tokens (red alert)

The lowest observed failure was at 96,800 tokens, so warnings start at 80K
to give users ample time to start a new session.

- Styled clickable popover (replacing poor native tooltips)
- Token breakdown (input/output/total)
- Clear warning messages with context
- Dark mode support

- Fixed `extractTokenUsage()` to only count actual input/output tokens
- Removed hardcoded system overhead calculations
- Added contextWindowTokens tracking for future use
- Updated UI to show raw truth instead of estimates

This gives users the information they need without confusing calculations
or impossible percentages.
2025-07-20 15:12:41 -06:00
Jordan Bentley
39c16cb2ff
show build commit on built artifacts 2025-07-20 16:38:04 -04:00
Jordan Bentley
d63a8dfcd1
show build info in about crystal panel 2025-06-24 19:30:59 -04:00
Jordan Bentley
112b7a7c6a
attempt a linux flatpack 2025-06-19 09:44:15 -04:00
Jordan Bentley
201d63115a
license compliance file 2025-06-16 15:38:34 -04:00
Jordan Bentley
c2ae680c19
build notices file 2025-06-16 15:22:30 -04:00