Skip to content

fix(web): name the libraries in the rule sentence - #1940

Merged
Quick104 merged 4 commits into
feat/collections-revampfrom
fix/rule-sentence-libraries
Oct 4, 2026
Merged

Quick104 merged 4 commits into
feat/collections-revampfrom
fix/rule-sentence-libraries

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #192
Validation tasks: changes #1141 C1 (Not run): rule rows in Admin > Home rows show the new wording and line break; what a row saves does not change.

The rule sentence in the Home row dialog reads "Show [Movies] from [Movies, TV] that match [all] of these:". The capitalized type and the bare list of library names read like form labels rather than a sentence. The collections redesign reuses this sentence on the Smart collection page and words it "Show [movies] from the [Movies, 4K Movies] libraries that match [all] of these:". This PR changes the shared RuleBuilder to that wording, so Home rows rule rows and the coming Smart page read the same.

Stacked on #1939 (feat(collections): one collection editor page, starting with Manual).

Approach

  • The kind choices are lower-case so they read inside the sentence: all titles, movies and shows, movies, shows, episodes, audiobooks, ebooks, manga. "Movies & shows" becomes "movies and shows".
  • With libraries picked, the sentence reads "from the [Movies] library" or "from the [Movies, 4K Movies] libraries". With none picked it reads "from [all libraries]". The design gives only the several-libraries wording; the other two follow its personal Smart mockup, which reads "from [all my libraries]" with no noun after the button.
  • "library" or "libraries" follows the button only when the picker shows a name, and counts every picked library. While library names are still loading, the picker already shows "2 libraries", so the sentence reads "from the [2 libraries]" instead of repeating the noun.
  • When the picked libraries mix a named library with one the picker can't name (deleted or not yet loaded), the LibraryMultiSelect summary now counts the unnamed one toward "+N more", so the sentence reads "from the [Movies +1 more] libraries" instead of "from the [Movies] library". A single unnamed library reads "1 library" rather than "1 libraries". The picker's other callers get the same summary in those cases.
  • "that match [all] of these:" starts on its own line, as in the mockup.
  • LibraryMultiSelect gets an optional allOptionLabel for the reset item in its menu, defaulting to the empty label. The rule sentence passes "All libraries", so the menu item stays capitalized while the button in the sentence reads "all libraries". Its other callers don't pass it and render as before. The personal Smart page will need "all my libraries" here; the PR that adds that page passes it into RuleBuilder.

Only labels change; the query a rule row saves is the same. No API change. jellycompat and the Apple and Android clients need no change. The user manual doesn't quote this sentence, so it needs no change.

Validation

  • Web: lint (no errors; the changed files add no warnings), format:check, build, budget:check, tsc -b and make test-web (808 files, 7,499 tests) pass.
  • Tests cover the sentence with no, one and several libraries, a named library mixed with an unnamed one, a single unnamed library, the noun not repeating while library names load, the line break before "that match" (checked by element and class, since jsdom has no layout), and the menu's "All libraries" item clearing the picked libraries. The Home rows save tests, including the saved-request goldens, pass unchanged.
  • Not checked on a running build: the sentence has not been compared with the mockup in a browser, and Curated home sections — Web admin #1141 C1 has not been walked.
  • make verify-local-paths passes. No Go, contract or migration files changed, so the Go and contract checks were not run.

Risks

None identified. Admins see new wording in Home rows rule rows; saved rows are unchanged.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagents (implementer, independent reviewer)
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: An independent reviewer subagent checked the change against the redesign plan and spec, confirmed RowForm is the only caller of RuleBuilder, and put the old RuleBuilder back in a scratch checkout, where 6 tests in the changed test files failed. It approved with one minor finding and two nits, all fixed. The sentence did not break before "that match" as the mockup does, and the picker's "All libraries" menu item had become lower-case along with the button; both fixes have tests. An Add row dialog assertion matched "movies" as a substring, so it would also pass on "movies and shows"; it now matches the whole label.

🤖 Generated with Claude Code

Note

Fix rule-builder sentence to name selected libraries with lowercase wording

  • The rule sentence now reads "from the … library/libraries" and only appends the library word when a selected name is known; unknown selected IDs are counted by the picker summary instead of duplicating the word
  • Media-scope labels in SCOPES are now lowercase (e.g. "movies and shows"), and LibraryMultiSelect gets separate empty-summary and capitalized reset-item labels
  • formatLibraryFilterSummary counts all selected IDs (including unknown ones) in the "+N more" suffix, and shows a single unknown selection as "1 library"
  • Adds an aria-hidden full-width break before the matching clause so it starts on its own line
  • Risk: UI wording changes in RuleBuilder.tsx may need screenshot/storybook updates; tests already adjusted for lowercase labels

Macroscope summarized 9f592bd.

Quick104 and others added 2 commits October 4, 2026 16:19
"Show [Movies] from [Movies, 4K Movies]" stuttered and hid that the picker
holds libraries. The shared rule sentence now reads "Show [movies] from the
[Movies, 4K Movies] libraries that match [all] of these:" ("library" for one,
"from [all libraries]" when none are picked), with lower-case kinds so they
read inside the sentence. Home rows rule rows get the same wording; saved
rule definitions are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ries" capitalized

The Smart mockup starts "that match [all] of these:" on its own line, and
the lower-case "all libraries" that reads well inside the sentence also
leaked into the picker's reset item next to capitalized library names.
LibraryMultiSelect gains an optional allOptionLabel (defaulting to the
empty summary, so other callers are unchanged) for the menu item.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8a298566-f690-46d0-ad8f-8be630346e2a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T23:05:12.231505Z 9f592bd New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 9f30cfcfec

ℹ️ 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 +89 to +91
const namedLibraries = value.library_ids.filter((id) =>
libraries.some((library) => library.id === id),
).length;

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 Handle mixed known and unknown library IDs

When value.library_ids contains both a library present in libraries and an ID whose name is unavailable (for example, a deleted or not-yet-loaded library), this count is based only on the known IDs, so the sentence renders from the [Movies] library even though the query still contains multiple library IDs. The picker likewise hides the unknown ID once at least one name is available, making the new singular/plural suffix misleading; the summary and suffix should account for mixed selections rather than treating the known subset as the full selection.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 043db10

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

The RuleBuilder wording and line break are visible when an admin builds rule rows, so #1141 C1 has a minor validation impact even though the saved section config is unchanged. Its result is still Not run; walk C1 against the merged build. The current line says “none changed,” so it should record this change.

Suggested fix: Validation tasks: changes #1141 C1

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

Base automatically changed from feat/collection-editor-manual to feat/collections-revamp October 4, 2026 22:49
A selection mixing a named library with one whose name is unknown
(deleted or not yet loaded) read "from the Movies library". The picker
summary now counts unnamed IDs toward "+N more", and the sentence picks
"library" or "libraries" from the whole selection.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Quick104

Quick104 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Updated the Validation tasks line to "changes #1141 C1" per Macroscope.

@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: 043db108c9

ℹ️ 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".

</SelectContent>
</Select>
<span>from</span>
<span>{value.library_ids.length > 0 ? "from the" : "from"}</span>

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 Handle a single unresolved library ID

When library_ids contains exactly one deleted or not-yet-loaded ID, LibraryMultiSelect renders 1 libraries and summaryShowsAName suppresses the noun suffix, while this branch still changes the sentence to from the; the result is from the 1 libraries. Either render the singular summary as 1 library or avoid the definite-article wording when the sole library name is unavailable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9f592bd

A rule row whose only library is deleted or not yet loaded read
"from the 1 libraries". The picker summary now checks for a single
selection before falling back to the "N libraries" count.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Quick104
Quick104 merged commit b5a3b9f into feat/collections-revamp Oct 4, 2026
16 checks passed
@Quick104
Quick104 deleted the fix/rule-sentence-libraries branch October 4, 2026 23:12
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.

1 participant