Skip to content

fix(search): fetch head sha client only - #50

Merged
larbish merged 1 commit into
mainfrom
fix/fetch-head-client-only
Sep 18, 2026
Merged

larbish merged 1 commit into
mainfrom
fix/fetch-head-client-only

Conversation

@larbish

@larbish larbish commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

The search index SHA was fetched during SSR, so it got baked into each page's ISR cache entry => landing on a page whose cached entry predated a content push pinned search to the old commit for the whole session.

Now fetched client-side only (server: false), so it always reflects the current head.

Also: the search button and palette always render instead of being gated on the SHA resolving.

Summary by CodeRabbit

  • New Features

    • Search controls now appear consistently on desktop and mobile whenever enabled in the header configuration.
    • Search initialization can wait for content metadata to become available before loading.
  • Bug Fixes

    • Improved navigation loading behavior during client-side transitions.
    • Content metadata failures are handled gracefully without blocking page rendering.

@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 17, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~3 changed · 🔴 -0 removed · 1 flow · 5 files · commit f13762d


Architecture

Architecture diagram for comarkdown/comark-docs at f13762d

3 components touched across 3 lanes.

Open the interactive canvas


Data flow

Data flow diagram for comarkdown/comark-docs at f13762d

Client head SHA resolution and search warmup

Open the interactive canvas


View

  • Architecture lens
  • Data flow lens
  • Expand every detail

Tip

Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds.

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists.
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through.
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change.
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time.
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time.
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs on every push.
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works.
  • Push a commit and the comment redraws for the new head. A slow older run never overwrites a newer one.
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion.

Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
comark-docs-layer Ready Ready Preview Sep 17, 2026 3:32pm UTC

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e9a413b7-63a2-49b0-b0e8-a8c35e965b7e

📥 Commits

Reviewing files that changed from the base of the PR and between 50691be and f13762d.

📒 Files selected for processing (5)
  • app/app.vue
  • app/components/AppHeader.vue
  • app/components/AppSearch.vue
  • app/composables/useSearch.ts
  • app/error.vue

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The change separates navigation and SHA loading, defers search warmup until SHA resolution, and removes availability checks from the search composable and related components.

Changes

Search loading flow

Layer / File(s) Summary
Separate navigation and SHA loading
app/app.vue, app/error.vue
Navigation loading remains awaited and watches routeBase. SHA lookup runs only on the client, watches apiBase, logs failures, and returns null.
Defer search warmup until SHA resolution
app/composables/useSearch.ts
useSearch accepts an undefined SHA during resolution. warmup waits until the SHA resolves, and the returned API no longer includes available.
Render search from header configuration
app/components/AppHeader.vue, app/components/AppSearch.vue
Desktop and mobile search controls use header?.search. LazyUContentSearch renders without an availability guard.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: atinux

Merge Risk: ⚪ Minimal · up to f1376

No confirmed merge-blocking risk remains in the changed search loading flow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fetching the search head SHA on the client only.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (4 skipped: 4 …
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/app.vue

Oops! Something went wrong! :(

ESLint: 10.10.0

A configuration object specifies rule "@typescript-eslint/no-explicit-any", but could not find plugin "@typescript-eslint".

Common causes of this problem include:

  1. The "@typescript-eslint" plugin is not defined in your configuration file.
  2. The "@typescript-eslint" plugin is not defined within the same configuration object in which the "@typescript-eslint/no-explicit-any" rule is applied.
app/components/AppHeader.vue

ESLint skipped: the matched ESLint configuration already failed (unknown).

app/components/AppSearch.vue

ESLint skipped: the matched ESLint configuration already failed (unknown).

  • 2 others

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 17, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/comarkdown/comark-docs@50

commit: f13762d

@larbish
larbish merged commit 1ebca7c into main Sep 18, 2026
7 checks passed
@larbish
larbish deleted the fix/fetch-head-client-only branch September 18, 2026 08:07
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