Skip to content

Rework page layout#4013

Merged
zenoachtig merged 31 commits intomainfrom
page-layout-rework
Apr 13, 2026
Merged

Rework page layout#4013
zenoachtig merged 31 commits intomainfrom
page-layout-rework

Conversation

@zenoachtig
Copy link
Copy Markdown
Contributor

@zenoachtig zenoachtig commented Feb 16, 2026

  • Standardized layout state via Tailwind variants: the branch introduces two layout mode variants (layout-default, layout-wide) and uses body:has(.layout-*) selectors to drive responsive structure consistently.
  • Added CONTENT_STYLE to centralize content width rules: separates “site chrome” sizing (CONTAINER_STYLE) from the actual page content max-width, so multiple components share the same width logic.
  • Replaced per-component width overrides with layout-mode-driven constraints: PageBody now determines wideLayout once (page config + full-width blocks) and applies CONTENT_STYLE + layout-* classes, reducing ad-hoc max-w-* / special-case overrides.
  • Reworked both sidebars around the new layout modes: left TOC/sidebar gets no-sidebar / has-sidebar behavior with minimal/fixed variants in wide layout, and the right outline is refactored into a proper SideSheet with overlay/close + explicit “outline open” state.

Deliberate effects of this rework:

  • When one block is wide, the page is wide. The page layout treats a single wide block the same as the wide page-layout option. No more individual blocks to adjust. While this is technically a reduction of block options, in practice this results in more uniform layouts and the system functioning as people expect.
  • When the page is wide, all blocks that can be wide are wide as well.
  • Moving "On this page" into a side sheet will result in the page outline being available on mobile screens as well.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 1bd8448

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
gitbook Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@argos-ci
Copy link
Copy Markdown

argos-ci bot commented Feb 16, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) 👍 Changes approved 119 changed Apr 13, 2026, 10:00 AM
customers-v2-vercel (Inspect) 👍 Changes approved 119 changed Apr 13, 2026, 9:59 AM
v2-cloudflare (Inspect) 👍 Changes approved 493 changed Apr 13, 2026, 10:07 AM
v2-vercel (Inspect) 👍 Changes approved 503 changed Apr 13, 2026, 10:04 AM

Copy link
Copy Markdown

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

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: 87443dbac8

ℹ️ 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 thread packages/gitbook/src/components/Embeddable/EmbeddableDocsPage.tsx Outdated
Copy link
Copy Markdown
Contributor

@viktorrenkema viktorrenkema left a comment

Choose a reason for hiding this comment

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

lgtm!

Comment thread packages/gitbook/e2e/internal.spec.ts Outdated
Comment thread packages/gitbook/src/components/PageAside/PageAside.tsx Outdated
Comment thread packages/gitbook/src/components/PageAside/PageAside.tsx
Comment thread packages/gitbook/src/components/PageAside/PageAsideButton.tsx
Comment thread packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx
Comment thread packages/gitbook/tests/rss.test.ts Outdated
@zenoachtig zenoachtig merged commit 709964f into main Apr 13, 2026
17 checks passed
@zenoachtig zenoachtig deleted the page-layout-rework branch April 13, 2026 12:48
clairechabas added a commit that referenced this pull request Apr 13, 2026
clairechabas added a commit that referenced this pull request Apr 15, 2026
…ngs-in-page-outline

* main:
  Make ToC groups collapsible and other styles fixes/improvements (#4177)
  Fix HTML lang attribute not reflecting language variants (#4186)
  Docs Embed: Better support light/dark mode overrides (#4181)
  Translations dropdown should show language spaces that best matches the current space title (#4184)
  Fix llms.txt and llms-full.txt language variants filtering (#4179)
  Hide empty sidebar on OpenAPI pages (#4180)
  Rework page layout (#4013)
  Version Packages (#4163)
  Fix toolbar design (#4175)
  Extend gitbook/expr std lib with some additional methods (#4173)
  Prepare for step.content to be optional (#4174)
  Refactor test setup for improved mock restoration (#4176)
  Reduce search debounce (#4170)
  Exclude language variants from llms.txt and llms-full.txt (#4165)
  Fix MCP getPage tool returning page not found (#4166)
  Expose a ~gitbook/mcp/auth endpoint for non-VA adaptive content sites (#4155)
  Improve AI agent detection and readability by outputting 200 for page not found (#4164)
  Respect locale to format date in update block (#4160)
  Fix HTML lang attribute not reflecting site language variants (#4161)
  Improve Assistant form controls, i18n, and UX (#4159)
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.

2 participants