From 61b1ab945cdeaa527f8997cda1aaba8f08343f08 Mon Sep 17 00:00:00 2001 From: fuilyha56-wq Date: Sun, 15 Nov 2026 20:28:50 +0800 Subject: [PATCH 1/8] Improve market readability and rendering performance Preserve the existing terrain, pointer reveal, point cloud and editorial artwork while moving geometry generation off the main thread and coalescing rendering updates. Improve reading typography, dark theme contrast, card alignment and theme controls, with a pure white light background. Validation: 52 frontend tests, TypeScript typecheck, CSS lint and production build passed. --- frontend/index.html | 10 +- frontend/src/assets/docs-reading.css | 219 ++++++++++++++++++ frontend/src/assets/tokens.css | 114 ++++----- frontend/src/components/AppHeader.vue | 27 ++- frontend/src/components/ColophonSeal.vue | 3 +- frontend/src/components/ContourField.vue | 58 ++++- frontend/src/components/FoxPointCloud.vue | 164 +++++++------ .../src/components/GlobalPointerReveal.vue | 37 ++- frontend/src/components/HomePluginShelf.vue | 11 +- frontend/src/components/PluginCard.vue | 39 ++-- .../src/components/RecommendationSection.vue | 59 +++-- frontend/src/components/SurveyOverprint.vue | 20 +- .../src/components/catalog/CatalogListing.vue | 29 +-- .../src/components/catalog/ReadmeDocument.vue | 28 ++- frontend/src/composables/surveyContours.ts | 4 +- .../src/composables/surveyContours.worker.ts | 10 + frontend/src/composables/surveyCoordinates.ts | 3 + frontend/src/composables/surveyGeometry.ts | 155 +++++++++++++ frontend/src/composables/useLoadingState.ts | 14 +- .../src/composables/useMarketPointerReveal.ts | 49 ++-- frontend/src/composables/useSurveyWorld.ts | 53 +++-- frontend/src/main.ts | 1 + frontend/src/views/AuthorView.vue | 19 +- frontend/tests/colophon-seal.spec.ts | 47 ++++ frontend/tests/contrast.spec.ts | 26 +++ frontend/tests/fox-point-cloud.spec.ts | 201 ++++++++++++++++ frontend/tests/survey-world.spec.ts | 209 +++++++++++++++++ frontend/tests/survey_geometry.spec.ts | 121 ++++++++++ frontend/tests/ui-performance.spec.ts | 137 +++++++++++ 29 files changed, 1580 insertions(+), 287 deletions(-) create mode 100644 frontend/src/assets/docs-reading.css create mode 100644 frontend/src/composables/surveyContours.worker.ts create mode 100644 frontend/src/composables/surveyCoordinates.ts create mode 100644 frontend/src/composables/surveyGeometry.ts create mode 100644 frontend/tests/colophon-seal.spec.ts create mode 100644 frontend/tests/contrast.spec.ts create mode 100644 frontend/tests/fox-point-cloud.spec.ts create mode 100644 frontend/tests/survey-world.spec.ts create mode 100644 frontend/tests/survey_geometry.spec.ts create mode 100644 frontend/tests/ui-performance.spec.ts diff --git a/frontend/index.html b/frontend/index.html index 378b3a3..b825cbe 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -16,10 +16,10 @@ })(); diff --git a/frontend/src/components/ColophonSeal.vue b/frontend/src/components/ColophonSeal.vue index 4db0f36..c6f6ea1 100644 --- a/frontend/src/components/ColophonSeal.vue +++ b/frontend/src/components/ColophonSeal.vue @@ -36,6 +36,7 @@ useMarketPointerReveal((pointer) => { if (x >= 0 && y >= 0 && x < bounds.width && y < bounds.height) { zone.style.setProperty('--seal-x', x + 'px'); zone.style.setProperty('--seal-y', y + 'px'); + zone.style.setProperty('--seal-radius', pointer.radius + 'px'); zone.classList.add('is-revealing'); return; } @@ -160,7 +161,7 @@ useMarketPointerReveal((pointer) => { } .is-revealing .secret-ink { clip-path: circle( - calc(var(--market-pointer-radius, 110px) * 1.5) at var(--seal-x) + calc(var(--seal-radius, 110px) * 1.5) at var(--seal-x) var(--seal-y) ); } diff --git a/frontend/src/components/ContourField.vue b/frontend/src/components/ContourField.vue index 88d193c..c938e87 100644 --- a/frontend/src/components/ContourField.vue +++ b/frontend/src/components/ContourField.vue @@ -1,16 +1,51 @@ diff --git a/frontend/src/components/HomePluginShelf.vue b/frontend/src/components/HomePluginShelf.vue index 3e22bcd..9f6ba8e 100644 --- a/frontend/src/components/HomePluginShelf.vue +++ b/frontend/src/components/HomePluginShelf.vue @@ -99,7 +99,7 @@ const entries = computed(() => { } .plugin-shelf header > span { color: var(--blue-700); - font: 600 10px/1 var(--font-mono); + font: 600 12px/1.4 var(--font-mono); letter-spacing: 0.15em; } .plugin-shelf h2 { @@ -161,9 +161,7 @@ const entries = computed(() => { } .sample-title strong, .sample-title small { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + overflow-wrap: anywhere; } .sample-title strong { color: var(--ink-900); @@ -171,10 +169,11 @@ const entries = computed(() => { } .sample-title small { color: var(--ink-500); - font: italic 12px/1.35 var(--font-reading); + font: italic 12px/1.6 var(--font-reading); } .sample-tools { display: flex; + flex-shrink: 0; border-left: 1px solid var(--line); padding-left: 4px; } @@ -187,7 +186,7 @@ const entries = computed(() => { min-width: 44px; min-height: 44px; color: var(--blue-700); - font: 600 11px/1.3 var(--font-sans); + font: 600 12px/1.5 var(--font-sans); } .sample-tools a:hover, .sample-tools a:focus-visible { diff --git a/frontend/src/components/PluginCard.vue b/frontend/src/components/PluginCard.vue index 38cb8ba..4f52160 100644 --- a/frontend/src/components/PluginCard.vue +++ b/frontend/src/components/PluginCard.vue @@ -128,7 +128,8 @@ const tags = computed(() => [ display: flex; flex-direction: column; min-width: 0; - height: 100%; + min-height: 100%; + box-sizing: border-box; padding: 24px; background: var(--surface); border: 1px solid var(--line); @@ -196,7 +197,8 @@ const tags = computed(() => [ gap: 5px; color: var(--ink-500); margin-left: auto; - font-size: 11px; + font-size: 12px; + line-height: 1.6; } .plugin-card-trust i { width: 4px; @@ -229,27 +231,27 @@ const tags = computed(() => [ overflow-wrap: anywhere; } .plugin-card-heading > span { - font: 10px var(--font-mono); + min-width: 0; + max-width: 100%; + font: 12px/1.6 var(--font-mono); color: var(--ink-500); + overflow-wrap: anywhere; } .plugin-card-author { - font-size: 11px; + font-size: 12px; + line-height: 1.6; color: var(--ink-500); margin-top: 6px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + overflow-wrap: anywhere; } .plugin-card-summary { - font-size: 13px; + font-size: 15px; line-height: 1.8; color: var(--ink-500); - min-height: 46px; + min-height: 3.6em; + flex-shrink: 0; margin: 17px 0; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; + overflow-wrap: anywhere; } .plugin-card-tags { display: flex; @@ -259,15 +261,14 @@ const tags = computed(() => [ margin-bottom: 22px; } .plugin-card-tags span { - font-size: 10px; + font-size: 12px; + line-height: 1.5; padding: 3px 7px; border: 1px solid var(--line-soft); background: var(--surface-soft); color: var(--ink-500); max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + overflow-wrap: anywhere; } .plugin-card-footer { margin-top: auto; @@ -278,7 +279,7 @@ const tags = computed(() => [ border-top: 1px solid var(--line-soft); padding-top: 15px; color: var(--ink-500); - font: 11px var(--font-mono); + font: 12px/1.6 var(--font-mono); } .plugin-card-footer > span { display: inline-flex; @@ -289,7 +290,7 @@ const tags = computed(() => [ .plugin-card-footer time { margin-left: auto; white-space: nowrap; - font-size: 10px; + font-size: 12px; } .plugin-card-rating { color: var(--warning-ink); diff --git a/frontend/src/components/RecommendationSection.vue b/frontend/src/components/RecommendationSection.vue index 700e921..2f829cf 100644 --- a/frontend/src/components/RecommendationSection.vue +++ b/frontend/src/components/RecommendationSection.vue @@ -298,6 +298,8 @@ async function undoFeedback() { pointer-events: none; } .recommendation-card { + display: flex; + flex-direction: column; border: 1px solid var(--line); background: var(--surface); min-width: 0; @@ -313,7 +315,8 @@ async function undoFeedback() { justify-content: space-between; align-items: center; gap: 12px; - font-size: 9px; + font-size: 12px; + line-height: 1.6; color: var(--ink-500); letter-spacing: 0.04em; } @@ -353,8 +356,18 @@ async function undoFeedback() { background: var(--surface-soft); } .recommendation-card__link { - display: block; + display: flex; + flex-direction: column; + flex: 1; + min-width: 0; padding: 16px 20px 20px; + color: var(--ink-900); +} +.recommendation-card__link:hover h3, +.recommendation-card__link:focus-visible h3 { + color: var(--blue-700); + text-decoration: underline; + text-underline-offset: 3px; } .recommendation-identity { display: flex; @@ -384,28 +397,21 @@ async function undoFeedback() { line-height: 1.4; letter-spacing: -0.02em; margin: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + overflow-wrap: anywhere; } .recommendation-identity p { - font-size: 10px; + font-size: 12px; + line-height: 1.6; color: var(--ink-500); margin: 4px 0 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + overflow-wrap: anywhere; } .recommendation-summary { - color: var(--ink-500); - font-size: 12px; + color: var(--ink-700); + font-size: 14px; line-height: 1.8; margin: 18px 0; - min-height: 44px; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; + overflow-wrap: anywhere; } .recommendation-reasons { display: flex; @@ -415,21 +421,26 @@ async function undoFeedback() { margin-bottom: 20px; } .recommendation-reasons span { - font-size: 9px; + font-size: 12px; + line-height: 1.6; background: var(--blue-50); color: var(--blue-700); padding: 3px 6px; + overflow-wrap: anywhere; } .recommendation-meta { display: flex; - gap: 16px; - font: 10px var(--font-mono); + flex-wrap: wrap; + gap: 8px 16px; + margin-top: auto; + font: 12px/1.6 var(--font-mono); color: var(--ink-500); } .recommendation-meta > span { display: inline-flex; align-items: center; gap: 5px; + overflow-wrap: anywhere; } .recommendation-number { margin-left: auto; @@ -437,12 +448,14 @@ async function undoFeedback() { } .recommendation-compatibility { display: flex; + flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line-soft); - font: 9px var(--font-mono); + font: 12px/1.6 var(--font-mono); color: var(--ink-500); + overflow-wrap: anywhere; } .recommendation-state { text-align: center; @@ -463,6 +476,9 @@ async function undoFeedback() { display: inline-block; margin: 0 20px; font-size: 12px; + color: var(--blue-700); + text-decoration: underline; + text-underline-offset: 3px; } .recommendation-error { color: var(--danger-ink); @@ -482,7 +498,8 @@ async function undoFeedback() { text-decoration: underline; } .recommendation-end { - font-size: 10px; + font-size: 12px; + line-height: 1.7; color: var(--ink-500); margin: 16px 0 0; } diff --git a/frontend/src/components/SurveyOverprint.vue b/frontend/src/components/SurveyOverprint.vue index 531107b..f3041d6 100644 --- a/frontend/src/components/SurveyOverprint.vue +++ b/frontend/src/components/SurveyOverprint.vue @@ -1,12 +1,22 @@ diff --git a/frontend/src/components/catalog/CatalogFrame.vue b/frontend/src/components/catalog/CatalogFrame.vue index 5dab91d..e77029f 100644 --- a/frontend/src/components/catalog/CatalogFrame.vue +++ b/frontend/src/components/catalog/CatalogFrame.vue @@ -1,5 +1,24 @@ + + diff --git a/frontend/src/types/contentScrollRail.ts b/frontend/src/types/contentScrollRail.ts new file mode 100644 index 0000000..a9c934e --- /dev/null +++ b/frontend/src/types/contentScrollRail.ts @@ -0,0 +1,4 @@ +export interface ContentScrollRailItem { + id: string; + label: string; +} diff --git a/frontend/src/views/MarketView.vue b/frontend/src/views/MarketView.vue index b759bca..245edf6 100644 --- a/frontend/src/views/MarketView.vue +++ b/frontend/src/views/MarketView.vue @@ -47,6 +47,11 @@ const pageSize = 24, totalPages = computed(() => Math.max(1, Math.ceil(results.data.total / pageSize)), ); +const railItems = [ + { id: 'market-overview', label: '目录概览' }, + { id: 'market-filters', label: '分类与标签' }, + { id: 'market-results', label: '插件列表' }, +]; const hasFilters = computed( () => !!(query.value || category.value || tag.value || trust.value), ); @@ -113,8 +118,9 @@ onMounted(() => { });