Improve isolated build UX and fix git worktree serve#3210
Conversation
Header: light grey gradient with bottom border and shadow, replacing the blue background. GitHub link and deployment-info buttons share a muted grey gradient style with blue hover, using the system monospace font stack. Logo hover uses a subtle dark tint with consistent vertical padding. Nav: index page now surfaces as the first nav item using navigation_title from YAML front matter. Single-item breadcrumbs are hidden (no navigation value). Breadcrumb vertical padding reduced from py-6 to pt-4/pb-2. Sidebar: version selector, report-a-docs-issue, and learn-how-to-contribute are now gated on PrimaryNavEnabled so they don't show in isolated builds. Bug fixes: root page View-as-Markdown URL was .md, now correctly /index.md. h1 gains mt-6 top margin. FileSystemFactory.RealGitRootForPath adds the main repo's .git directory to scope roots when running from a git worktree, fixing ScopedFileSystemException when serving docs from a worktree checkout. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request adjusts git-root scoping in FileSystemFactory to correctly handle git worktrees by deriving an initial root from Sequence Diagram(s)sequenceDiagram
participant Caller
participant FileSystemFactory
participant WorkingDirectoryRoot
participant FileSystem
Note over FileSystemFactory,WorkingDirectoryRoot: ResolveRealGitRoot(path)
Caller->>FileSystemFactory: ResolveRealGitRoot(path)
FileSystemFactory->>WorkingDirectoryRoot: derive initial root (if path == null)
FileSystemFactory->>FileSystem: collect roots (app data, initial root, path)
FileSystem->>FileSystem: check for `.git` file at root
alt `.git` file is a worktree pointer
FileSystem->>FileSystem: read `gitdir:` target from `.git` file
FileSystem->>FileSystemFactory: return main repo .git path
FileSystemFactory->>FileSystemFactory: add main repo .git to allowed roots
end
alt path == null and no extra worktree scope added
FileSystemFactory->>Caller: return existing RealRead (fast path)
else
FileSystemFactory->>FileSystem: create ScopedFileSystem with expanded roots
FileSystem->>Caller: return ScopedFileSystem
end
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
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. Review rate limit: 0/1 reviews remaining, refill in 41 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Elastic.Documentation.Site/Navigation/_TocTreeNav.cshtml`:
- Around line 9-21: The top-level index item is rendered unconditionally under
the isTopLevel branch, bypassing hidden-item filtering; update the conditional
to also check the index hidden flag (e.g. only render when isTopLevel &&
!Model.SubTree.Index.Hidden — or !Model.SubTree.Index.IsHidden if that property
is used) so the Index (Model.SubTree.Index) link (NavigationTitle with
Htmx.GetNavHxAttributes) is skipped when marked hidden.
🪄 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: Enterprise
Run ID: d7ce87d9-7714-4cf9-af9a-01cee44e1caf
📒 Files selected for processing (9)
src/Elastic.Documentation.Configuration/FileSystemFactory.cssrc/Elastic.Documentation.Site/Assets/markdown/typography.csssrc/Elastic.Documentation.Site/Assets/web-components/Header/DeploymentInfo.tsxsrc/Elastic.Documentation.Site/Assets/web-components/Header/Header.tsxsrc/Elastic.Documentation.Site/Navigation/_TocTree.cshtmlsrc/Elastic.Documentation.Site/Navigation/_TocTreeNav.cshtmlsrc/Elastic.Markdown/HtmlWriter.cssrc/Elastic.Markdown/Layout/_Breadcrumbs.cshtmlsrc/Elastic.Markdown/Layout/_TableOfContents.cshtml
Index item in nav: only render when not hidden, not in assembler/primary-nav builds. Breadcrumb single-item suppression scoped to isolated builds only; breadcrumb py-6 padding restored to match production. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The mt-6 on h1 compounded the breadcrumb's pb-6, pushing h1 24px lower than production on assembler builds. Remove mt-6 from h1 and instead add pt-6 to the content wrapper only when no breadcrumb is visible (isolated builds with a single-crumb or zero-crumb page). This gives isolated landing pages breathing room while leaving assembler/multi-crumb pages unchanged. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The EUI theme types don't expose a `colors.ink` property — `colors.textInk` is the correct token. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/Elastic.Documentation.Site/Assets/web-components/Header/DeploymentInfo.tsx`:
- Around line 72-77: The popover trigger button in the DeploymentInfo component
lacks an explicit type, which can cause it to submit an enclosing form; update
the JSX button (the element that calls onClick={() => setIsOpen(prev => !prev)}
and uses headerButtonCss(euiTheme)) to include type="button" so it will not act
as a submit button inside forms.
🪄 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: Enterprise
Run ID: 7922b43a-af5e-4cc9-9162-a22e005bd001
📒 Files selected for processing (2)
src/Elastic.Documentation.Site/Assets/web-components/Header/DeploymentInfo.tsxsrc/Elastic.Documentation.Site/Assets/web-components/Header/Header.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/Elastic.Documentation.Site/Assets/web-components/Header/Header.tsx

Why
The isolated build output had several issues that made it feel rough for developers previewing their own docs repo. The header was styled for the full Elastic docs experience (blue, full nav items like version selector and report-issue link) rather than a lightweight local preview. The sidebar lacked a home/landing link. The `serve` command crashed when run from a git worktree because the scoped filesystem blocked reads from the main repo's `.git` directory.
What
Header: replaced the blue background with a light grey gradient (border + shadow). The GitHub link and deployment-info button now share a muted grey button style (system monospace font, blue on hover) so they look intentional rather than leftover. Logo hover is tightened to match the button vertical rhythm.
Navigation: the index page now surfaces as the first nav item using `navigation_title` from YAML front matter (e.g. "Introduction"). Single-item breadcrumbs are suppressed since they serve no navigation purpose. Breadcrumb vertical padding is reduced. h1 gains top margin.
Sidebar cleanup: version selector, "Report a docs issue", and "Learn how to contribute" are now gated on `PrimaryNavEnabled` so isolated builds don't show Elastic-specific links that don't apply to arbitrary repos.
Bug fixes: the "View as Markdown" link on the root page produced `.md` instead of `/index.md`.
Worktree fix: `FileSystemFactory.RealGitRootForPath` now detects when the repo root contains a git worktree pointer file (`.git` as a file rather than a directory), resolves the main repo's `.git` directory, and adds it as an extra scope root — allowing `GitCheckoutInformation` to read `config` and `HEAD` without a `ScopedFileSystemException`.