Skip to content

perf: site-wide frontend overhaul — appearance system, reading experience, accessibility & i18n fixes - #24

Merged
Jiu-xiao merged 8 commits into
devfrom
perf/frontend-optimization
Oct 6, 2026
Merged

Jiu-xiao merged 8 commits into
devfrom
perf/frontend-optimization

Conversation

@xiaoshuaijie

@xiaoshuaijie xiaoshuaijie commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Systematic frontend overhaul built entirely on the existing XRobot ink token system (--paper / --ink / --line plus the new --xr-accent accent channel). The docs/ directory is untouched (no content, frontmatter, or URL changes), and the default appearance is identical to the current site — every new capability is an opt-in enhancement.

37 files changed, +3958 / −105, in 5 commits: appearance system, community page & navigation, smooth theme switching, i18n & progress fixes, build-output & accessibility fixes.

New features

Appearance panel (palette icon in the navbar)

  • Font style: Default / LXGW WenKai (lxgw-wenkai-screen-webfont, loaded on demand — zero font requests in the default mode)
  • Theme hue: Ink (default, keeps the original monochrome look) + 6 preset swatches + a 0–360 OKLCH spectrum slider + one-click reset; the hue live-drives every accent on the site (links / buttons / TOC / progress bar / focus ring, etc.)
  • Card decor: Sharp edges (original) / Soft rounded, using rainzt-style preview cards (illustration + name + description)
  • Navbar: Auto-hide on scroll (hide on scroll-down, reveal on scroll-up, compact frosted glass) / Always expanded (original), each with a mini navbar mockup
  • Background texture: Plain (original) / Grid / Dots
  • Preferences · Animations: row-style slide switch, sharing the same state as the homepage "Animations On/Off" control (extracted into a shared module, both stay in sync)
  • The panel is hosted at the app root so it cannot be unmounted with the mobile sidebar; opening moves focus in, Tab is trapped inside, Esc / outside click / re-click closes it, and focus returns to the trigger on close
  • All settings persist to localStorage and are restored before first paint by a synchronous <head> script (no FOUC); SSR output keeps the default appearance

Light/dark switch animation (incl. a performance fix)

  • Switching fades every color over 320ms in place while the page keeps rendering live; instant when prefers-reduced-motion is set or the animation switch is off; re-entrant clicks are guarded
  • ⚠️ We deliberately do not use the View Transitions API: its full-page snapshot froze rendering for ~4 seconds on some rendering paths (rAF gap 4029ms, only 2 frames in 600ms). The in-place color transition measures 58 frames / 700ms with a max frame gap of 69ms

Reading progress & back-to-top

  • Top linear progress bar (all pages) + a circular percentage indicator (docs routes only, including /en/docs), rAF-throttled with progress / ring / aria-label kept in sync
  • Back-to-top button: appears past 200px of scroll, inverts on hover with a "Top" label, smooth-scrolls to the top (respects reduced motion)

Long-code folding

  • Code blocks longer than 15 lines start collapsed to an 8-line preview with a bottom fade gradient and a centered "Expand" pill; expanded, the button drops below the block as "Collapse"; collapsing again scrolls the block back into view when needed
  • The fold decision happens during SSR (no flash); preview height is measured from the real line height; full aria-expanded / aria-controls (pointing at the actual code region) + aria-live announcements; unfolds for print; 59 blocks affected site-wide

Homepage hero & /qq community page

  • Below the hero wordmark: the slogan "XRobot is all you need" (wavy underline) and five hanging tag cards — Bilibili / GitHub / Email (click to copy) / QQ Group (→ /qq) / Docs (→ /docs/intro); alternating tilt + stretch-on-hover; hidden below 996px together with the logo
  • New /qq page: group QR code, one-click group-number copy, a "Join via QQ" button, and an "Organization & projects" list (GitHub / Gitee / Docs / OneMessage / MiniShell / MiniFlashDB, all copyable)
  • The footer "QQ群" entry now points to /qq instead of an external invite link

Current-page indication

  • Sidebar active item: accent left indicator bar + 12% tinted pill + font weight 650; categories on the active path turn accent + semibold; breadcrumb tail and the active TOC entry accent + semibold (the ink default mode relies on the bar / weight rather than hue alone)

Other polish

  • Prose: blockquote accent bar, rounded bordered tables with zebra rows, inline-code chips, accent-tinted link underlines, fading hr, hairline image borders
  • The intro-page logo PNG auto-inverts in dark mode (black strokes → white; fixes invisibility on the dark card)

Bug fixes

Severity Issue Fix
High React 18.3 streaming SSR injected NUL characters into the build output: 317 occurrences across 107 HTML files, garbling text and breaking 14 heading anchors Added scripts/strip-nul.js on postbuild; after stripping, all 7452 in-page anchors across the build resolve with 0 failures
High Theme switching froze the whole page for ~4s (View Transitions snapshot) Replaced with the in-place CSS color transition (see above)
Medium "Copied ✓" shown even when the clipboard was denied and the fallback failed The copy helper now reports real success; failures show "Copy failed" (new src/utils/clipboard.ts)
Medium Agent dialog (aria-modal) had no Tab trap Focus moves in on open + focus is kept cycling inside the dialog (the existing open/close focus handling is preserved)
Medium Appearance panel never received focus and focus was not restored on close Same approach: focus in on open, trap, restore to the trigger on close
Medium Navbar auto-hide only reacted to wheel events Rewritten as scrollY-delta direction detection (keyboard / touch / scrollbar behave the same)
Medium Closing the mobile sidebar unmounted the appearance panel Panel is hosted at the app root
Low Fold button aria-controls pointed at an always-hidden text copy Now points at the region that actually expands/collapses
Low English homepage showed the Chinese "QQ群" tag Added home.hero.tag.qq = "QQ Group"
Low Mermaid diagrams harsh on dark mode mermaid.theme.dark changed from forest to dark
Low English sidebar contained the Chinese "消息系统" category Added sidebar.docs.category.消息系统 = "Message System"
Low Intro-page logo invisible in dark mode filter: invert(1) in dark theme, matched by filename (build rewrites the path with a hash)
— Custom navbar item type failed the build Type renamed with Docusaurus's required custom- prefix
— @docusaurus/useLocation unresolvable Switched to the public alias @docusaurus/router
— cssnano rule merging broke the hue switch Hue blocks use higher-specificity selectors, independent of bundle order
— Pre-existing strict error after adding tsconfig One nullish coalescing in RingBuffer/sim.ts (no behavior change)

i18n

  • i18n/en/code.json: ~30 new keys (appearance panel / hero tags / /qq page / code folding / back-to-top)
  • Sidebar category translations completed via write-translations (24 categories); footer QQ Group keys corrected and a stale key removed
  • The reading-progress circle now covers /en/docs routes

New dependencies

  • lxgw-wenkai-screen-webfont (runtime; copied to static/fonts/lxgw/ by scripts/copy-fonts.js during build/start, gitignored — zero font requests in the default mode)
  • devDependencies: typescript, @types/react, @types/react-dom (type-checking only, build pipeline unchanged)

Testing

  • npm run build (including the postbuild NUL strip) and tsc --noEmit pass with zero errors
  • Six pages (home / zh docs ×2 / /qq / en home / en docs) verified: titles, images, no broken assets; interaction stress test (theme toggles + every panel option) with zero console errors
  • Full-site anchor integrity check: 7452 in-page anchors, 0 failures; combined sweeps across light/dark × ink/hue × sharp/soft × mobile 390px; panel persistence (restore on reload, no FOUC); appearance panel and theme toggle reachable from the mobile hamburger menu
  • Focus management verified: Tab cycling in both dialogs, focus in/out, and both copy paths (success/failure)
  • docs/ directory confirmed untouched (git)

Upgrade notes

  • The first CI build now runs the font copy (prebuild) and the NUL strip (postbuild); new dependencies require network access
  • Long-code folding applies to new code blocks automatically; a per-block opt-out (meta syntax) can be added later if needed

Summary by Sourcery

Modernize the frontend with an opt-in appearance and reading experience while improving accessibility, internationalization, build output integrity, and community navigation.

New Features:

  • Add an opt-in appearance system for typography, accent hues, card styling, navbar behavior, background textures, and animation preferences.
  • Introduce site-wide reading progress, docs progress indicators, back-to-top navigation, and accessible long-code folding.
  • Add a QQ community page with group joining, QR code, copy actions, and project links, plus homepage community links.
  • Improve active-page styling, prose presentation, theme switching, and dark-mode visuals across the frontend.

Bug Fixes:

  • Remove injected NUL characters from generated HTML to restore text integrity and in-page anchor links.
  • Replace freezing view-transition theme changes with live in-place color transitions.
  • Report clipboard failures accurately and improve dialog focus trapping, navbar scroll behavior, mobile panel persistence, translations, and dark-mode rendering.

Enhancements:

  • Centralize animation preference handling and apply persisted settings before first paint.
  • Add shared clipboard utilities and strengthen TypeScript configuration and Docusaurus theme integrations.

Build:

  • Add build-time font preparation and postbuild HTML cleanup, along with TypeScript and React type-checking dependencies.

Documentation:

  • Update contributor information and add localized strings for the new appearance, community, reading, and accessibility features.

Tests:

  • Validate production builds, type checking, anchor integrity, responsive behavior, preference persistence, interaction flows, clipboard outcomes, and keyboard focus management.

Jiu-xiao and others added 6 commits October 5, 2026 03:58
发布:dev 合入 master(XRobot Style 首页)
Replace snapshot transitions with CSS color fades, add visual option cards and an animation switch, and improve active navigation indicators and dark-mode logo visibility.
Refresh English UI, sidebar, and footer translations; show reading progress on English docs routes; use Mermaid's dark theme in dark mode.
Strip NUL bytes from generated HTML, improve dialog focus management, fix code fold aria controls, and report clipboard failures correctly.
@sourcery-ai

sourcery-ai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR adds a persisted, SSR-safe appearance and accessibility layer across the Docusaurus site, including live accent/theme controls, reading aids, code folding, navigation and community surfaces, while hardening build output, clipboard feedback, localization, and type-checking without modifying docs content or default appearance.

Sequence diagram for opening the accessible appearance panel

sequenceDiagram
    actor User
    participant Navbar as NavbarItem
    participant Host as AppearancePanelHost
    participant Panel as AppearancePanel

    User->>Navbar: click palette button
    Navbar->>Host: dispatch xr-toggle-appearance-panel
    Host->>Host: open panel and capture previous focus
    Host->>Panel: render dialog
    Host->>Panel: focus container
    User->>Host: Tab or Shift+Tab
    Host->>Host: cycle focus within dialog
    User->>Host: press Escape or click outside
    Host->>Host: close panel
    Host->>Host: restore previous focus
Loading

Sequence diagram for persisted appearance initialization

sequenceDiagram
    participant Browser
    participant Init as appearance-init.js
    participant Storage as localStorage
    participant CSS as xrstyle-appearance.css
    participant Site as Docusaurus site

    Browser->>Init: execute synchronously in head
    Init->>Storage: read appearance preferences
    Storage-->>Init: hue, font, decor, navbar, background, motion
    Init->>CSS: set html data attributes and --xr-hue
    CSS-->>Site: apply stored appearance before first paint
    Site->>Site: hydrate AppearancePanel
Loading

Flow diagram for reading progress and back-to-top behavior

flowchart TD
    Scroll[User scrolls] --> RAF[requestAnimationFrame throttle]
    RAF --> Progress[updateProgress]
    Progress --> Bar[Update top progress bar]
    Progress --> Route{Docs route?}
    Route -->|Yes| Circle[Update progress circle and aria-label]
    Route -->|No| NoCircle[Keep circle hidden]
    Progress --> Threshold{scrollY greater than 200?}
    Threshold -->|Yes| Show[Show back-to-top button]
    Threshold -->|No| Hide[Hide back-to-top button]
    Show --> Click[User clicks Top]
    Click --> ScrollTop[scrollToTop]
Loading

Flow diagram for long-code folding

flowchart TD
    Code[CodeBlock] --> Count[Count lines during render]
    Count --> Threshold{More than 15 lines?}
    Threshold -->|No| Full[Render expanded code]
    Threshold -->|Yes| Fold[Render 8-line collapsed preview]
    Fold --> Expand[User activates Expand]
    Expand --> Full
    Full --> Collapse[User activates Collapse]
    Collapse --> Fold
Loading

File-Level Changes

Change Details Files
Introduced a persisted, token-driven appearance system with synchronous first-paint initialization and an app-root settings dialog.
  • Added hue presets and OKLCH slider driving shared accent variables.
  • Added font, card, navbar, background, and motion preferences with localStorage persistence.
  • Added dialog focus entry, focus trapping, Escape/outside-click close, and focus restoration.
  • Added on-demand font copying/loading and matching anti-FOUC head initialization.
docusaurus.config.js
package.json
scripts/copy-fonts.js
static/appearance-init.js
src/components/appearance/AppearancePanel.tsx
src/components/appearance/AppearancePanel.module.css
src/components/appearance/AppearancePanelHost.tsx
src/components/appearance/NavbarScrollBehavior.tsx
src/utils/appearance.ts
src/utils/motion.ts
src/css/xrstyle-appearance.css
src/css/custom.css
src/theme/NavbarItem/index.tsx
Overhauled global reading and theme interaction while avoiding full-page View Transition snapshots.
  • Replaced theme switching with a guarded in-place 320ms color transition that honors reduced-motion and the site motion preference.
  • Added rAF-throttled top progress, docs-only circular progress, and reduced-motion-aware back-to-top controls.
  • Added scroll-delta navbar auto-hide behavior with compact frosted styling.
src/theme/ColorModeToggle/index.tsx
src/theme/ColorModeToggle/index.module.css
src/utils/themeTransition.ts
src/components/appearance/ReadingProgress.tsx
src/components/appearance/NavbarScrollBehavior.tsx
src/theme/Root/index.tsx
Added SSR-aware long-code folding with accessible expansion controls and print behavior.
  • Collapsed code blocks over 15 lines to an eight-line measured preview during SSR.
  • Added fade treatment, expand/collapse controls, live announcements, correct aria-controls targets, and scroll restoration when reclosing.
  • Disabled folding presentation for print.
src/theme/CodeBlock/index.tsx
src/css/xrstyle-appearance.css
Expanded site navigation and community-facing content.
  • Added homepage contact tags and slogan with responsive hiding and copy-to-clipboard email behavior.
  • Added a localized /qq page with QR code, group-number copying, join link, and organization/project links.
  • Updated footer QQ navigation to point to /qq.
src/pages/index.tsx
src/pages/index.module.css
src/pages/qq.tsx
src/pages/qq.module.css
docusaurus.config.js
i18n/en/code.json
i18n/en/docusaurus-theme-classic/footer.json
Applied broad token-based visual polish and current-page/accessibility improvements.
  • Added accent-aware active states for sidebar, categories, breadcrumbs, and TOC.
  • Styled prose blockquotes, tables, inline code, links, separators, images, optional textures, and soft card decor.
  • Added dark-mode inversion for the intro logo and changed Mermaid dark theme.
  • Added focus trapping to the agent dialog.
src/css/xrstyle-appearance.css
src/css/custom.css
src/components/home/AgentPromptDialog.tsx
docusaurus.config.js
Hardened build output, clipboard behavior, localization, and type-checking.
  • Added postbuild NUL stripping and font asset preparation to the npm lifecycle.
  • Made clipboard helpers report actual success and failure.
  • Completed English appearance, homepage, community, sidebar, and progress translations.
  • Added TypeScript configuration and type declarations, including Docusaurus aliases.
scripts/strip-nul.js
src/utils/clipboard.ts
i18n/en/code.json
i18n/en/docusaurus-plugin-content-docs/current.json
i18n/en/docusaurus-theme-classic/footer.json
package.json
package-lock.json
tsconfig.json
src/theme-modules.d.ts
src/components/showcase/RingBuffer/sim.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 9 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="package.json" line_range="8" />
<code_context>
     "start": "docusaurus start",
-    "prebuild": "node scripts/fetch-commits.js",
+    "prestart": "node scripts/copy-fonts.js",
+    "prebuild": "node scripts/fetch-commits.js && node scripts/copy-fonts.js",
     "build": "docusaurus build",
     "deploy": "docusaurus deploy",
</code_context>
<issue_to_address>
**Deploy skips build fixes**

When CI or a maintainer publishes with the standard `npm run deploy` command rather than deploying a separately prepared build, the standard `npm run deploy` command invokes `docusaurus deploy`, not `npm run build`, so npm does not run these `prebuild` and `postbuild` hooks; the published output retains the NUL characters and omits the ignored, copied font assets, leaving broken text/anchors and WenKai unavailable.

Make deployment run the hooked build and publish that output, or explicitly run font copying and NUL stripping on the build produced by the deploy path.

Also at `package.json:11`.
</issue_to_address>

### Comment 2
<location path="src/components/appearance/AppearancePanel.tsx" line_range="108" />
<code_context>
+  return (
+    <div
+      className={styles.panel}
+      role="dialog"
+      aria-label={translate({ id: 'appearance.panelTitle', message: '外观设置' })}>
+      {/* 1. 字体样式 */}
</code_context>
<issue_to_address>
**Background remains available**

When a screen-reader user opens the appearance panel, the dialog has no modal state, so assistive technology continues exposing page content behind the panel while it is open.

Add `aria-modal="true"` to the dialog.
</issue_to_address>

### Comment 3
<location path="src/components/appearance/AppearancePanelHost.tsx" line_range="51-53" />
<code_context>
+      const first = focusables[0];
+      const last = focusables[focusables.length - 1];
+      const current = document.activeElement as HTMLElement;
+      if (event.shiftKey && (current === first || !container.contains(current))) {
+        event.preventDefault();
+        last.focus();
+      } else if (!event.shiftKey && (current === last || !container.contains(current))) {
+        event.preventDefault();
</code_context>
<issue_to_address>
**Focus escapes open panel**

When a keyboard user presses Shift-Tab immediately after the panel opens, the host initially focuses the container, but the Tab handler treats it as an ordinary in-container focus target. Shift-Tab is not prevented and moves focus to the page behind the panel.

Treat the focused container as a reverse-Tab edge and move focus to the last control.

Also at `src/components/appearance/AppearancePanelHost.tsx:34`.
</issue_to_address>

### Comment 4
<location path="src/theme/NavbarItem/index.tsx" line_range="36" />
<code_context>
+          description: 'The aria-label of the appearance settings (palette) navbar button',
+        })}
+        onClick={() => {
+          if (mobileSidebar.shown) {
+            mobileSidebar.toggle();
+          }
</code_context>
<issue_to_address>
**Focus returns to detached trigger**

When the panel is opened from the mobile sidebar, `NavbarItem` closes the sidebar before the host records `document.activeElement`, so the trigger is unmounted and the host saves a stale or fallback target. Closing the panel then returns focus to the page instead of a usable navbar control.

Preserve a mounted focus-return target before closing the sidebar and restore focus to it when the panel closes.

Also at `src/components/appearance/AppearancePanelHost.tsx:31-34`, `src/components/appearance/AppearancePanelHost.tsx:75`.
</issue_to_address>

### Comment 5
<location path="src/utils/appearance.ts" line_range="68-79" />
<code_context>
+ * Write the accent state: pass a hue (0-360) for hue mode, null to go back to
+ * the mono accent (removes the storage key and sets data-accent="mono").
+ */
+export function writeAccentHue(hue: number | null): void {
+  if (hue === null) {
+    removeStorage(ACCENT_HUE_KEY);
+  } else {
+    writeStorage(ACCENT_HUE_KEY, String(hue));
+  }
+  const root = document.documentElement;
+  root.dataset.accent = hue === null ? 'mono' : 'hue';
</code_context>
<issue_to_address>
**Other tabs keep stale appearance**

When one tab changes a saved appearance preference while the site is open in multiple tabs, the other tab does not handle the storage change to update its root attributes or an open panel’s controls, so its rendered appearance and displayed settings remain stale.

Handle storage events by applying the changed preferences to the root attributes and refreshing the panel controls.

Also at `src/utils/motion.ts:24-32`, `src/components/appearance/AppearancePanel.tsx:42-54`.
</issue_to_address>

### Comment 6
<location path="src/utils/clipboard.ts" line_range="20-24" />
<code_context>
+    area.style.opacity = '0';
+    document.body.appendChild(area);
+    area.select();
+    const ok = document.execCommand('copy');
+    area.remove();
+    return ok;
+  } catch {
+    return false;
+  }
+}
</code_context>
<issue_to_address>
**Failed copies leave textareas**

When the legacy `execCommand` fallback throws after the textarea is appended, the catch path returns without calling `area.remove()`, leaving an invisible, focusable textarea in the document; repeated failures accumulate them.

Remove the textarea in a `finally` block so it is cleaned up whether the copy succeeds or throws.
</issue_to_address>

### Comment 7
<location path="src/components/appearance/AppearancePanel.module.css" line_range="18" />
<code_context>
+  border: 1px solid var(--line);
+  border-radius: var(--ifm-button-border-radius);
+  box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
+  animation: panel-in 0.2s ease;
+}
+
</code_context>
<issue_to_address>
**Motion preference is ignored**

When animations are disabled or reduced motion is active, the panel entrance and theme-toggle icon transitions still run because the motion-off rules do not cover these animations, so opening the panel or switching themes animates against the user’s preference.

Add motion-off and reduced-motion rules that disable the panel entrance and theme-toggle icon transitions.

Also at `src/theme/ColorModeToggle/index.module.css:28-30`.
</issue_to_address>

### Comment 8
<location path="static/appearance-init.js" line_range="27-36" />
<code_context>
+  var hue = read('xr-accent-hue');
+  if (hue !== null) {
+    var parsed = parseInt(hue, 10);
+    if (isNaN(parsed)) {
+      parsed = 0;
+    }
+    if (parsed < 0) {
+      parsed = 0;
+    }
+    if (parsed > 360) {
+      parsed = 360;
+    }
+    root.setAttribute('data-accent', 'hue');
+    root.style.setProperty('--xr-hue', String(parsed));
+  } else {
</code_context>
<issue_to_address>
**Hue setting disagrees with controls**

When localStorage contains a non-numeric value for `xr-accent-hue`, `appearance-init.js` coerces the value to `0` and enables hue mode, while `readAccentHue()` returns `null` and the panel displays mono mode. The page therefore renders a hue accent while the controls indicate mono.

Handle malformed stored hues consistently in the initializer and `readAccentHue()` so the rendered accent and selected control agree.

Also at `src/utils/appearance.ts:59-60`.
</issue_to_address>

### Comment 9
<location path="src/css/xrstyle-appearance.css" line_range="472-478" />
<code_context>
+}
+
+/* Blockquote: a 3px accent bar (round-cornered) on a sunken panel. */
+.markdown blockquote {
+  padding: var(--space-3) var(--space-4);
+  background-color: color-mix(in oklch, var(--paper-sunken) 60%, transparent);
+  border-left: 3px solid color-mix(in oklch, var(--xr-accent) 30%, transparent);
+  border-radius: 3px;
+}
+
+/* Tables: one outer frame, hairline row rules, no double borders. Infima's
+ * block display + overflow:auto stays, so wide tables still scroll inside
</code_context>
<issue_to_address>
**Default prose styling changes**

When a visitor uses the default appearance, the `.markdown` rules apply unconditionally, so blockquotes and other prose elements change even in the default appearance; the claimed identical default look is not preserved.

Either make the prose changes opt-in or revise the claim that the default appearance is identical.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 9 findings to address first, and this changes site-wide runtime behavior and the production build output, including generated HTML, navigation, persisted appearance settings, and a newly packaged font dependency. A bad result could leave incorrect deployed pages or broken anchors until the site is rebuilt and redeployed; reverting the code and regenerating the build repairs it.

Blocking findings: package.json:8, src/components/appearance/AppearancePanel.tsx:108, src/components/appearance/AppearancePanelHost.tsx:53, src/theme/NavbarItem/index.tsx:36, src/utils/appearance.ts:79, and 4 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread package.json Resolved
Comment thread src/theme/NavbarItem/index.tsx Resolved
Comment thread src/utils/appearance.ts Resolved
Comment thread src/utils/clipboard.ts Resolved
Comment thread static/appearance-init.js Resolved
Comment thread src/css/xrstyle-appearance.css Resolved
- Remove the appearance panel (hue accent, rounded cards, auto-hiding
  frosted navbar, background textures, LXGW WenKai) together with its
  navbar item, init script, font dependency and translations; a small
  static/motion-init.js keeps applying the animation switch before paint.
- Rename xrstyle-appearance.css to xrstyle-reading.css and keep the reading
  features (theme fade, reading progress, back-to-top, prose details,
  current-page indication, long-code folding) in ink with square corners;
  the sidebar's current item uses paper-sunken instead of a solid grey.
- Theme fade, smooth scrolling and code-fold scrolling follow only the page
  animation switch, like the showcase widgets.
- Home hero: drop the wavy underline; the contact tags stay coloured but
  sit straight, apart, without shadows.
- Rewrite /qq in XRobot Style and crop the QR image to the code.
- About: add @xiaoshuaijie (website UI, MSPM0); @molqzone keeps DAPLink.
@Jiu-xiao
Jiu-xiao force-pushed the perf/frontend-optimization branch from 3886487 to 713a1ae Compare October 6, 2026 14:31
…s tabs

- Remove the temporary textarea in a finally block, so a throwing execCommand leaves nothing behind.
- useReducedMotion listens for storage events on xr-motion and applies the value from another tab.
@Jiu-xiao
Jiu-xiao merged commit a462415 into dev Oct 6, 2026
3 checks passed
@Jiu-xiao
Jiu-xiao deleted the perf/frontend-optimization branch October 11, 2026 02:32
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