Skip to content

Collection Settings in React: Subscription page (BL-16734) - #8487

Open
andrew-polk wants to merge 1 commit into
masterfrom
BL-16734-subscription-settings
Open

andrew-polk wants to merge 1 commit into
masterfrom
BL-16734-subscription-settings

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The new (React) Collection Settings dialog had only a placeholder for its Subscription page, so a subscription code could still be entered only in the old WinForms dialog. Every subscription badge and gated menu item ("this needs a subscription, click to get one") also still opened the old dialog.

Fix

  • A real Subscription page, laid out like the card's mockup: the intro above a card holding the code box (copy/paste), tier and expiry, branding summary, expiry warnings, and the community-subscription invitation. It shares the code box and status components with the old tab; the old tab itself becomes a self-contained LegacySubscriptionSettings that the cutover deletes whole.
  • The code saves with the rest of the dialog. The dialog keeps the code being typed and posts it as values.subscription.code; C# hands it to the existing ApplySubscriptionAndBookshelf rules (Pro refused in a Team Collection, the BL-15056 expired-bookshelf cases), now before the xmatter check because the branding can choose the pack. A changed code turns OK into Restart. An unchanged code keeps the collection's own subscription object, which matters for a book downloaded for editing.
  • Nothing to undo on Cancel. The shared components describe the typed code through a stateless GET settings/subscription?code=… (with no code it describes the collection's subscription), so the code never reaches C# until OK. The old dialog's tab uses the same lookup, and still keeps its typed code in C# for its own OK.
  • Every "open the Subscription settings" entry point now opens the new dialog on that page. Subscription badges and gated menu items open it directly in the browser (from the toolbox or page iframe, through the workspace bundle's exports). The comic-book ReadMe links and the invalid-branding startup check ask C# (common/showSettingsDialog), which launches it. Until the cutover, a badge on one of the old WinForms dialog's own tabs does nothing. A badge on one of the new dialog's own pages switches the open dialog to the Subscription page through Config-R's page handle (ConfigrPaneHandle.selectTopLevelPage, from Collection Settings: Help button for the page showing (BL-17032) #8489), keeping edits made so far.

Screenshots

A collection with no subscription: an empty code and the community-subscription invitation.

The Subscription page with an empty code box and the invitation to apply for a free Bloom Community Subscription

The Test code typed in: its tier, expiry and branding summary, and OK has become Restart.

The Subscription page with the Test code, a green check, Tier: Enterprise, Expires 1/1/4000, the Test branding's summary, and a Restart button

Risk Evaluation

Shared paths: CollectionSettingsUpdater.Apply now applies a posted subscription on every save, before the xmatter check (an unchanged code is a no-op). openBloomSubscriptionSettings is the one route every subscription badge in Bloom takes; it now opens the React dialog in the browser instead of asking C#. SubscriptionControls, SubscriptionStatus and useSubscriptionInfo are shared with the old dialog's tab and the Collections tab's status line; the code box now carries its own styles instead of the old tab's stylesheet. The rest is new and reached only by the new page.

Ecosystem Impact

No change to book files, published output, or the .bloomCollection format (the code is stored as before). No new strings: the page reuses the old tab's localized text; its label stays translate="no" like its sibling pages while the dialog is alpha-only. No dependency changes in this PR; it relies on @sillsdev/config-r 1.0.0-alpha.30, which #8489 (below it in the stack) brings in.

E2E Coverage

src/BloomE2E/tests/collection-settings-subscription.spec.ts (new, Notion Test Case 849), in a collection without a subscription:

  • a gated book-menu command (More › Export to Spreadsheet) opens the new dialog on the Subscription page;
  • the subscription badge on the dialog's own Bloom Library page switches it to the Subscription page;
  • a code typed and cancelled is not saved;
  • the Test code, typed and saved, turns OK into Restart, lands in the .bloomCollection, and the reopened collection is on the Enterprise tier.

Not covered: the invalid-branding startup path (nothing sets CollectionSettings.InvalidBranding today, so it cannot fire), and the Pro-in-a-Team-Collection refusal (unit-tested in CollectionSettingsUpdaterTests; the suite has no Pro code).

Notion Test Suite

Preflight report: https://bloombooks.github.io/dev-process-artifacts/deciders/bloomdesktop-bl-16734-subscription-settings.html

Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-16734

🤖 Generated with Claude Code

Devin review


This change is Reviewable

Comment thread src/BloomExe/Collection/CollectionSettingsUpdater.cs
Comment thread src/BloomBrowserUI/collection/useSubscriptionInfo.ts
Comment thread src/BloomE2E/tests/collection-settings-subscription.spec.ts
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin on 2026-10-20 18:09 UTC up to commit 350184b. It raised two bugs and one item to investigate, plus one informational note (two identical subscription lookups per keystroke; not acted on):

  • Previous subscription's bookshelf survives a code change: already tracked as BL-16904; replied and resolved.
  • Old tier shows briefly beside a new code: not an issue (local reply in milliseconds, same as the old tab); replied and resolved.
  • New journey test intermittently kills its Playwright worker: left open for the developer's decision.

Base automatically changed from BL-16736-bloom-library-collection-settings to master October 21, 2026 19:30
@andrew-polk
andrew-polk changed the base branch from master to BL-17032-settings-help-2 October 21, 2026 20:28
@andrew-polk
andrew-polk added this pull request to stack #8498 October 23, 2026 16:07
Comment thread src/BloomBrowserUI/collection/CollectionSettingsDialog.test.tsx Outdated
Comment thread src/BloomBrowserUI/collection/subscriptionSettingsTab.tsx
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 during preflight] Consulted Devin on 2026-10-23 19:01 UTC up to commit 470272e. Since the last consultation it raised two new bugs, both fixed in 470272e and now marked resolved by Devin: the test's stand-in pane used a named function, and the old Subscription tab didn't drop a late reply. Its other items repeat earlier findings already answered on their threads; one informational note (two identical lookups per keystroke) is not acted on.

@andrew-polk
andrew-polk force-pushed the BL-16734-subscription-settings branch from 470272e to bf70216 Compare October 23, 2026 20:47
Base automatically changed from BL-17032-settings-help-2 to master October 23, 2026 21:02
@StephenMcConnel
StephenMcConnel force-pushed the BL-16734-subscription-settings branch from bf70216 to 0b3558f Compare October 23, 2026 21:02
Comment thread src/BloomBrowserUI/react_components/featureStatus.ts
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5] Consulted Devin on 2026-10-23 up to commit 846e278. One new finding (old dialog's badge "throws"): not an issue, replied and resolved on its thread. Its other bugs and its worker-crash flag repeat threads already resolved; one informational note (two lookups per keystroke) not mirrored.

@andrew-polk andrew-polk left a comment

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.

@andrew-polk reviewed 26 files and all commit messages, and resolved 6 discussions.
Reviewable status: 0 of 26 files reviewed, all discussions resolved.

The page, laid out like the card's mockup, shares the code box and status line with the WinForms tab, which becomes a self-contained LegacySubscriptionSettings that the cutover deletes whole. The dialog keeps the code being typed and posts it with the other values; Apply hands it to ApplySubscriptionAndBookshelf before the xmatter check. A typed code is described by a stateless settings/subscription?code=, so Cancel leaves nothing behind.

Subscription badges and gated menu items open the dialog in the browser; a badge on the dialog's own pages switches page through Config-R's ConfigrPaneHandle, keeping edits. E2E tests: Notion Test Case 849.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrew-polk
andrew-polk force-pushed the BL-16734-subscription-settings branch from 846e278 to 2026ea4 Compare October 23, 2026 23:23
@andrew-polk
andrew-polk marked this pull request as ready for review October 23, 2026 23:25
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

Adds the Subscription page to the React Collection Settings dialog.

  • People can preview and save a subscription code in React settings.

No actionable issues were found. Tests and visual checks were not run.

Intentional behavior acknowledged by andrew-polk: badges in the old WinForms settings dialog do nothing until cutover; other pages continue to use the saved subscription; the unused invalid-branding startup check is not revived.

Reviews (1) · Last reviewed commit: "Collection Settings in React: Subscripti..." · Reviewed by Greptile

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