Repository navigation
功能矩阵与全局功能读取失败时不再显示「还没有功能」(feature-matrix-error-false-empty) - #223
Merged
lc-cn merged 2 commits intoNov 28, 2026
Merged
Conversation
- featureListView:有行就列出;读取中显示骨架;读取失败且没有行时显示错误状态,只有读取成功且没有插件才显示「还没有功能」 - pluginListReadError:/api/plugins 失败时带上 HTTP 状态和 Host 的 code,StatusState 能分出无权限 / 需要新版 Host / 实例不可用,Host 原文留在技术详情 - 功能矩阵页由 ErrorAlert 改为 StatusState;两页在没有行时把错误状态放在卡片里,有旧行时仍在上方提示 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLUGBDtJbRzDTQgkyE1mGh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SLUGBDtJbRzDTQgkyE1mGh
Deploying zhin-demo-console with
|
| Latest commit: |
1423e6f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a75f7067.console-axj.pages.dev |
| Branch Preview URL: | https://console-feature-matrix-error.console-axj.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 #64:
feature-matrix-error-false-empty问题
功能矩阵(/features)和「全局 → 功能」读取插件列表失败时,错误提示下方仍显示「还没有功能 / 安装插件后,它们的功能会出现在这里」和「去插件市场」,把读取失败说成了没装插件。另外:
ErrorAlert显示;statusFromError分不出无权限 / 需要新版 Host / 实例不可用。确认问题存在的依据:
pages/features/feature-matrix.tsx:170-174只按!rows.length && !root显示空状态,global-features-panel.tsx:84-88只按!rows.length,都不看error;use-feature-data.ts:49抛出的 Error 没有 HTTP 状态和 Host 的 code;/api/plugins返回 500,修复前两页都同时出现错误和「还没有功能」;改法
featureListView({ loading, error, hasRows })(pages/features/feature-list-view.mjs+.d.mts):failed;empty。功能矩阵的
hasRows也算上项目自身的 root 行。pluginListReadError(status, body, t, retryAfter):/api/plugins失败时生成的 Error 带上:details.httpStatus;code(作为serverCode);Retry-After(如有)。这样
StatusState能按原因显示:403/401 为无权限,instance_unavailable为实例不可用(并按网关给的秒数建议重试),unsupported为需要新版 Host。Host 原文只留在「技术详情」里。两页的显示:
StatusState error=)放在原来空状态的位置,不再出现「还没有功能」;功能矩阵页不再使用
ErrorAlert。useFeatureMatrix新增failure字段,保存原始错误。其他使用方不读它,不受影响。没有新增文案,复用的「当前身份无权读取插件列表」「插件读取失败(HTTP {0})」「刷新失败,下面是上一次读取的内容。」都已有英文条目。
验证
npx tsc --noEmit、pnpm test(1970 通过)、pnpm lint:css、pnpm build全部通过(首屏 JS 507.4KB gzip)。新测试
tests/feature-matrix-error-false-empty.test.mjs(修复前失败)覆盖:instance_unavailable、unsupported、500 的statusFromError分类;Retry-After传到建议重试秒数;StatusState显示错误、只在读取成功时显示「还没有功能」、旧行上方是紧凑提示;hasRows算上 root 行。Playwright:预览 Host,
/features与/scope?tab=features。浅色 / 深色、375 / 1280 都看过,均无横向滚动。/api/pluginsforbiddeninstance_unavailable503 时页面顶部另有外壳自己的「实例不可用」横幅,属已有行为。
独立审查(只读子 Agent,只看条目原文和 diff):没有发现阻塞问题。它逐一确认了以下流程:
useFeatureMatrix的其他使用方不读error;它提的 4 个小问题:
Retry-After;statusFromError给出中文,目前没有地方直接显示matrix.error。本次没有改动样式(没有新增或修改 CSS 规则,只复用
StatusState和现有 class),遵守样式冻结(#125)。#111:
Generated by Claude Code