Show the full video title on hover (tooltip) - #23
Conversation
Long video titles truncate to two lines and end in "…". Add a native macOS hover tooltip (`.help`) surfacing the complete title on video cards (grid / rails) and list rows (search, related), matching YouTube's behaviour. Closes #20 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
| VStack(alignment: .leading, spacing: 3) { | ||
| Text(DearrowCache.shared.displayTitle( | ||
| for: self.video.videoId, original: self.video.title)) | ||
| Text(self.displayTitle) |
There was a problem hiding this comment.
Suggestion: The visible title is now the DeArrow replacement, but the enclosing accessibility element still uses accessibilityText, which is built from video.title. VoiceOver therefore announces a different title from the one sighted users see. Build the accessibility label from the same display title used by the card. [api mismatch]
Severity Level: Major ⚠️
- ⚠️ VoiceOver announces stale original video titles.
- ⚠️ Sighted and accessible card titles disagree.
- ⚠️ DeArrow replacements are unavailable to VoiceOver users.Steps of Reproduction ✅
1. Enable DeArrow in `Sources/Kaset/Views/AddonsSettingsView.swift:18-19` and open a view
that renders `VideoCard`; the repository code graph shows cards are used by home rails,
channel grids, and playlist content.
2. When the DeArrow request started from `VideoCard.body` at
`Sources/Kaset/Views/YouTube/VideoCard.swift:44-46` completes, `self.displayTitle` at
`Sources/Kaset/Views/YouTube/VideoCard.swift:15` resolves to the cached replacement
through `DearrowCache.displayTitle` at `Sources/Kaset/Services/DearrowCache.swift:25-31`.
3. Sighted users see that replacement title and the same value in the tooltip configured
at `Sources/Kaset/Views/YouTube/VideoCard.swift:22-24`.
4. VoiceOver reads the enclosing combined accessibility element configured at
`Sources/Kaset/Views/YouTube/VideoCard.swift:47-48`, but `accessibilityText` begins with
`self.video.title` at `Sources/Kaset/Views/YouTube/VideoCard.swift:60-61`. The spoken
title consequently differs from the visible title whenever a cached DeArrow replacement
exists.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** Sources/Kaset/Views/YouTube/VideoCard.swift
**Line:** 15:15
**Comment:**
*Api Mismatch: The visible title is now the DeArrow replacement, but the enclosing accessibility element still uses `accessibilityText`, which is built from `video.title`. VoiceOver therefore announces a different title from the one sighted users see. Build the accessibility label from the same display title used by the card.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| } | ||
|
|
||
| private var displayTitle: String { | ||
| DearrowCache.shared.displayTitle(for: self.video.videoId, original: self.video.title) |
There was a problem hiding this comment.
Suggestion: These cards now always use the cached DeArrow replacement, but displayTitle does not check SettingsManager.shared.dearrowEnabled. After the user disables DeArrow, cached replacements remain visible in the card and tooltip instead of reverting to video.title. Make the cache lookup respect the setting or clear/invalidate cached replacements when the setting changes. [logic error]
Severity Level: Major ⚠️
- ❌ Video cards retain DeArrow titles after disabling DeArrow.
- ❌ Grid, rail, and playlist titles remain inconsistent with settings.
- ⚠️ Hover tooltips expose the stale replacement title.Steps of Reproduction ✅
1. Enable DeArrow through the `Toggle` bound to `settings.dearrowEnabled` in
`Sources/Kaset/Views/AddonsSettingsView.swift:18-19`.
2. Open a YouTube grid, rail, or playlist view; `VideoCard` is used by the playlist,
channel, and home views identified in the repository code graph, and `VideoCard.body`
starts fetching DeArrow data at `Sources/Kaset/Views/YouTube/VideoCard.swift:44-46`.
3. After a replacement is cached, `VideoCard.displayTitle` calls
`DearrowCache.displayTitle` at `Sources/Kaset/Views/YouTube/VideoCard.swift:51-53`;
`DearrowCache.displayTitle` returns `dearrowTitles[videoId]` at
`Sources/Kaset/Services/DearrowCache.swift:25-31` without checking
`SettingsManager.shared.dearrowEnabled`.
4. Disable DeArrow using the same settings toggle. `SettingsManager.dearrowEnabled` only
persists the new value at `Sources/Kaset/Services/SettingsManager.swift:558-562`, and no
cache-clearing or invalidation call exists. Re-rendered cards therefore continue
displaying the cached replacement in both the title and `.help` tooltip at
`Sources/Kaset/Views/YouTube/VideoCard.swift:15-24`.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** Sources/Kaset/Views/YouTube/VideoCard.swift
**Line:** 52:52
**Comment:**
*Logic Error: These cards now always use the cached DeArrow replacement, but `displayTitle` does not check `SettingsManager.shared.dearrowEnabled`. After the user disables DeArrow, cached replacements remain visible in the card and tooltip instead of reverting to `video.title`. Make the cache lookup respect the setting or clear/invalidate cached replacements when the setting changes.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| let displayTitle = DearrowCache.shared.displayTitle( | ||
| for: self.video.videoId, original: self.video.title) |
There was a problem hiding this comment.
Suggestion: displayTitle is not read-only: on the first render for a video it mutates the @Observable cache by inserting into originalTitles. Calling it while SwiftUI is evaluating the row body can trigger state-change-during-view-update warnings and re-entrant or unnecessary row updates. Store original titles before rendering, or make this lookup side-effect-free. [cache]
Severity Level: Major ⚠️
- ⚠️ Search results mutate observable state during row rendering.
- ⚠️ Related video lists may trigger redundant row updates.
- ⚠️ SwiftUI can emit state-update warnings during scrolling.Steps of Reproduction ✅
1. Execute a search that returns a video result through `YouTubeSearchView.row(for:)` at
`Sources/Kaset/Views/YouTube/YouTubeSearchView.swift:199-204`; this constructs
`VideoRowView(video:)` for each video.
2. During the initial evaluation of `VideoRowView.body`, the local declaration at
`Sources/Kaset/Views/YouTube/YouTubeListRows.swift:15-16` calls
`DearrowCache.displayTitle`.
3. `DearrowCache` is both `@MainActor` and `@Observable` at
`Sources/Kaset/Services/DearrowCache.swift:9-11`. On the first render for a video,
`displayTitle` writes `originalTitles[videoId] = original` at
`Sources/Kaset/Services/DearrowCache.swift:26-30` while SwiftUI is evaluating the row
body.
4. Because the write occurs during view evaluation, SwiftUI can report state mutation
during view update or schedule unnecessary/re-entrant row invalidations. The same
rendering pattern is reached for related/search rows whenever a video has not previously
been recorded in `originalTitles`; moving the write outside body evaluation or making the
lookup read-only avoids that update-cycle mutation.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** Sources/Kaset/Views/YouTube/YouTubeListRows.swift
**Line:** 15:16
**Comment:**
*Cache: `displayTitle` is not read-only: on the first render for a video it mutates the `@Observable` cache by inserting into `originalTitles`. Calling it while SwiftUI is evaluating the row body can trigger state-change-during-view-update warnings and re-entrant or unnecessary row updates. Store original titles before rendering, or make this lookup side-effect-free.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
User description
Long video titles truncate to two lines and end in "…". Add a native macOS hover tooltip (
.help) surfacing the complete title on video cards (grid / rails) and list rows (search, related), matching YouTube.Closes #20
🤖 Generated with Claude Code
CodeAnt-AI Description
Show full YouTube titles when truncated
What Changed
Impact
✅ Full titles available without opening videos✅ Easier identification of truncated videos✅ Consistent title access across cards and list rows💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.