Skip to content

✨ Added controls to put pages in your site navigation#28727

Open
luissazevedo wants to merge 2 commits into
TryGhost:mainfrom
luissazevedo:page-navigation-placement
Open

✨ Added controls to put pages in your site navigation#28727
luissazevedo wants to merge 2 commits into
TryGhost:mainfrom
luissazevedo:page-navigation-placement

Conversation

@luissazevedo

Copy link
Copy Markdown
Contributor

Why
New publishers create pages (About, Contact…), view their site, and can't find them — pages aren't in navigation by default, and the only way to add them is a separate trip to Settings → Navigation. A quiet onboarding dead-end.

What it does

  • Publish flow — choose a page's placement (Primary / Secondary / None) as you publish it, when discoverability matters most
  • Pages list — an in-nav indicator shows which published pages are linked, plus a right-click action to add / move / remove
  • Settings → Navigation — unchanged; still the home for ordering and non-page links

Design notes

  • Navigation is treated as something you manage in its own right, not a property of a page — so it's intentionally not in page settings.

Testing — acceptance tests across the publish flow, pages list, and the navigation util; lint clean. No schema change, no migration.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a5e7def5-b59a-40f6-99aa-e61c4dcfaebe

📥 Commits

Reviewing files that changed from the base of the PR and between d374fc2 and 84b80c4.

⛔ Files ignored due to path filters (3)
  • ghost/admin/public/assets/icons/navigation-primary.svg is excluded by !**/*.svg
  • ghost/admin/public/assets/icons/navigation-remove.svg is excluded by !**/*.svg
  • ghost/admin/public/assets/icons/navigation-secondary.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • ghost/admin/app/components/posts-list/context-menu.hbs
🚧 Files skipped from review as they are similar to previous changes (1)
  • ghost/admin/app/components/posts-list/context-menu.hbs

Walkthrough

This PR adds site navigation placement management for Ghost pages. A new site-navigation.js utility module provides URL normalization, placement reading (getPagePlacement, pagePathForSlug), and async placement writing (setPageNavigationPlacement, setPagesNavigationPlacement) with settings revert on failure. PublishOptions gains tracked navigation state and seven derived getters; saveTask is extended to conditionally persist placement after a successful post save and record failures separately without aborting publish. The publish flow modal receives a new NavigationOption Glimmer component and an expandable navigation section in the options step, plus updated confirm-step copy to display the selected placement. The posts-list context menu gains add/move/remove navigation actions gated on admin role and published-page status. A navigation placement indicator is added to the posts-list item view. Supporting CSS updates accommodate the wider context menu and new indicator styling. Comprehensive acceptance and unit tests verify indicator visibility, context menu behavior, publish flow placement selection and persistence, republish pre-selection, modal state discard, authorization restrictions, and failure handling.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately summarizes the main change: adding navigation controls for pages during publishing, which is the primary feature introduced across the changeset.
Description check ✅ Passed The PR description comprehensively explains the motivation, implementation details, and design rationale, directly relating to the changeset's focus on navigation placement controls for pages.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@nx-cloud

nx-cloud Bot commented Jun 18, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 84b80c4

Command Status Duration Result
nx run ghost-admin:test ✅ Succeeded 2m 57s View ↗
nx run @tryghost/admin:build ✅ Succeeded 2m 6s View ↗
nx run-many -t lint -p ghost-admin ✅ Succeeded 20s View ↗
nx run ghost:build:assets ✅ Succeeded 2s View ↗
nx run ghost:build:tsc ✅ Succeeded 6s View ↗
nx run-many --target=build --projects=@tryghost... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-19 15:06:43 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ghost/admin/app/styles/layouts/content.css`:
- Line 1040: The stroke property on line 1040 uses currentColor which violates
the value-keyword-case stylelint rule. Fix this by changing currentColor to
match the configured case requirement, typically converting it to lowercase
currentcolor to comply with the stylelint configuration.

In `@ghost/admin/app/utils/site-navigation.js`:
- Around line 35-37: The condition in the navigation filtering logic does not
properly handle the case when siteOrigin is null or undefined. Currently, if
siteOrigin is falsy, absolute URLs can still be processed and matched by
pathname alone, which is incorrect. Modify the condition to return null not only
when the origin doesn't match, but also when the URL is absolute (not relative)
but siteOrigin is missing or invalid. This ensures that absolute URLs without a
valid siteOrigin to compare against are properly rejected as external links.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d89461fa-cd0d-4fad-8513-9bd855f9537c

📥 Commits

Reviewing files that changed from the base of the PR and between 3beaec1 and 95b7bdd.

⛔ Files ignored due to path filters (1)
  • ghost/admin/public/assets/icons/navigation.svg is excluded by !**/*.svg
📒 Files selected for processing (15)
  • ghost/admin/app/components/editor/modals/publish-flow/confirm.hbs
  • ghost/admin/app/components/editor/modals/publish-flow/options.hbs
  • ghost/admin/app/components/editor/publish-management.js
  • ghost/admin/app/components/editor/publish-options/navigation.hbs
  • ghost/admin/app/components/editor/publish-options/navigation.js
  • ghost/admin/app/components/posts-list/context-menu.hbs
  • ghost/admin/app/components/posts-list/context-menu.js
  • ghost/admin/app/components/posts-list/list-item-analytics.hbs
  • ghost/admin/app/components/posts-list/list-item-analytics.js
  • ghost/admin/app/styles/components/dropdowns.css
  • ghost/admin/app/styles/layouts/content.css
  • ghost/admin/app/utils/publish-options.js
  • ghost/admin/app/utils/site-navigation.js
  • ghost/admin/tests/acceptance/content-test.js
  • ghost/admin/tests/acceptance/editor/publish-flow-test.js

Comment thread ghost/admin/app/styles/layouts/content.css Outdated
Comment thread ghost/admin/app/utils/site-navigation.js Outdated
@luissazevedo luissazevedo force-pushed the page-navigation-placement branch from 95b7bdd to cbdfc24 Compare June 19, 2026 10:32
no ref

- pages aren't in navigation by default, so a newly published page is easy to
  miss on your site — a common onboarding dead-end
- you can now set a page's placement while publishing it, and manage it from the
  pages list (an in-nav indicator plus a context-menu action to add, move or
  remove); Settings → Navigation stays the home for ordering and non-page links
- navigation is treated as something you manage in its own right rather than a
  property of a page, so it's intentionally not in page settings
@luissazevedo luissazevedo force-pushed the page-navigation-placement branch from cbdfc24 to d374fc2 Compare June 19, 2026 10:36
Previously the "add to primary" and "add to secondary" actions shared the
same navigation icon, and "remove" reused the generic close (×) icon — which
read as a delete next to the existing red trash Delete item.

Gave each action its own glyph on a shared page frame so they read as a set:
- navigation-primary: page with a top bar
- navigation-secondary: page with a bottom bar
- navigation-remove: page with a minus-in-circle (removal, not deletion)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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