Commit Graph

2223 Commits

Author SHA1 Message Date
Zeno Kapitein d414f09b36 Merge branch 'main' into claude/tender-allen-f9l6hh 2026-07-14 20:25:28 +02:00
Zeno Kapitein e77bf32d51 Update customer e2e test URL after redirect (#4398)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 18:24:14 +00:00
Zeno Kapitein be0d5d25f0 Re-assert scroll to anchor so cross-page links land on target (RND-11844)
A cross-page anchor link navigated to the right page but stayed at the top.
GitBook's `scrollToHash` scrolled once, but a soft navigation delivers the
destination asynchronously — content keeps mounting and reflowing for a few
hundred ms after the URL changes — so the single scroll landed before the
target reached its final position, and #4089 routed cross-section navigations
through it. It also scrolled to the top on a transiently-empty hash context.

- scrollToHash re-scrolls to the target on each DOM change until the DOM goes
  quiet, mirroring the fragment scrolling the browser does for free during a
  full page load. It bails if the visitor scrolls, so we never fight them.
- useScrollPage decides the hash from the context value for same-page anchors
  (authoritative, set on click) and from `window.location.hash` for cross-page
  navigations (where the context hash is transiently empty during the remount).

Next keeps handling the baseline scroll (top on plain/query navigations, the
top fallback for missing anchors); GitBook only re-asserts the hash scroll it
would otherwise land too early on.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 19:36:10 +02:00
Claude 105c1d337a Simplify anchor scroll retry to a single bounded loop (RND-11844)
Collapse scrollToHash to one requestAnimationFrame loop: scroll to the target whenever
it's present, retrying ~1s for it to commit and holding ~0.3s afterward so we scroll
after Next's late scroll-to-top. Drops the separate wheel/touchmove/keydown abort
machinery — the hold window is short enough that a user scrolling within it is a rare,
brief edge, not worth the ceremony.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpGe6QkAF4Y1HDGUD4vbke
2026-07-14 14:49:41 +00:00
Claude a219ad87d9 Hold the anchor scroll against Next's late scroll reset (RND-11844)
Browser diagnostics on the reported n8n case identified the actual blocker. Our scroll
now fires once the target heading commits, but Next's scroll restoration fires a
`window.scrollTo(0, 0)` *after* it during the client navigation, so a one-shot
scrollIntoView loses — whoever scrolls last wins, and Next scrolls last. This is why
none of retry-only / `scroll={false}` / their combination worked: they all scrolled once.

Rework `scrollToHash` to (a) retry across frames until the element exists, then (b)
re-assert the scroll for a short window (~0.3s) so it survives the late reset, bailing
immediately if the user scrolls (wheel / touchmove / keydown) so it never hijacks intent.
Use `behavior: 'instant'` — a smooth animation is trivially interrupted by the reset, and
re-asserting an already-reached instant scroll is a no-op. `scroll={false}` on the Link is
reverted: it neither stopped the reset nor was needed once we out-last it, and it churned
unrelated navigation-scroll behavior.

Still needs a browser check: the console diagnostic should now show scrollY settling on
the heading with no trailing scroll-to-top winning. Regression pass: same-page anchors,
plain page-to-page nav (top), back/forward.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpGe6QkAF4Y1HDGUD4vbke
2026-07-14 13:59:38 +00:00
Claude 2e182fd111 Make GitBook the sole scroll authority so cross-page anchors land on target (RND-11844)
Browser diagnostics on the reported n8n case showed two cooperating causes, which is
why the earlier single-sided attempts failed:

1. The scroll hooks fire when the hash is set (on link click, still on the previous
   page), so the target heading isn't in the DOM yet and scrollToHash missed and never
   retried. Fixed in the previous commit by retrying scrollToHash across frames.
2. With the retry in place, our scrollIntoView *does* fire once the heading commits —
   but Next's own post-navigation scroll (its hash scrollIntoView plus a scroll-to-top,
   see useHash / vercel/next.js#49465) runs after us and wins, snapping back to the top.

Set `scroll={false}` on the internal NextLink so Next stops managing scroll on
client-side navigation and GitBook's ScrollPage/useScrollToHash own it exclusively:
retry to the hash when present, scroll to top otherwise. Neither change works alone —
the retry needs Next to stop overriding it, and scroll={false} needs the retry to find
the late-committing element.

Still needs a browser check: rerunning the console diagnostic should now show our
scrollIntoView fire without a following scroll-to-top, landing on the heading. Because
scroll={false} routes all navigation scroll through ScrollPage, also regression-check
plain page-to-page nav (top), same-page anchors, and back/forward.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpGe6QkAF4Y1HDGUD4vbke
2026-07-14 13:49:37 +00:00
Claude c2d18048f1 Retry scrollToHash until the target commits, fixing cross-page anchors (RND-11844)
Browser diagnostics on the reported n8n case showed the real cause: the scroll
hooks fire when the hash is set (on link click, still on the previous page), so
`document.getElementById(hash)` misses; by the time the destination heading is in
the DOM, `scrollToHash` is never called again, so the page stays at the top. Next's
own scroll was never involved — an earlier `scroll={false}` attempt changed nothing
and is reverted here.

Make `scrollToHash` retry across animation frames (bounded to ~1s) until the target
element exists, then scroll to it once. A single in-flight retry is tracked and
cancelled if a newer scroll is requested. Hash-less navigation is unaffected
(ScrollPage scrolls to top directly, without calling scrollToHash).

Still needs a browser check: rerunning the console diagnostic should now show
`scrollIntoView` firing on the attempt where the element resolves.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpGe6QkAF4Y1HDGUD4vbke
2026-07-14 13:36:01 +00:00
Claude 06132fe0f0 Own scroll-on-navigation instead of Next's default, so cross-page anchors land on target (RND-11844)
The first attempt (re-running useScrollToHash on `pathname`) had no effect: the
root-layout `ScrollPage` hook already called `scrollToHash` on every hash+pathname
change, so the scroll was firing — but Next's own default post-navigation scroll
(App Router hash handling is unreliable, see useHash / vercel/next.js#49465) runs
after it and scrolls to top, overriding us. Same-page anchors are unaffected because
Link.tsx handles those manually with preventDefault (no NextLink scroll), and direct
URL loads work via the browser's native hash scroll — which matches the reported
behavior.

Set `scroll={false}` on the internal NextLink so Next stops managing scroll on
client-side navigations; GitBook's ScrollPage then owns it (scroll to the hash when
present, else to the top). Revert the redundant `pathname` dependency added in the
previous commit.

Not verified in a browser: this sandbox's network policy blocks the preview
deployment and the GitBook API, so it needs a browser check on a site with
cross-page anchor links (e.g. n8n) plus a regression pass on ordinary navigation
scroll-to-top and back/forward restoration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpGe6QkAF4Y1HDGUD4vbke
2026-07-14 10:58:34 +00:00
Claude 0146877fc1 Fix anchor links not scrolling to target on client-side navigation (RND-11844)
Cross-page anchor links (e.g. a homepage card linking to `/page#heading`)
landed at the top of the destination page on soft navigation, while the same
URL loaded directly scrolled to the heading correctly.

`useScrollToHash` (the per-page safety net in PageClientLayout that scrolls
once the page blocks are rendered) only depended on the navigation hash. The
hash is set at click time while the previous page is still mounted, so the
effect fired before the target element existed. Because sibling pages share the
same `[pagePath]` route, PageClientLayout is reused rather than remounted, so
the effect never re-ran once the destination content committed to the DOM.

Add `pathname` as a dependency so the scroll is re-attempted when the
destination page commits and the target heading is present. The `if (hash)`
guard is unchanged, so hash-less navigations still scroll to top via ScrollPage
and back/forward restoration is unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TpGe6QkAF4Y1HDGUD4vbke
2026-07-14 00:17:19 +00:00
Zeno Kapitein a69a307de2 Take a near-neutral extreme tint as the exact site background (#4392) 2026-07-13 20:37:08 +02:00
Zeno Kapitein 39156ee9c3 Support button sizes in the button block (#4394)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 20:03:52 +02:00
spastorelli 47ac3e2c81 Only advertise OAuth PRM doc for the auth MCP endpoint on non-VA sites (#4387) 2026-07-10 15:24:33 +02:00
Zeno Kapitein e73b182925 Declare embed standalone bundle as a Turbo build output (RND-11876) (#4386)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-10 13:51:48 +02:00
claude[bot] a9a52fee72 RND-11356: remove redundant GBO best-section re-selection (#4375)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Zeno Kapitein <zeno@gitbook.io>
2026-07-10 13:25:26 +02:00
Greg Bergé cb92754575 Add a navigate action to integration block webframes (#4362)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 11:24:33 +02:00
Zeno Kapitein 49d35aa026 Let visitors type a follow-up while the Assistant is answering (RND-11789) (#4377)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-09 21:00:01 +02:00
Nolann B. 98b2df42ef Add sendFeedback MCP tool for reporting documentation findings (#4384)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-09 15:17:32 +02:00
Zeno Kapitein 6cf4278f14 Only show "Back to [space]" for table-of-contents cross-space links (#4381)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 14:32:11 +02:00
Zeno Kapitein 86c44299eb docs(agents): discourage multi-line block comments (#4382)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-09 14:16:26 +02:00
claude[bot] 89c4a0f808 feat(mcp): add askQuestion tool to the site MCP server (#4372)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Zeno Kapitein <zeno@gitbook.io>
2026-07-09 13:11:05 +02:00
Nolann B. 8e9a49de1a Separate prompt block actions (#4379) 2026-07-08 16:11:26 +02:00
Zeno Kapitein 4e9071d1b5 Fix docs embed navigateToPage for cross-space/section deep links (#4374)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 11:02:49 +02:00
Nolann B. 597fe34d3b Sync responses selector with the Responses collapsibles (#4376) 2026-07-08 09:08:21 +02:00
claude[bot] e14609cb3e fix(theme): resolve system theme before first paint to avoid dark/light flash (RND-11643) (#4373)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-07 20:10:02 +02:00
Zeno Kapitein 57f3077006 Keep the page outline and Ask button in view while scrolling API reference pages (#4371)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 19:10:55 +02:00
conico974 e24632c80b Integrate GitBook image resizing service and remove cdn-cgi mode (#4285) 2026-07-07 16:21:32 +02:00
Zeno Kapitein ad3399b42e Refine the per-paragraph ask button (shorter tooltip, hide inside cards) (#4365)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 19:27:04 +02:00
Brett Jephson f3408ed495 A11y fix: table structure (#4368) 2026-07-06 16:58:23 +01:00
Brett Jephson 8676ad19e2 RND-11788: hide unlabelled button from screen readers (#4369) 2026-07-06 16:58:02 +01:00
Samy Pessé 3a31100efe Version Packages (#4335)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-06 12:52:44 +00:00
Greg Bergé 3fedaaa08c Install eval-estree-expression from npm instead of a GitHub commit (#4367)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 12:31:54 +00:00
Nolann B. bcea23e886 Handle nullable expressed via anyOf/oneOf with a null member (#4366) 2026-07-06 12:33:02 +02:00
Zeno Kapitein fdea8f1c47 Show section, variant & section groups in page breadcrumbs (#4357)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 11:49:47 +02:00
Zeno Kapitein 139b897521 Improve language selector on mobile (#4361) 2026-07-06 11:03:39 +02:00
Greg Bergé 37c2dd8819 Fix flaky customer screenshots caused by the cookie banner (#4363)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 22:06:20 +02:00
Zeno Kapitein 62ca6d3ce5 Show a "Back to [space]" shortcut when a link leads to another space (#4358)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-03 12:36:07 +02:00
Nolann B. 6102413d6b Reuse shared AI mode helpers across AI actions and UI (#4355) 2026-07-02 23:19:07 +02:00
Zeno Kapitein eaef259a80 Refresh e2e customer list (#4360)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 19:34:09 +02:00
Zeno Kapitein 578a3a829b Fix section tab dropdowns clipping their contents during animation (#4356)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 12:06:41 +00:00
Zeno Kapitein c923c654bd Fix centered paragraphs shifting left with the paragraph ask button (#4354)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 12:19:24 +02:00
Nolann B. 65fd3cc101 Gate AI features server-actions (#4353) 2026-07-02 11:37:03 +02:00
Zeno Kapitein bb30db105d Add a margin button to ask the assistant about a paragraph (#4328) 2026-07-02 08:34:49 +02:00
Nolann B. 6146f8e183 Reduce oversized searchDocumentation MCP responses (#4352) 2026-07-01 18:00:02 +02:00
Nolann B. 7e55cd5e4c Add "Available in MCP" badge for OpenAPI operations (#4350) 2026-07-01 17:38:04 +02:00
conico974 cb2dfa76af Keep first 3 remote results pinned at the top (#4349) 2026-06-30 13:47:04 +02:00
Viktor Renkema 77efd449ae Allow quickly viewing which pages have changed in a CR/revision (#4348) 2026-06-30 12:49:31 +02:00
Zeno Kapitein af259fbe86 Scrap recommended questions from Search e2e test (#4351) 2026-06-30 12:29:21 +02:00
conico974 2b31b0213c Refactor error handling and remove unused caching logic (#4345) 2026-06-30 08:16:23 +02:00
Nolann B. f60afe1b25 Add missing MCP annotations (#4347) 2026-06-29 10:15:57 +02:00
Nolann B. b7c3b847e8 Prevent insights tracking failures from breaking MCP tool requests (#4346) 2026-06-27 09:31:20 +02:00