feat(desktop): label tracked sources as YouTube channels, open on click - #6
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates UI text labels in ContentView.swift to refer to "YouTube Channels" instead of "Sources" and adds a tap gesture to source rows to open their respective URLs. It also introduces a prompt history JSON file. The review feedback suggests validating the URL scheme (ensuring it is http or https) before opening it to prevent security vulnerabilities, restricting the tap gesture area to avoid event propagation issues with inner buttons, and removing the temporary prompt JSON file if it was committed by mistake.
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.
| .onTapGesture { | ||
| if let url = URL(string: source.handleOrURL ?? "") { | ||
| NSWorkspace.shared.open(url) | ||
| } | ||
| } |
There was a problem hiding this comment.
유튜브 채널의 handleOrURL은 옵셔널 값이며, 데이터베이스 상태에 따라 비어있거나 올바르지 않은 URL 스키마(예: file:// 등 안전하지 않은 스키마)를 가질 가능성이 있습니다. 안전한 이동을 위해 값이 비어있지 않은지 확인하고, URL 스키마가 http 또는 https인지 검증한 후 NSWorkspace.shared.open을 호출하는 것이 안전합니다.\n\n또한, 현재 sourceRow 전체에 .onTapGesture가 적용되어 있어, 행 내부의 삭제(trash) 버튼을 클릭할 때 삭제 얼럿이 뜨는 동시에 유튜브 채널 페이지가 브라우저에서 열리는 부작용(이벤트 전파)이 발생할 수 있습니다. 이를 방지하기 위해, 추후 리팩토링 시 텍스트 영역(이름, 플랫폼 정보 등)만 별도의 HStack이나 VStack으로 감싸고 해당 영역에만 .onTapGesture를 적용하고, 삭제 버튼은 그 바깥에 배치하는 구조로 개선하는 것을 권장합니다.
| .onTapGesture { | |
| if let url = URL(string: source.handleOrURL ?? "") { | |
| NSWorkspace.shared.open(url) | |
| } | |
| } | |
| .onTapGesture { | |
| if let handleOrURL = source.handleOrURL, | |
| !handleOrURL.isEmpty, | |
| let url = URL(string: handleOrURL), | |
| url.scheme == "http" || url.scheme == "https" { | |
| NSWorkspace.shared.open(url) | |
| } | |
| } |
| [ | ||
| { | ||
| "time": "22:12:45", | ||
| "user": "seungwonan", | ||
| "prompt": "그냥 메인에 해줘 워크트리 정리하고" | ||
| } | ||
| ] |
변경 사항
소스 관리 화면에서 라벨을 유튜브 채널로 명확히 하고, 클릭 시 유튜브 채널 페이지(설명 포함)로 이동하도록 변경했습니다.
handleOrURL을NSWorkspace로 열어 유튜브 채널 페이지(설명 포함)를 브라우저에서 확인 가능 (삭제 버튼은 별도 유지)현재
tracked_sources는 YouTube 채널만 등록되고 있어 라벨을 실제 용도에 맞게 바꿨습니다.테스트
swift build --package-path apps/desktop성공