Skip to content

Added trial private site UI lockdown for Access settings#27963

Merged
ErisDS merged 2 commits into
mainfrom
add-trial-private-site-admin-ui
May 19, 2026
Merged

Added trial private site UI lockdown for Access settings#27963
ErisDS merged 2 commits into
mainfrom
add-trial-private-site-admin-ui

Conversation

@ErisDS
Copy link
Copy Markdown
Member

@ErisDS ErisDS commented May 19, 2026

Summary

  • When the publicSiteAccess host limit is active, the Access settings page shows a gradient "Pre-launch mode" banner with an upgrade CTA, disables the site visibility select (locked to Private), disables the access code text field, and exposes a regenerate button for the access code
  • Two separate signals gate the UI: the publicSiteAccess limit (via useLimiter) drives trial-specific messaging (banner, CTA), while isSettingReadOnly drives generic field disabling — so trial copy won't appear if settings are ever marked read-only for a different reason
  • Orange "Private" badge with lock icon appears on the Access nav item in the settings sidebar and next to the site title in the main admin sidebar header whenever the site is private
  • Improved disabled styling for Select and TextField in the design system — uses muted backgrounds and subtle rings instead of opacity wash
  • Added publicSiteAccess to the host settings limits type definition

Lifts the UI from the spike on codex/trial-private-site-simulator-demo, wired to real limit and settings signals instead of the localStorage simulator.

Depends on #27917 (merged) for the is_read_only field on settings. The regenerate endpoint is a follow-up (sends password: null via Settings edit for now).

Test plan

  • With publicSiteAccess limit active: banner shown, visibility select disabled and locked to Private, access code field disabled, regenerate button visible, RSS hint hidden
  • Without the limit: all controls editable, no banner, no regenerate button change in behaviour
  • Private badge visible in settings sidebar and admin sidebar header when site is private
  • Design system: disabled Select and TextField render with muted bg + ring, no opacity wash
  • Existing acceptance tests pass (79 passed, 0 failures)

🤖 Generated with Claude Code

When the publicSiteAccess limit marks is_private and password as
read-only, the Access settings page now shows a pre-launch banner,
disables the site visibility select and access code field, and
exposes a regenerate button for the access code. Private badges
appear in both the settings sidebar and the main admin sidebar
header. Design system disabled styling improved to use muted
backgrounds and subtle rings instead of opacity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

Walkthrough

This PR updates the form component disabled styling and implements private site access control across the admin interface. It refines the Select and TextField components to use explicit text colors and shadow effects instead of opacity for disabled states. The membership access UI adds a locked state that prevents modification when is_private or password settings are read-only, disables relevant controls, and provides an async regenerate access code action. The sidebar and app header now display a visual "Private" badge when the site is set to private mode, providing users with a clear indicator of the current access setting.

Possibly related PRs

  • TryGhost/Ghost#27917: Marks is_private and password settings as read-only in the Settings API to enforce pre-launch mode constraints, which directly aligns with this PR's locked state implementation that disables these controls when read-only.
  • TryGhost/Ghost#27920: Adds boot-time enforcement and handling for publicSiteAccess and access-code generation/limits, which relates to this PR's UI and config typing changes for publicSiteAccess.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding trial private site UI lockdown for Access settings, which is reflected throughout the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly outlines the changes: trial UI lockdown for Access settings, Private badge additions, design system improvements, and detailed test plan with specific scenarios.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-trial-private-site-admin-ui

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

@ErisDS ErisDS added the preview Deploy a PR preview environment label May 19, 2026
@Ghost-Slimer Ghost-Slimer temporarily deployed to pr-preview-27963 May 19, 2026 13:45 Destroyed
…field disabling

The banner and overflow styling are trial-specific (gated on publicSiteAccess
limit), while field disabling is generic (gated on isSettingReadOnly). This
prevents trial-specific messaging from appearing if settings are ever marked
read-only for a different reason.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ErisDS ErisDS merged commit e8dd8ca into main May 19, 2026
41 checks passed
@ErisDS ErisDS deleted the add-trial-private-site-admin-ui branch May 19, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Deploy a PR preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants