Skip to content

feat: Document homepage restructuring. - #117

Merged
zzcr merged 5 commits into
opentiny:devfrom
discreted66:dev-0811
Aug 24, 2026
Merged

feat: Document homepage restructuring.#117
zzcr merged 5 commits into
opentiny:devfrom
discreted66:dev-0811

Conversation

@discreted66

@discreted66 discreted66 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

依据设计稿重构主页实现
GIF 2026-8-11 19-44-00

Summary by CodeRabbit

New Features

  • Added a redesigned documentation homepage with hero content, categorized documentation links, product cards, and project updates.
  • Added homepage search with fuzzy matching, highlighted results, hot searches, and quick navigation.
  • Added recent release and commit highlights with “NEW” indicators and translated summaries.

Style

  • Added responsive layouts and enhanced light/dark theme styling.
  • Improved navigation, sidebar spacing, scrollbars, links, cards, and hover states.

- 将首页样式集中到 home/styles.css

- 全局滚动条美化移至 style.css(圆角滑块、隐藏上下箭头)

- 抽取 ProductSection.vue 静态产品卡片组件
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@discreted66, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 119 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3115eb68-fe9a-4c1d-be3c-47cb6c1fa8b1

📥 Commits

Reviewing files that changed from the base of the PR and between 95ead8d and 70c3a7f.

⛔ Files ignored due to path filters (2)
  • public/images/header-title-dark.svg is excluded by !**/*.svg
  • public/images/header-title.svg is excluded by !**/*.svg
📒 Files selected for processing (3)
  • .vitepress/theme/home/components/HeroSection.vue
  • .vitepress/theme/home/styles.css
  • package.json

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 54c5bb23-3d5e-4165-b197-2a798086262a

📥 Commits

Reviewing files that changed from the base of the PR and between facfd0b and 95ead8d.

📒 Files selected for processing (4)
  • .vitepress/theme/home/components/HeroSection.vue
  • .vitepress/theme/home/components/ProductSection.vue
  • .vitepress/theme/home/components/UpdateSection.vue
  • .vitepress/theme/home/styles.css
🚧 Files skipped from review as they are similar to previous changes (4)
  • .vitepress/theme/home/components/ProductSection.vue
  • .vitepress/theme/home/styles.css
  • .vitepress/theme/home/components/HeroSection.vue
  • .vitepress/theme/home/components/UpdateSection.vue

Walkthrough

The homepage is now componentized into hero, product, and update sections. It adds MiniSearch-based documentation search, product cards, GitHub update aggregation with caching and translation, responsive styling, and global layout updates.

Changes

Documentation homepage

Layer / File(s) Summary
Homepage shell and visual foundation
.vitepress/theme/home/index.vue, .vitepress/theme/home/styles.css, .vitepress/theme/style.css, package.json
The home page now composes dedicated sections. Shared styles define themes, layouts, responsive behavior, global navigation sizing, scrollbars, and link presentation.
Hero search and documentation navigation
.vitepress/theme/home/components/HeroSection.vue, .vitepress/theme/home/styles.css, package.json
The hero section loads a local MiniSearch index, performs debounced fuzzy and prefix searches, highlights results, supports navigation and dismissal actions, and renders hot searches and documentation categories.
Product documentation catalog
.vitepress/theme/home/components/ProductSection.vue, .vitepress/theme/home/styles.css
The product section renders grouped product and component cards with base-aware assets, metadata, badges, descriptions, and documentation links.
Release and commit updates
.vitepress/theme/home/components/UpdateSection.vue, .vitepress/theme/home/styles.css
The update section fetches GitHub releases and commits, uses ETags and local caches, translates summaries, handles failures, and displays the newest four deduplicated updates.

Estimated code review effort: 4 (Complex) | ~60 minutes

Mergeability Score: ⚪ Minimal · up to 95ead

This PR restructures the homepage and adds related styling and assets; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Visitor
  participant HeroSection
  participant MiniSearch
  Visitor->>HeroSection: enter search query
  HeroSection->>MiniSearch: load index and run fuzzy or prefix search
  MiniSearch-->>HeroSection: return ranked matches
  HeroSection-->>Visitor: render highlighted results
Loading
sequenceDiagram
  participant UpdateSection
  participant LocalCache
  participant GitHub
  participant TranslationAPI
  UpdateSection->>LocalCache: read cached updates and ETags
  UpdateSection->>GitHub: request releases and commits conditionally
  GitHub-->>UpdateSection: return updates or cached-response status
  UpdateSection->>TranslationAPI: translate uncached summaries
  TranslationAPI-->>UpdateSection: return translated summaries
  UpdateSection->>LocalCache: store updates, translations, and ETags
  UpdateSection-->>UpdateSection: render sorted, deduplicated updates
Loading

Suggested reviewers: lhuans

Poem

A rabbit hops through cards of light,
Finds docs with fuzzy search delight.
Releases bloom, cached and new,
Translated summaries join the view.
Three sections now spring into view—
Hop, review, and ship anew!

🚥 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 summarizes the main change: restructuring the documentation homepage into a component-based design.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch dev-0811
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 7

🧹 Nitpick comments (6)
.vitepress/theme/home/styles.css (1)

575-584: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add the standard line-clamp property.

.update-card-desc uses only -webkit-line-clamp. Add the standard line-clamp declaration for engines that support the unprefixed property.

♻️ Proposed refactor
   display: -webkit-box;
   -webkit-line-clamp: 2;
+  line-clamp: 2;
   -webkit-box-orient: vertical;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vitepress/theme/home/styles.css around lines 575 - 584, Update the
.update-card-desc rule to add the unprefixed line-clamp declaration alongside
the existing -webkit-line-clamp: 2, preserving the current two-line truncation
behavior and vendor-prefixed fallback.
.vitepress/theme/style.css (1)

23-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Update the comment to match the rules.

The comment states "Firefox 细滚动条", but the block contains only WebKit pseudo-element rules. The scrollbar-width declaration was removed. Either restore a scrollbar-width rule or drop that part of the comment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vitepress/theme/style.css at line 23, Update the scrollbar styling comment
near the WebKit pseudo-element rules to accurately describe the implementation:
either restore the Firefox scrollbar-width declaration or remove the “Firefox
细滚动条” wording, preserving the existing WebKit behavior.
.vitepress/theme/home/components/HeroSection.vue (1)

123-127: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Use the VitePress router instead of window.location.href.

onSearchEnter assigns window.location.href, which forces a full page reload and discards the SPA state. Use useRouter().go(...) from vitepress for client-side navigation.

♻️ Proposed refactor
-import { useData } from "vitepress";
+import { useData, useRouter } from "vitepress";
...
+const router = useRouter();
 const onSearchEnter = () => {
   if (searchResults.value.length) {
-    window.location.href = searchResults.value[0].id;
+    router.go(searchResults.value[0].id);
   }
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vitepress/theme/home/components/HeroSection.vue around lines 123 - 127,
Update onSearchEnter to obtain the VitePress router via useRouter and call
router.go with the first search result’s id, replacing the window.location.href
assignment while preserving the existing non-empty-results guard.
.vitepress/theme/home/components/ProductSection.vue (1)

65-210: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Move the product catalog data out of the component.

productCards holds 145 lines of static configuration inside the component. Move it to a separate data module, for example .vitepress/theme/home/data/products.js, and export a factory that takes prefix. The component then contains only rendering logic, and the catalog becomes reusable and easier to edit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vitepress/theme/home/components/ProductSection.vue around lines 65 - 210,
Move the static productCards catalog out of ProductSection.vue into a dedicated
data module such as data/products.js, exporting a factory that accepts prefix
and constructs the image paths. Update the component to import and call that
factory, leaving only rendering logic and preserving the existing catalog
structure and URLs.
.vitepress/theme/home/components/UpdateSection.vue (2)

46-47: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Derive the fallback cache key instead of hard-coding it.

CACHE_KEY and FALLBACK_CACHE_KEY both embed a version number, so every schema change needs two manual edits kept in sync. Store the version in one constant and build both keys from it.

♻️ Proposed refactor
-const CACHE_KEY = "home-updates-cache-v10";
-const FALLBACK_CACHE_KEY = "home-updates-cache-v9";
+const CACHE_VERSION = 10;
+const CACHE_KEY = `home-updates-cache-v${CACHE_VERSION}`;
+const FALLBACK_CACHE_KEY = `home-updates-cache-v${CACHE_VERSION - 1}`;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vitepress/theme/home/components/UpdateSection.vue around lines 46 - 47,
Update the cache-key declarations around CACHE_KEY and FALLBACK_CACHE_KEY to
store the current cache version in a single constant, derive CACHE_KEY from that
version, and derive FALLBACK_CACHE_KEY as the preceding version. Remove the
duplicated hard-coded version numbers while preserving the existing v10/v9 key
values.

258-310: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy lift

Reduce the unauthenticated GitHub API calls per visitor.

A cold load issues 14 unauthenticated requests, which is 2 requests for each of the 7 repositories. The unauthenticated limit is 60 requests per hour per IP. Visitors behind a shared NAT or corporate proxy exhaust the quota after four page loads, and the section then shows stale or no data.

Fetch the release and commit data at build time, or through a small proxy that uses a token, and ship the result as static JSON. The component then reads local data and needs no client-side quota.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.vitepress/theme/home/components/UpdateSection.vue around lines 258 - 310,
Replace the client-side GitHub API requests in fetchLatest and fetchDocsUpdates
with build-time or token-authenticated proxy data exposed as static JSON. Update
the component to load and merge the local release/commit dataset instead of
calling fetchConditional for each repository, preserving the existing item
mapping, cache shape, and fallback behavior while eliminating unauthenticated
per-visitor API calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.vitepress/theme/home/components/HeroSection.vue:
- Around line 177-216: Update .vitepress/theme/home/components/HeroSection.vue
lines 177-216 so every categoryCards link URL is passed through
normalizeLink(url, prefix), matching hotSearches. Also update
.vitepress/theme/home/components/ProductSection.vue lines 44-49 so each comp
link URL uses normalizeLink(url, prefix), while preserving external URL
handling.
- Around line 61-67: Update the category link anchor in the card.links v-for to
include rel="noopener noreferrer" alongside target="_blank", preserving the
existing href, key, and link text behavior.

In @.vitepress/theme/home/components/UpdateSection.vue:
- Around line 233-251: External requests in fetchConditional and translateToZh
lack timeouts and can remain pending indefinitely. In
.vitepress/theme/home/components/UpdateSection.vue lines 233-251, pass an
AbortController signal to fetchConditional’s GitHub request and return { status:
"error" } when aborted; in lines 175-193, apply the same timeout and
abort-signal handling to both translation fetch calls so translation falls back
on timeout.

In @.vitepress/theme/home/styles.css:
- Around line 16-20: Add an empty line before the overflow declaration in the
relevant style block so overflow: hidden; satisfies Stylelint’s
declaration-empty-line-before rule.
- Around line 624-627: Update the `.projects-section` rule within the `<= 979px`
mobile breakpoint to replace the 160px horizontal padding with a small
mobile-appropriate value, preserving the section’s vertical padding behavior and
allowing cards to retain usable content width.

In @.vitepress/theme/style.css:
- Around line 979-983: Remove the generated [data-v-e31b95cc] attribute selector
from the .VPContent.has-sidebar rule and preserve or increase specificity using
stable class selectors or another non-generated mechanism, keeping the existing
sidebar padding behavior unchanged.
- Around line 108-109: Update the `.VPSidebar` styles to define
`--vp-sidebar-width` as `260px` and replace the hardcoded width with
`var(--vp-sidebar-width) !important`, keeping the existing padding unchanged.

---

Nitpick comments:
In @.vitepress/theme/home/components/HeroSection.vue:
- Around line 123-127: Update onSearchEnter to obtain the VitePress router via
useRouter and call router.go with the first search result’s id, replacing the
window.location.href assignment while preserving the existing non-empty-results
guard.

In @.vitepress/theme/home/components/ProductSection.vue:
- Around line 65-210: Move the static productCards catalog out of
ProductSection.vue into a dedicated data module such as data/products.js,
exporting a factory that accepts prefix and constructs the image paths. Update
the component to import and call that factory, leaving only rendering logic and
preserving the existing catalog structure and URLs.

In @.vitepress/theme/home/components/UpdateSection.vue:
- Around line 46-47: Update the cache-key declarations around CACHE_KEY and
FALLBACK_CACHE_KEY to store the current cache version in a single constant,
derive CACHE_KEY from that version, and derive FALLBACK_CACHE_KEY as the
preceding version. Remove the duplicated hard-coded version numbers while
preserving the existing v10/v9 key values.
- Around line 258-310: Replace the client-side GitHub API requests in
fetchLatest and fetchDocsUpdates with build-time or token-authenticated proxy
data exposed as static JSON. Update the component to load and merge the local
release/commit dataset instead of calling fetchConditional for each repository,
preserving the existing item mapping, cache shape, and fallback behavior while
eliminating unauthenticated per-visitor API calls.

In @.vitepress/theme/home/styles.css:
- Around line 575-584: Update the .update-card-desc rule to add the unprefixed
line-clamp declaration alongside the existing -webkit-line-clamp: 2, preserving
the current two-line truncation behavior and vendor-prefixed fallback.

In @.vitepress/theme/style.css:
- Line 23: Update the scrollbar styling comment near the WebKit pseudo-element
rules to accurately describe the implementation: either restore the Firefox
scrollbar-width declaration or remove the “Firefox 细滚动条” wording, preserving the
existing WebKit behavior.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c77cb632-b4c2-4d3f-92bd-fcae24cf74c4

📥 Commits

Reviewing files that changed from the base of the PR and between 447db00 and facfd0b.

⛔ Files ignored due to path filters (24)
  • public/images/icon-ai-extension.svg is excluded by !**/*.svg
  • public/images/icon-ai-product.svg is excluded by !**/*.svg
  • public/images/icon-api.svg is excluded by !**/*.svg
  • public/images/icon-demo.svg is excluded by !**/*.svg
  • public/images/icon-fire.svg is excluded by !**/*.svg
  • public/images/icon-gen-ui.svg is excluded by !**/*.svg
  • public/images/icon-guide.svg is excluded by !**/*.svg
  • public/images/icon-hot.svg is excluded by !**/*.svg
  • public/images/icon-lowcode.svg is excluded by !**/*.svg
  • public/images/icon-next-sdks.svg is excluded by !**/*.svg
  • public/images/icon-sdk.svg is excluded by !**/*.svg
  • public/images/icon-search.svg is excluded by !**/*.svg
  • public/images/icon-templates.svg is excluded by !**/*.svg
  • public/images/icon-tiny-charts.svg is excluded by !**/*.svg
  • public/images/icon-tiny-cli.svg is excluded by !**/*.svg
  • public/images/icon-tiny-editor.svg is excluded by !**/*.svg
  • public/images/icon-tiny-engine.svg is excluded by !**/*.svg
  • public/images/icon-tiny-ng.svg is excluded by !**/*.svg
  • public/images/icon-tiny-pro-angular.svg is excluded by !**/*.svg
  • public/images/icon-tiny-pro.svg is excluded by !**/*.svg
  • public/images/icon-tiny-robot.svg is excluded by !**/*.svg
  • public/images/icon-tiny-vue.svg is excluded by !**/*.svg
  • public/images/icon-ui-components.svg is excluded by !**/*.svg
  • public/images/icon-web-agent.svg is excluded by !**/*.svg
📒 Files selected for processing (9)
  • .vitepress/theme/home/components/HeroSection.vue
  • .vitepress/theme/home/components/ProductSection.vue
  • .vitepress/theme/home/components/UpdateSection.vue
  • .vitepress/theme/home/index.vue
  • .vitepress/theme/home/styles.css
  • .vitepress/theme/style.css
  • package.json
  • public/images/img-bg.webp
  • public/images/img-card.webp

Comment thread .vitepress/theme/home/components/HeroSection.vue
Comment thread .vitepress/theme/home/components/HeroSection.vue
Comment thread .vitepress/theme/home/components/UpdateSection.vue
Comment thread .vitepress/theme/home/styles.css
Comment thread .vitepress/theme/home/styles.css
Comment thread .vitepress/theme/style.css
Comment thread .vitepress/theme/style.css
@discreted66
discreted66 force-pushed the dev-0811 branch 2 times, most recently from a116d92 to 8c91f89 Compare August 11, 2026 11:52
@discreted66 discreted66 changed the title feat:文档主页重构 feat:feat: Document homepage restructuring. Aug 11, 2026
@discreted66 discreted66 changed the title feat:feat: Document homepage restructuring. feat: Document homepage restructuring. Aug 11, 2026
- UpdateSection: GitHub Releases 抓取 + ETag/localStorage 缓存 + conventional commits 清洗(含裸 #PR 过滤)

- HeroSection: 本地搜索 + 关键词高亮(v-html 前转义防注入)

- index.vue: 瘦身为三组件组合入口

- 新增相关依赖
- 将文字标题替换为SVG背景图,新增亮色和暗色两个版本

- 通过MutationObserver监听<html>类名变化实现暗色模式实时切换

- 暗色SVG第二个路径设为fill=none,使渐变色彩正常显示

- 添加搜索框box-shadow暗色模式CSS变量

- 调整副标题文案、标签颜色及卡片内边距等样式
@zzcr
zzcr merged commit b2771a0 into opentiny:dev Aug 24, 2026
1 check failed
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