fix(desktop): open YouTube channel About tab so description is visible - #7
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the source page opening logic in ContentView.swift by extracting it into a private helper method openSourcePage(_:). It also introduces specific URL construction for YouTube sources using their canonical ID to point to their about page, falling back to the default URL for other platforms. The reviewer suggested adding a defensive check to ensure canonicalID is not empty before constructing the YouTube URL, preventing invalid URL generation and falling back to the default URL instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| guard source.platform == "youtube" else { | ||
| if let url = source.handleOrURL.flatMap(URL.init(string:)) { | ||
| NSWorkspace.shared.open(url) | ||
| } | ||
| return | ||
| } |
There was a problem hiding this comment.
만약 source.canonicalID가 빈 문자열("")인 경우, path가 "channel/"이 되어 https://www.youtube.com/channel//about과 같은 잘못된 URL을 열려고 시도하게 됩니다.
데이터베이스 스키마에서 canonical_id가 NOT NULL로 정의되어 있더라도 빈 문자열은 저장될 수 있으므로, canonicalID가 비어있는지 확인하는 방어적 코드를 추가하고 이 경우 기존의 handleOrURL로 폴백하도록 개선하는 것이 안전합니다.
| guard source.platform == "youtube" else { | |
| if let url = source.handleOrURL.flatMap(URL.init(string:)) { | |
| NSWorkspace.shared.open(url) | |
| } | |
| return | |
| } | |
| guard source.platform == "youtube", !source.canonicalID.isEmpty else { | |
| if let url = source.handleOrURL.flatMap(URL.init(string:)) { | |
| NSWorkspace.shared.open(url) | |
| } | |
| return | |
| } |
문제
채널 행 클릭 시
handleOrURL(채널 홈 URL,/channel/UCxxxx)을 그대로 열어 유튜브 홈(영상 목록) 탭이 열리고 설명은 보이지 않았음(PR #6 후속 버그 리포트).수정
canonicalID기반으로.../about탭 URL을 조립해서 열도록 변경.https://www.youtube.com/@handle/abouthttps://www.youtube.com/channel/UCxxxx/abouthandleOrURL그대로 오픈 (하위 호환)테스트
swift build --package-path apps/desktop성공