Skip to content

Conversation

@andyrewlee
Copy link
Owner

@andyrewlee andyrewlee commented Jan 26, 2026

The "Add as project" button was intermittently failing to register clicks due to a mismatch between visual line count and logical line count when content wrapped to multiple lines.

Changes:

  • Add lastContentHeight field to cache content height from render for click handling, ensuring consistency between View() and Update()
  • Truncate long paths and directory names to prevent text wrapping, which caused Y-coordinate misalignment in hit detection
  • Rename "New project" to "Add project" throughout the UI since this action adds an existing git repository
  • Add comprehensive edge case tests for button clicks with long paths, long directory names, empty directories, and the truncation function
  • Show "No subdirectories" instead of "No matches" in directories-only mode for clearer messaging

Open with Devin

The "Add as project" button was intermittently failing to register clicks
due to a mismatch between visual line count and logical line count when
content wrapped to multiple lines.

Changes:
- Add lastContentHeight field to cache content height from render for
  click handling, ensuring consistency between View() and Update()
- Truncate long paths and directory names to prevent text wrapping,
  which caused Y-coordinate misalignment in hit detection
- Rename "New project" to "Add project" throughout the UI since this
  action adds an existing git repository
- Add comprehensive edge case tests for button clicks with long paths,
  long directory names, empty directories, and the truncation function
- Show "No subdirectories" instead of "No matches" in directories-only
  mode for clearer messaging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View issue and 5 additional flags in Devin Review.

Open in Devin Review

Use truncated path in inputOffset() to match renderLines() behavior,
preventing cursor misalignment when paths are long.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@andyrewlee andyrewlee merged commit 7861627 into main Jan 26, 2026
1 check passed
@andyrewlee andyrewlee deleted the add-project-bug branch January 26, 2026 18:16
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.

2 participants