Skip to content

Show the full video title on hover (tooltip) - #23

Merged
Yoddikko merged 1 commit into
mainfrom
fix/full-title-tooltip
Jul 28, 2026
Merged

Show the full video title on hover (tooltip)#23
Yoddikko merged 1 commit into
mainfrom
fix/full-title-tooltip

Conversation

@Yoddikko

@Yoddikko Yoddikko commented Jul 28, 2026

Copy link
Copy Markdown
Owner

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

  • Video cards and list rows now show the complete displayed title in a hover tooltip when the title is shortened to two lines
  • Tooltips use the same title text shown in the interface, including any available title correction

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:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

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

codeant-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 3aa9f2b Jul 28, 2026 · 07:14 07:17

@codeant-ai

codeant-ai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@Yoddikko
Yoddikko merged commit e59e9e9 into main Jul 28, 2026
1 of 8 checks passed
@Yoddikko
Yoddikko deleted the fix/full-title-tooltip branch July 28, 2026 07:15
@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jul 28, 2026
VStack(alignment: .leading, spacing: 3) {
Text(DearrowCache.shared.displayTitle(
for: self.video.videoId, original: self.video.title))
Text(self.displayTitle)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in VSCode Claude

(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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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`.

Fix in Cursor Fix in VSCode Claude

(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
👍 | 👎

Comment on lines +15 to +16
let displayTitle = DearrowCache.shared.displayTitle(
for: self.video.videoId, original: self.video.title)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in VSCode Claude

(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
👍 | 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Full video title on mouse hover

1 participant