Files
OpenViking/docs/.vitepress/theme
t0saki 5c09e61ce8 feat(docs): entry pill + push rail for VikingBot (#3978)
Brings the docs onto the widget's v2 contract, and restores the push layout
the site had before the migration to the shared widget.

The navbar trigger is gone. The widget renders its own bottom entry pill and
right-edge toggle, which is now the single entry point across the marketing
site, the docs and the blog instead of a per-site invention — and it lets a
reader start typing before the panel exists. VikingBotAssistant.vue existed
only to be that button, so it goes with it.

The loader is a plain module rather than a component: with no trigger to
render there is nothing for Vue to own. It mounts once per page load on an
idle callback (2.5s timeout fallback for Safari < 16.4) — the widget is an
assistive affordance, not documentation, and must not compete with the page
for bandwidth. Locale comes from <html lang>, which survives a configured
`base`, unlike matching the pathname against '/zh'; a locale switch is a
client-side route change, so onAfterRouteChanged remounts the widget in the
language the reader just picked.

custom.css grows the host half of the push contract, ported from the layout
this site had before #3939 — `.Layout` and `.VPNav` inset by `--ov-rail`, the
navbar title released from its sidebar-anchored absolute position, doc padding
retuned. Two differences from the old recipe:

- The breakpoint moves 768px -> 900px, matching the widget's own sheet
  breakpoint. Below it the panel is a bottom sheet and there is no rail.
- The old recipe hid navbar controls between 768 and 1279 to make room for the
  VikingBot button. There is no button now, so those rules are dropped; only
  the space-driven ones (hide sidebar and aside) remain.

Screenshots at 900/1000/1280/1440 also earned one new rule: at 1280 the
sidebar returns, and sidebar + aside + rail left the prose at ~300px. Between
1280 and 1439 the aside is hidden instead, which roughly doubles the reading
column.

`--ovw-*` are mapped from `--vp-c-*`, so the panel is painted in the docs
palette and follows the appearance toggle — custom properties are not reset by
the widget's `all: initial`, so they pierce the shadow root with no bundle
change. `--ovw-rail-top: 64px` keeps the rail below the fixed VPNav.

Verified on a production build against a mocked embed backend, both locales,
900/1000/1280/1440/720px: rail publishes and retracts, layout squeezes and
springs back, panel sits below the navbar in docs colours and in the reader's
language, sheet takes over below 900px with no squeeze. Theme tests 13/13.
2026-08-13 19:49:06 +08:00
..