Skip to content

feat: implement filename-based thread status management#14

Merged
choplin merged 12 commits into
mainfrom
feat/filename-based-status
Jul 9, 2025
Merged

feat: implement filename-based thread status management#14
choplin merged 12 commits into
mainfrom
feat/filename-based-status

Conversation

@choplin

@choplin choplin commented Jul 9, 2025

Copy link
Copy Markdown
Owner

Summary

This PR implements a comprehensive filename-based thread status management system for better integration with Claude Code and other AI assistants. Comment files now include status prefixes in their filenames, making it easy to identify which threads need attention.

Major Features

1. Filename-based Status Management

  • Comment files now use status prefixes: action-required_*.md, waiting-review_*.md, resolved_*.md
  • Status is automatically updated when replying to threads
  • Easy to grep/search for threads by status (e.g., grep -l "waiting-review_" .code-review/)
  • No more separate status tracking - the filename IS the status

2. Enhanced UI/UX Features

  • Fuzzy Finder Integration: Added support for both fzf-lua and telescope.nvim for thread listing (<leader>rl)
  • Status-specific Colors and Icons:
    • waiting-review: Green (󰇮 mail icon) - User's attention needed
    • action-required: Light gray (○) - Claude Code needs to respond
    • resolved: Dark gray (✓) - Completed threads
  • Improved Floating Windows: Increased default width (80 chars) and enabled word wrap for better readability
  • Smart Thread Selection: When multiple threads exist at cursor position, users are prompted to select which thread to interact with

3. Updated Keybindings

  • <leader>rl now lists threads (instead of individual comments) for better overview
  • <leader>rs includes thread selection UI when multiple threads exist at the cursor position

4. Comprehensive Test Coverage

  • Added extensive tests for the new filename-based status management system
  • Test coverage includes filename parsing, status transitions, and edge cases

Breaking Changes

  • None for existing users (backward compatible)
  • New feature that doesn't affect existing thread functionality

Test Plan

  • All existing functionality works with the new system
  • Fuzzy finder integration (fzf-lua/telescope) properly displays threads with status icons
  • Status colors and icons display correctly in gutter and virtual text
  • Thread selection UI appears when multiple threads exist
  • Filename status updates correctly when replying
  • All tests pass

choplin added 12 commits July 8, 2025 13:09
- Add automatic status tracking via filename prefixes:
  - action-required_: awaiting code author response
  - waiting-review_: awaiting reviewer response
  - resolved_: thread resolved
- Simplify frontmatter by removing status fields
- Add claude_code_author config for AI assistant detection
- Update file operations to handle status changes via rename
- Fix reply file creation to update existing thread file

This enables efficient workflow tracking between AI assistants
and human reviewers without parsing file contents.
- Add test_filename_status.lua with full coverage
- Test parse_filename and make_filename functions
- Test determine_thread_status logic
- Test automatic file renaming on replies
- Test thread file operations
- Test wildcard search functionality
- Test status preservation in list view
- Test resolve thread filename updates
- Export internal functions from storage/file.lua for testing
- Fix E5108 error when displaying comments with newlines
- Split comment content by lines before passing to nvim_buf_set_lines
- Ensures each line is added separately to avoid newline issues
- Show selection dialog when resolving threads at cursor position
- Display thread status, preview, and comment count for each thread
- Sort threads by ID for consistent ordering
- Previously only showed warning without allowing resolution
- Add list_threads() function to show thread-based view
- Display thread status icons ([\!], [⏳], [✓])
- Show root comment preview and total comment count
- Sort threads by file and line number
- Currently supports quickfix list (telescope/fzf-lua support TODO)
- Show thread selection UI when multiple threads at cursor
- Single thread: show all comments in that thread
- Multiple threads: let user choose which thread to view
- Display thread status, preview, and comment count in selection
- No threads: show all comments as before
- Add wrap=true to show long lines without horizontal scrolling
- Add linebreak=true to wrap at word boundaries
- Improves readability of long comments in <leader>rs
- Comment input window: width 60 -> 80
- Preview window vertical split: width 80 -> 100
- Comment display window: width 60 -> 80
- Keep heights unchanged as they auto-expand based on content
- Add color differentiation for comment statuses:
  - waiting-review: green (#50fa7b) - needs user attention
  - action-required: light gray (#6c7086) - pending Claude Code
  - resolved: dark gray (#44475a) - completed
- Keep gutter sign as vertical line (┃) with color variations
- Add status-specific virtual text icons:
  - waiting-review: mail icon (󰇮)
  - action-required: circle (○)
  - resolved: hidden (gutter only)
- Fix thread_status not being set from filename
- Remove debug notifications
- Implement list_threads_with_fzf_lua() with full preview support
- Implement list_threads_with_telescope() with status-aware display
- Unify status icons across all list views (quickfix, fzf-lua, telescope)
  - waiting-review: 󰇮 (mail icon)
  - action-required: ○
  - resolved: ✓
- Apply status-specific colors in telescope view
- Fix fzf-lua preview by properly storing entries and preview_buffers
@choplin choplin merged commit 3224182 into main Jul 9, 2025
3 checks passed
@choplin choplin deleted the feat/filename-based-status branch July 9, 2025 15:06
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.

1 participant