Skip to content

Add manual download tags - #27

Open
thsnkhn wants to merge 1 commit into
mainfrom
issue-9-manual-download-tags
Open

Add manual download tags#27
thsnkhn wants to merge 1 commit into
mainfrom
issue-9-manual-download-tags

Conversation

@thsnkhn

@thsnkhn thsnkhn commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add persisted manual tags to download records and add-download requests.
  • Add tag filters in the sidebar without replacing existing status filters.
  • Add tag entry in the Add Download sheet and add/remove editing in the detail inspector.
  • Include tag names in download search and update previews with sample tags.

Closes #9

Verification

  • xcodebuild -project Harbor.xcodeproj -scheme Harbor -configuration Debug -derivedDataPath /private/tmp/HarborDerivedData build

@thsnkhn
thsnkhn marked this pull request as ready for review June 14, 2026 12:20
@thsnkhn

thsnkhn commented Jun 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a977bb5ca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +85 to +86
private var emptyTitle: String {
switch center.selectedSidebarSelection {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve localized empty-state resources

When the selected sidebar item is one of the built-in filters, these branches now return a plain String; because Text(emptyTitle) receives a String variable, SwiftUI renders it verbatim instead of looking up the existing Localizable.xcstrings translations that were used when this was LocalizedStringResource. In Spanish/Italian locales the filter empty-state titles (and the same pattern in emptyDescription below) regress to English; keep the filter cases localized and only build a dynamic string for tag-specific text.

Useful? React with 👍 / 👎.

let item: DownloadItem
let center: DownloadCenter

@State private var newTagText = ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset draft tag on selection changes

When the inspector remains mounted and selectedDownload changes, SwiftUI preserves this @State across different item values, so a partially typed tag from the previous download stays in the field and pressing Add writes it to the newly selected download via center.setTags(for: item.id, ...). This occurs if a user types in the tag field, selects another row, then clicks Add; clear the draft on item changes or key the section by item.id.

Useful? React with 👍 / 👎.

Comment on lines +83 to +85
enum DownloadSidebarSelection: Hashable, Identifiable {
case filter(DownloadFilter)
case tag(String)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Canonicalize tag selection equality

The synthesized Hashable/Equatable for .tag(String) is case-sensitive, while tags are deduplicated and filtered case-insensitively elsewhere. If a selected tag's display casing changes, such as selecting Work and then adding a new work download that becomes the first available tag, the sidebar row is tagged .tag("work") but the selection remains .tag("Work"), so the current tag row loses its selected state even though the content is still filtered; compare tag selections canonically or repair the selection after additions.

Useful? React with 👍 / 👎.

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.

Add tags for organizing downloads

1 participant