Skip to content

Add JSON editor aria labels, aria-ignore issue checks, and test hub - #272

Merged
steve02081504 merged 11 commits into
masterfrom
json-editor-aria
Aug 1, 2026
Merged

Add JSON editor aria labels, aria-ignore issue checks, and test hub#272
steve02081504 merged 11 commits into
masterfrom
json-editor-aria

Conversation

@steve02081504

@steve02081504 steve02081504 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Require i18n ariaLabel on shared vanilla-jsoneditor wrappers; add config/serviceSource/bot frontend coverage and locale keys.
  • Make aria-ignore take a GitHub issue URL; fail when the issue is closed (hub + Playwright teardown / test_watch).
  • Add an Express test hub on 127.0.0.1:8903 (hub/apis + clients) so one fount test run can share GitHub-issue state and KV across processes/browser.

Test plan

  • fount test testkit:github_issue --no-parallel
  • fount test shells/config:frontend:jsonEditor --no-parallel
  • Spot-check a bot JSON editor frontend suite (e.g. discordbot) if changed there

摘要

升级 vanilla-jsoneditor v3。统一使用 contentErrorsgetJson()。为配置、服务源和机器人页面增加本地化 aria-label 与 E2E 测试。规范 aria-ignore,并检查关联 GitHub Issue 是否关闭。

新增 Express test hub。测试运行器通过 127.0.0.1:8903FOUNT_TEST_HUB_URL 共享 Issue 状态及 KV 数据,并负责启动和清理。

架构与审美风险

测试基础设施耦合偏重。固定端口和进程级环境变量可能引发端口冲突。Issue 检查依赖 gh 和外部 GitHub 服务,可能降低测试稳定性。编辑器依赖 jsDelivr CDN,增加外部资源风险。

@cursor

cursor Bot commented Aug 1, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

本次变更升级 JSON 编辑器接口,加入多语言 aria-label,并为配置 Shell 增加 Playwright 检查。同时新增测试 Hub、GitHub Issue 状态查询和 aria-ignore 校验。

Changes

JSON 编辑器与本地化

Layer / File(s) Summary
编辑器接口与页面接入
src/public/pages/scripts/components/jsonEditor.mjs, src/public/parts/shells/*/public/*, src/public/parts/serviceGenerators/AI/proxy/display.mjs
编辑器升级到 v3,改用 text 模式、ariaLabelcontentErrorsgetJson()。配置页面和服务生成器同步使用新接口。
本地化契约与文本
src/decl/locale_data.ts, src/public/locales/*.json
四类配置编辑器新增 jsonEditor.'aria-label' 字段及多语言文本。

测试 Hub 与无障碍检查

Layer / File(s) Summary
Hub 服务、客户端与运行器
src/scripts/test/hub/*, src/scripts/test/core/github_issue.mjs, src/scripts/test/runner/index.mjs, src/scripts/test/selftest/*
新增测试 Hub、健康检查、共享存储和 GitHub Issue 查询。测试运行器负责启动 Hub、传播 FOUNT_TEST_HUB_URL 并清理资源。
aria-ignore 校验
src/public/pages/scripts/test/test_watch.mjs, src/scripts/test/playwright/github_issue.mjs, src/scripts/test/playwright/fixtures.mjs, .github/pages/test/frontend/fixtures.mjs
校验 aria-ignore 的 GitHub Issue URL,并从 axe 扫描中排除对应子树。Playwright 收尾阶段检查 Issue 状态。

前端验证

Layer / File(s) Summary
JSON 编辑器 Playwright 测试
src/scripts/test/playwright/json_editor.mjs, src/public/parts/shells/*/test/frontend/*, src/public/parts/shells/*/test/manifest.json
新增共享 aria-label 断言,并为配置页面接入分阶段测试。

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
审美与简洁 ⚠️ Warning 审美不合格:core/github_issue.mjs:4 仅做重导出;jsonEditor.mjs 使用 base、jse_style 缩写;三个 onChange 盘问并解构未使用参数。 删除 core 重导出层并直接导入实现;将缩写改为语义完整名称;onChange 仅保留 contentErrors,删除未使用参数及 any/root0 JSDoc。
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了 JSON 编辑器无障碍支持、aria-ignore issue 校验和测试 Hub 三项核心变更,且不是空泛或文件列表。
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch json-editor-aria

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.

@codacy-production

codacy-production Bot commented Aug 1, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 102 complexity · 0 duplication

Metric Results
Complexity 102
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 14

🤖 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 `@src/public/locales/lzh.json`:
- Around line 3662-3664: Update the `aria-label` value for all four `jsonEditor`
entries in `src/public/locales/lzh.json`, including the occurrences near the
referenced locations, replacing `JSON 樞機` with `JSON 編輯器` while leaving the
surrounding locale structure unchanged.

In `@src/public/pages/scripts/components/jsonEditor.mjs`:
- Line 1: Remove the pinned `@3` major version from both vanilla-jsoneditor CDN
URLs in src/public/pages/scripts/components/jsonEditor.mjs:1-1 and
src/public/pages/scripts/components/jsonEditor.mjs:69-69. Update the
createJSONEditor import and theme stylesheet URL to use standalone.js paths that
follow the latest upstream version.
- Around line 34-38: Remove JSON parsing from the Ctrl+S handler around the
onSave callback: call e.preventDefault() before invoking onSave, then pass the
editor result directly so saveConfig(), handleSaveConfig(), or saveFile()
performs validation. Preserve the existing Ctrl+S condition and onSave guard.

In `@src/public/parts/shells/config/public/index.html`:
- Line 38: Update the decorative img element in the shell markup to include an
empty alt attribute while preserving aria-hidden="true" and the existing
presentation.

In `@src/public/parts/shells/config/test/manifest.json`:
- Around line 4-10: Update the frontendShared arrays in
src/public/parts/shells/config/test/manifest.json lines 4-10 and
src/public/parts/shells/discordbot/test/manifest.json lines 19-25 to include
src/public/locales/**, ensuring locale-only changes trigger the JSON editor test
suites.

In `@src/public/parts/shells/serviceSourceManage/test/frontend/phases.mjs`:
- Around line 1-4: 为导出的 phases 配置补充一行真实的中文 JSDoc 摘要,说明其用于定义 Playwright
测试阶段配置;保留现有的 `@type` 类型标注不变。

In `@src/scripts/test/core/github_issue.mjs`:
- Around line 10-16: Update parseGithubIssueUrl in
src/scripts/test/core/github_issue.mjs (lines 10-16) to accept only HTTPS
github.com URLs without credentials or a port, while preserving the existing
issue-path validation. Add assertions in
src/scripts/test/selftest/github_issue.test.mjs (lines 20-23) that URLs using
non-HTTPS schemes, credentials, or ports return null.

In `@src/scripts/test/hub/apis/github_issue.mjs`:
- Around line 13-48: Update createGithubIssueRouter to parse each issue URL
once, pass the parsed result into probeGithubIssueClosed, and use that value for
probing. In probeGithubIssueClosed, read JSON exclusively from result.stdout,
compare state directly with 'CLOSED', and have the route return the cached
boolean without an additional === true check.

In `@src/scripts/test/hub/base_url.mjs`:
- Around line 10-16: Inline the single-use fromEnv and fromPage bindings in the
URL return expression, preserving the environment-first fallback order, trimming
each selected value, and removing one trailing slash as currently done.

In `@src/scripts/test/hub/clients/github_issue.mjs`:
- Around line 15-22: 为客户端 GitHub issue 查询增加有界超时:更新 github_issue.mjs 中的
isGithubIssueClosed,并同步处理 test_watch.mjs 中的 checkAriaIgnores,使对 /github-issue 的
fetch 在超时后结束并按未关闭处理;同时在服务端 github-issue 处理逻辑调用 execFile('gh', ...) 时配置超时,确保 gh
issue view 挂起不会无限等待。

In `@src/scripts/test/hub/clients/shared_store.mjs`:
- Around line 12-67: 在 shared-store 客户端中新增本地 URL 构造 helper,并让
hubSharedStoreGet、hubSharedStoreSet、hubSharedStoreDelete 统一通过它生成请求地址;移除
hubSharedStoreGet 中被 !res.ok 覆盖的 404 特判,并将 Set/Delete 的成功判断简化为直接返回 res.ok。

In `@src/scripts/test/hub/index.mjs`:
- Around line 25-46: 将两个 Express 中间件的参数从 _req 重命名为 req,因为第一个中间件实际读取了
req.method;同时调整 app.listen 结果返回的 url,复用已有的本地服务 URL 表达式,避免再次拼接 http://127.0.0.1:。

In `@src/scripts/test/manifest.json`:
- Around line 229-249: Rename the manifest suite currently named github_issue to
test_hub, keeping its existing run commands, test files, and triggers unchanged
so the suite name accurately reflects its hub self-test coverage.

In `@src/scripts/test/runner/index.mjs`:
- Around line 784-787: 在当前函数的 finally 清理逻辑中,删除对 FOUNT_TEST_HUB_URL 与 hub.url
的条件比较,直接移除 FOUNT_TEST_HUB_URL 环境变量;保留 hub.close() 的关闭处理不变。
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8ce40cd3-fb67-4a69-a0e5-8c4560e0e1b7

📥 Commits

Reviewing files that changed from the base of the PR and between 25944e6 and 3bb9a86.

📒 Files selected for processing (71)
  • .github/pages/test/frontend/fixtures.mjs
  • src/decl/locale_data.ts
  • src/public/locales/ar-SA.json
  • src/public/locales/de-DE.json
  • src/public/locales/emoji.json
  • src/public/locales/en-UK.json
  • src/public/locales/es-ES.json
  • src/public/locales/fr-FR.json
  • src/public/locales/hi-IN.json
  • src/public/locales/is-IS.json
  • src/public/locales/it-IT.json
  • src/public/locales/ja-JP.json
  • src/public/locales/ko-KR.json
  • src/public/locales/lzh.json
  • src/public/locales/nl-NL.json
  • src/public/locales/pt-PT.json
  • src/public/locales/ru-RU.json
  • src/public/locales/uk-UA.json
  • src/public/locales/vi-VN.json
  • src/public/locales/zh-CN.json
  • src/public/locales/zh-TW.json
  • src/public/pages/AGENTS.md
  • src/public/pages/scripts/components/jsonEditor.mjs
  • src/public/pages/scripts/test/test_watch.mjs
  • src/public/parts/shells/config/public/index.html
  • src/public/parts/shells/config/public/index.mjs
  • src/public/parts/shells/config/test/frontend/fixtures.mjs
  • src/public/parts/shells/config/test/frontend/jsonEditor.spec.mjs
  • src/public/parts/shells/config/test/frontend/phases.mjs
  • src/public/parts/shells/config/test/frontend/playwright.config.mjs
  • src/public/parts/shells/config/test/frontend/run.mjs
  • src/public/parts/shells/config/test/manifest.json
  • src/public/parts/shells/config/test/node_bootstrap.mjs
  • src/public/parts/shells/discordbot/public/index.mjs
  • src/public/parts/shells/discordbot/test/frontend/jsonEditor.spec.mjs
  • src/public/parts/shells/discordbot/test/frontend/phases.mjs
  • src/public/parts/shells/discordbot/test/manifest.json
  • src/public/parts/shells/serviceSourceManage/public/index.html
  • src/public/parts/shells/serviceSourceManage/public/index.mjs
  • src/public/parts/shells/serviceSourceManage/test/frontend/fixtures.mjs
  • src/public/parts/shells/serviceSourceManage/test/frontend/jsonEditor.spec.mjs
  • src/public/parts/shells/serviceSourceManage/test/frontend/phases.mjs
  • src/public/parts/shells/serviceSourceManage/test/frontend/playwright.config.mjs
  • src/public/parts/shells/serviceSourceManage/test/frontend/run.mjs
  • src/public/parts/shells/serviceSourceManage/test/manifest.json
  • src/public/parts/shells/serviceSourceManage/test/node_bootstrap.mjs
  • src/public/parts/shells/telegrambot/public/index.mjs
  • src/public/parts/shells/telegrambot/test/frontend/jsonEditor.spec.mjs
  • src/public/parts/shells/telegrambot/test/frontend/phases.mjs
  • src/public/parts/shells/telegrambot/test/manifest.json
  • src/public/parts/shells/wechatbot/public/index.mjs
  • src/public/parts/shells/wechatbot/test/frontend/jsonEditor.spec.mjs
  • src/public/parts/shells/wechatbot/test/frontend/phases.mjs
  • src/public/parts/shells/wechatbot/test/manifest.json
  • src/scripts/test/AGENTS.md
  • src/scripts/test/core/github_issue.mjs
  • src/scripts/test/docs/playwright.md
  • src/scripts/test/hub/apis/github_issue.mjs
  • src/scripts/test/hub/apis/health.mjs
  • src/scripts/test/hub/apis/shared_store.mjs
  • src/scripts/test/hub/base_url.mjs
  • src/scripts/test/hub/clients/github_issue.mjs
  • src/scripts/test/hub/clients/shared_store.mjs
  • src/scripts/test/hub/index.mjs
  • src/scripts/test/manifest.json
  • src/scripts/test/playwright/fixtures.mjs
  • src/scripts/test/playwright/github_issue.mjs
  • src/scripts/test/playwright/json_editor.mjs
  • src/scripts/test/runner/index.mjs
  • src/scripts/test/selftest/github_issue.test.mjs
  • src/scripts/test/selftest/test_hub.test.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)

Comment thread src/public/locales/lzh.json
@@ -1,29 +1,43 @@
import { createJSONEditor as base } from 'https://cdn.jsdelivr.net/npm/vanilla-jsoneditor@2/standalone.js'
import { createJSONEditor as base } from 'https://cdn.jsdelivr.net/npm/vanilla-jsoneditor@3/standalone.js'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

移除 CDN 主版本固定。

该项目的 CDN 策略要求跟随上游最新版本。不要固定到 @3

  • src/public/pages/scripts/components/jsonEditor.mjs#L1-L1: 改为不含 @3standalone.js 地址。
  • src/public/pages/scripts/components/jsonEditor.mjs#L69-L69: 改为不含 @3 的主题样式地址。

Based on learnings: “remote ESM imports … are intentionally left unpinned to follow the latest upstream.”

📍 Affects 1 file
  • src/public/pages/scripts/components/jsonEditor.mjs#L1-L1 (this comment)
  • src/public/pages/scripts/components/jsonEditor.mjs#L69-L69
🤖 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 `@src/public/pages/scripts/components/jsonEditor.mjs` at line 1, Remove the
pinned `@3` major version from both vanilla-jsoneditor CDN URLs in
src/public/pages/scripts/components/jsonEditor.mjs:1-1 and
src/public/pages/scripts/components/jsonEditor.mjs:69-69. Update the
createJSONEditor import and theme stylesheet URL to use standalone.js paths that
follow the latest upstream version.

Source: Learnings

Comment thread src/public/parts/shells/config/public/index.html Outdated
Comment thread src/public/parts/shells/config/test/manifest.json
Comment thread src/scripts/test/hub/clients/github_issue.mjs
Comment thread src/scripts/test/hub/clients/shared_store.mjs
Comment thread src/scripts/test/hub/index.mjs Outdated
Comment thread src/scripts/test/manifest.json
Comment thread src/scripts/test/runner/index.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
src/public/parts/shells/telegrambot/public/index.mjs (1)

230-242: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

删除一次性 configJson 绑定。

configJson 只用于填充一次请求体。保留该临时值会拉长解析流程。让解析后的值直接组成有语义的请求体绑定,并保留当前无效 JSON 的早退提示。

按路径规范,“禁止只用一次的临时绑定,内联到使用处”。

🤖 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 `@src/public/parts/shells/telegrambot/public/index.mjs` around lines 230 - 242,
Remove the one-time configJson binding in the request-building flow: preserve
the existing try/catch and invalid-JSON early return, then use the parsed result
directly when constructing the config request body. Keep the token and character
fields unchanged.

Source: Path instructions

src/public/pages/scripts/test/test_watch.mjs (1)

244-258: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

并行且去重 aria-ignore 查询。

Line 246 位于节点循环内,并且每个 URL 都会串行等待 10 秒超时。Hub 不可达时,多个节点会把一次 a11y 扫描阻塞为 N × 10swatchChain 会继续放大该延迟。按 URL 去重后并行请求,并缓存本次页面的查询结果。

🤖 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 `@src/public/pages/scripts/test/test_watch.mjs` around lines 244 - 258,
更新节点循环中的 aria-ignore 查询流程:按 URL 去重并缓存当前页面的查询结果,避免同一 URL 被重复请求;将唯一 URL 的 Hub
请求并行执行,而不是在循环中逐个等待 10 秒超时。保持现有 closed 判断、printedKeys 去重及错误容忍行为不变,并将查询结果复用于对应节点。
src/scripts/test/hub/clients/shared_store.mjs (1)

23-75: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

为 shared-store request 加有界超时。

GET、PUT、DELETE 的 fetch 都默认无限等待;Hub 进程或网络卡住时测试运行器可能一直挂起。为三个请求统一复用一个 AbortController/超时常量或用请求 helper 封装。

🤖 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 `@src/scripts/test/hub/clients/shared_store.mjs` around lines 23 - 75, 为
hubSharedStoreGet、hubSharedStoreSet 和 hubSharedStoreDelete 的 fetch
请求增加统一的有界超时;复用超时常量及 AbortController 或提取共享请求 helper,并在请求完成或失败后清理定时器,确保 Hub
或网络无响应时分别按现有返回约定结束而不会无限等待。
🤖 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 `@src/public/pages/scripts/components/jsonEditor.mjs`:
- Around line 45-49: 将 createJsonEditor 中的 Ctrl+S keydown 监听器从 document 改为绑定到对应的
jsonEditorContainer,并保持现有的 preventDefault 与 onSave(result.getJson())
行为不变,确保只有该编辑器容器内的按键触发保存。

In `@src/scripts/test/core/github_issue.mjs`:
- Around line 11-13: Update the URL regular expression in the GitHub issue
parsing logic to require the entire input to match a valid Issue URL by adding
an end-of-string boundary. Keep the existing owner, repo, and issue-number
extraction in the match result unchanged, while rejecting URLs with trailing
segments or other extra characters.

In `@src/scripts/test/hub/apis/github_issue.mjs`:
- Around line 26-27: 在解析 GitHub issue 响应的函数中,移除只使用一次的 data 临时变量,直接对
JSON.parse(raw) 的结果执行 state === 'CLOSED' 判断并返回。

---

Outside diff comments:
In `@src/public/pages/scripts/test/test_watch.mjs`:
- Around line 244-258: 更新节点循环中的 aria-ignore 查询流程:按 URL 去重并缓存当前页面的查询结果,避免同一 URL
被重复请求;将唯一 URL 的 Hub 请求并行执行,而不是在循环中逐个等待 10 秒超时。保持现有 closed 判断、printedKeys
去重及错误容忍行为不变,并将查询结果复用于对应节点。

In `@src/public/parts/shells/telegrambot/public/index.mjs`:
- Around line 230-242: Remove the one-time configJson binding in the
request-building flow: preserve the existing try/catch and invalid-JSON early
return, then use the parsed result directly when constructing the config request
body. Keep the token and character fields unchanged.

In `@src/scripts/test/hub/clients/shared_store.mjs`:
- Around line 23-75: 为 hubSharedStoreGet、hubSharedStoreSet 和
hubSharedStoreDelete 的 fetch 请求增加统一的有界超时;复用超时常量及 AbortController 或提取共享请求
helper,并在请求完成或失败后清理定时器,确保 Hub 或网络无响应时分别按现有返回约定结束而不会无限等待。
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: da4c4264-2c2f-46e5-9fdd-3e1af8571902

📥 Commits

Reviewing files that changed from the base of the PR and between 3bb9a86 and cb6a405.

📒 Files selected for processing (27)
  • .github/pages/test/manifest.json
  • src/public/locales/lzh.json
  • src/public/pages/AGENTS.md
  • src/public/pages/scripts/components/jsonEditor.mjs
  • src/public/pages/scripts/test/test_watch.mjs
  • src/public/parts/serviceGenerators/AI/proxy/display.mjs
  • src/public/parts/shells/config/public/index.html
  • src/public/parts/shells/config/public/index.mjs
  • src/public/parts/shells/config/test/manifest.json
  • src/public/parts/shells/discordbot/public/index.mjs
  • src/public/parts/shells/discordbot/test/manifest.json
  • src/public/parts/shells/serviceSourceManage/public/index.mjs
  • src/public/parts/shells/serviceSourceManage/test/frontend/phases.mjs
  • src/public/parts/shells/serviceSourceManage/test/manifest.json
  • src/public/parts/shells/telegrambot/public/index.mjs
  • src/public/parts/shells/telegrambot/test/manifest.json
  • src/public/parts/shells/wechatbot/public/index.mjs
  • src/public/parts/shells/wechatbot/test/manifest.json
  • src/scripts/test/AGENTS.md
  • src/scripts/test/core/github_issue.mjs
  • src/scripts/test/hub/apis/github_issue.mjs
  • src/scripts/test/hub/base_url.mjs
  • src/scripts/test/hub/clients/github_issue.mjs
  • src/scripts/test/hub/clients/shared_store.mjs
  • src/scripts/test/hub/index.mjs
  • src/scripts/test/manifest.json
  • src/scripts/test/runner/index.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)
💤 Files with no reviewable changes (1)
  • .github/pages/test/manifest.json

Comment thread src/public/pages/scripts/components/jsonEditor.mjs Outdated
Comment thread src/scripts/test/core/github_issue.mjs Outdated
Comment thread src/scripts/test/hub/apis/github_issue.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/public/pages/scripts/test/test_watch.mjs (1)

25-26: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

使浏览器校验与共享解析器一致。

当前正则接受 #fragment、查询串和尾斜杠。parseGithubIssueUrl() 拒绝这些值。Hub 随后返回非成功响应,但此处把它当作未确认状态,因此不会报告非法 aria-ignore

只接受与共享解析器相同的完整 URL。

建议修改
-const GITHUB_ISSUE_URL_RE = /^https:\/\/github\.com\/[^/]+\/[^/]+\/issues\/\d+\/?(?:[?#].*)?$/i
+const GITHUB_ISSUE_URL_RE = /^https:\/\/github\.com\/[^/]+\/[^/]+\/issues\/\d+$/
🤖 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 `@src/public/pages/scripts/test/test_watch.mjs` around lines 25 - 26, 更新
GITHUB_ISSUE_URL_RE,使其与 parseGithubIssueUrl() 的完整 URL 解析规则一致,仅接受以 /issues/{数字}
结尾的 GitHub issue URL;移除对尾斜杠、查询串和 fragment 的接受,保留现有协议、主机及仓库路径校验。

Source: Coding guidelines

🤖 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 `@src/scripts/test/playwright/github_issue.mjs`:
- Around line 8-10: 将 `isGithubIssueClosed` 上方的空 JSDoc 替换为一行真实的中文摘要,明确说明该函数用于判断
GitHub issue 是否已关闭;保持其余导出和实现不变。

---

Outside diff comments:
In `@src/public/pages/scripts/test/test_watch.mjs`:
- Around line 25-26: 更新 GITHUB_ISSUE_URL_RE,使其与 parseGithubIssueUrl() 的完整 URL
解析规则一致,仅接受以 /issues/{数字} 结尾的 GitHub issue URL;移除对尾斜杠、查询串和 fragment
的接受,保留现有协议、主机及仓库路径校验。
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 471b1666-b230-43ed-a1ea-6f97530076f0

📥 Commits

Reviewing files that changed from the base of the PR and between cb6a405 and dc59b84.

📒 Files selected for processing (11)
  • .github/pages/test/frontend/fixtures.mjs
  • src/public/pages/scripts/components/jsonEditor.mjs
  • src/public/pages/scripts/test/test_watch.mjs
  • src/public/parts/shells/telegrambot/public/index.mjs
  • src/scripts/test/core/github_issue.mjs
  • src/scripts/test/hub/apis/github_issue.mjs
  • src/scripts/test/hub/clients/shared_store.mjs
  • src/scripts/test/playwright/fixtures.mjs
  • src/scripts/test/playwright/github_issue.mjs
  • src/scripts/test/selftest/github_issue.test.mjs
  • src/scripts/test/selftest/test_hub.test.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)

Comment thread src/scripts/test/playwright/github_issue.mjs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/public/pages/scripts/test/test_watch.mjs (1)

228-262: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

改用完整标识符,并内联一次性绑定。

elreswhere 不够明确。data 只使用一次。请改用 elementresponselocation,并直接将 await response.json() 传入 closedByUrl.set()

建议修改
-for (const el of nodes) {
-	const where = el.id ? `#${el.id}` : el.className || el.tagName
+for (const element of nodes) {
+	const location = element.id ? `#${element.id}` : element.className || element.tagName

-			const res = await fetch(`${hub}/github-issue?url=${encodeURIComponent(url)}`, {
+			const response = await fetch(`${hub}/github-issue?url=${encodeURIComponent(url)}`, {
 				signal: AbortSignal.timeout(10_000),
 			})
-			if (!res.ok) {
+			if (!response.ok) {
 				closedByUrl.set(url, false)
 				return
 			}
-			const data = await res.json()
-			closedByUrl.set(url, data?.closed === true)
+			closedByUrl.set(url, (await response.json())?.closed === true)

As per path instructions:标识符必须使用可读的完整词,且一次性临时绑定必须内联。

🤖 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 `@src/public/pages/scripts/test/test_watch.mjs` around lines 228 - 262,
在遍历节点和请求 GitHub issue 的逻辑中,将一次性或缩写标识符重命名为完整可读名称:使用 element、location 和 response
替换 el、where 和 res;移除仅使用一次的 data 临时变量,并将 await response.json() 直接传入
closedByUrl.set()。

Source: Path instructions

🤖 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.

Outside diff comments:
In `@src/public/pages/scripts/test/test_watch.mjs`:
- Around line 228-262: 在遍历节点和请求 GitHub issue 的逻辑中,将一次性或缩写标识符重命名为完整可读名称:使用
element、location 和 response 替换 el、where 和 res;移除仅使用一次的 data 临时变量,并将 await
response.json() 直接传入 closedByUrl.set()。

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c4bfdd2f-160a-4715-87a9-f054b4243d09

📥 Commits

Reviewing files that changed from the base of the PR and between dc59b84 and 10ab91b.

📒 Files selected for processing (2)
  • src/public/pages/scripts/test/test_watch.mjs
  • src/scripts/test/playwright/github_issue.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/public/pages/scripts/test/test_watch.mjs (2)

19-23: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

同步模块说明与导出 API。

Line 23 导出了 ARIA_IGNORE,但模块头部 Line 2 仍写着“无导出”。这会误导维护者。更新模块说明,或在确认没有消费者后删除该导出。

🤖 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 `@src/public/pages/scripts/test/test_watch.mjs` around lines 19 - 23, Update
the module header documentation in test_watch.mjs to reflect that ARIA_IGNORE is
exported, keeping the existing export API unchanged unless consumer checks
confirm it is unused and removal is explicitly appropriate.

4-5: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

让 URL 校验真正兑现文档承诺。

[^/]+ 会接受 ?#、空格和换行。比如 https://github.com/owner?x/repo/issues/1 会通过正则,但实际 URL 路径不是 GitHub issue 路径。该值随后仍会进入 axeexclude,而 Hub 失败或非成功响应也不会报错。

让浏览器侧校验与 parseGithubIssueUrl 共用同一解析逻辑。不要用第二套宽松正则绕过格式校验。

Also applies to: 25-26, 239-245

🤖 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 `@src/public/pages/scripts/test/test_watch.mjs` around lines 4 - 5, 更新浏览器侧的
aria-ignore URL 校验逻辑,改为复用 parseGithubIssueUrl 的解析与格式判定,不再使用允许
?、#、空白或换行的独立宽松正则;在相关校验位置(包括 25-26、239-245)统一拒绝解析失败的值,并仅将解析确认有效的 GitHub issue URL
传给 axe exclude,同时保留现有非法值报错行为。
🤖 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 `@src/public/pages/scripts/test/test_watch.mjs`:
- Around line 252-255: 更新 runA11y 中针对 github-issue 的查询逻辑,按测试运行缓存每个 URL
的进行中请求及成功结果,避免 DOM 变化时重复阻塞请求;失败结果应采用退避策略,并让 watchChain
复用缓存而非持续排队等待。收尾检查需要最新状态时,提供并调用显式刷新路径。

---

Outside diff comments:
In `@src/public/pages/scripts/test/test_watch.mjs`:
- Around line 19-23: Update the module header documentation in test_watch.mjs to
reflect that ARIA_IGNORE is exported, keeping the existing export API unchanged
unless consumer checks confirm it is unused and removal is explicitly
appropriate.
- Around line 4-5: 更新浏览器侧的 aria-ignore URL 校验逻辑,改为复用 parseGithubIssueUrl
的解析与格式判定,不再使用允许 ?、#、空白或换行的独立宽松正则;在相关校验位置(包括 25-26、239-245)统一拒绝解析失败的值,并仅将解析确认有效的
GitHub issue URL 传给 axe exclude,同时保留现有非法值报错行为。
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ead53459-53e2-49b6-94c4-8883448bcb08

📥 Commits

Reviewing files that changed from the base of the PR and between 10ab91b and 18dabe0.

📒 Files selected for processing (1)
  • src/public/pages/scripts/test/test_watch.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)

Comment thread src/public/pages/scripts/test/test_watch.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@src/public/pages/scripts/test/github_issue.mjs`:
- Around line 10-14: Remove the unnecessary String conversion in
parseGithubIssueUrl and match the declared string parameter directly against the
GitHub issue URL pattern. Preserve the existing null return for non-matching
valid strings, while allowing invalid non-string inputs to fail naturally
instead of being coerced.

In `@src/public/pages/scripts/test/test_watch.mjs`:
- Around line 126-127: Extract the duplicated hub URL normalization expression
into a shared getHubUrl() function, then replace the local implementations in
both probeGithubIssueClosed and checkAriaIgnores with calls to that function
while preserving the existing trailing-slash removal behavior.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e3a92bf2-8c74-4998-9863-245495095d51

📥 Commits

Reviewing files that changed from the base of the PR and between 10ab91b and 07edd6f.

📒 Files selected for processing (4)
  • src/public/pages/scripts/test/github_issue.mjs
  • src/public/pages/scripts/test/test_watch.mjs
  • src/scripts/test/core/github_issue.mjs
  • src/scripts/test/manifest.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)

Comment thread src/public/pages/scripts/test/github_issue.mjs
Comment thread src/public/pages/scripts/test/test_watch.mjs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/public/pages/scripts/test/test_watch.mjs (1)

114-118: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

不要清空进行中的请求。

Line 117 删除 githubIssueInflight 后,旧请求仍会继续执行。若 kickWatch() 立即发起刷新探测,旧响应可能覆盖新响应;旧请求的 finally 还可能删除新请求的 Map 项。最终的关闭态缓存不再代表显式刷新后的状态,CI 判定会漂移。

保留进行中的 Promise,让 probeGithubIssueClosed(..., { refresh: true }) 先等待旧请求,再创建新请求。

建议改法
 function refreshGithubIssueProbes() {
 	githubIssueClosedCache.clear()
 	githubIssueBackoffUntil.clear()
-	githubIssueInflight.clear()
 }

依据当前文件中 refreshGithubIssueProbes()probeGithubIssueClosed()kickWatch() 的调用顺序。

🤖 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 `@src/public/pages/scripts/test/test_watch.mjs` around lines 114 - 118, Remove
the githubIssueInflight.clear() call from refreshGithubIssueProbes(). Keep
in-flight promises intact so probeGithubIssueClosed(..., { refresh: true })
waits for the existing request before creating a replacement, preventing stale
responses or finally handlers from affecting refreshed state; retain clearing
the closed and backoff caches.
🤖 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 `@src/public/pages/scripts/test/github_issue.mjs`:
- Line 11: 更新 github_issue.mjs 中生成 match 的 URL 正则:限制 owner 和 repo 不得包含 /、?、#
或空白字符,并要求 issue 编号为正数而非 0;保持完整 URL 格式校验,使非法输入无法生成 parsed 并进入 axe.exclude。

---

Outside diff comments:
In `@src/public/pages/scripts/test/test_watch.mjs`:
- Around line 114-118: Remove the githubIssueInflight.clear() call from
refreshGithubIssueProbes(). Keep in-flight promises intact so
probeGithubIssueClosed(..., { refresh: true }) waits for the existing request
before creating a replacement, preventing stale responses or finally handlers
from affecting refreshed state; retain clearing the closed and backoff caches.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b3a297a0-c1dc-47fc-aba1-b40db122cc37

📥 Commits

Reviewing files that changed from the base of the PR and between 07edd6f and 9b5467f.

📒 Files selected for processing (2)
  • src/public/pages/scripts/test/github_issue.mjs
  • src/public/pages/scripts/test/test_watch.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • steve02081504/fount-p2p (manual)

* @returns {{ owner: string, repo: string, number: string } | null} 解析结果
*/
export function parseGithubIssueUrl(url) {
const match = url.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)$/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

拒绝伪造的 GitHub issue URL。

当前正则允许 ?# 和空白出现在 owner 或 repo 中。例如,https://github.com/org/repo?x/issues/1 会被解析成功。test_watch.mjs 随后仅按 parsed 把节点加入 axe.exclude,坏 URL 可以绕过无障碍扫描而不报错。

至少排除 URL 分隔符,并要求 issue 编号为正数。

建议改法
-	const match = url.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)$/)
+	const match = url.match(/^https:\/\/github\.com\/([^/?#\s]+)\/([^/?#\s]+)\/issues\/([1-9]\d*)$/)

依据 PR 目标中“非法格式报错”,以及 parsed 直接进入 axe.exclude 的调用契约。

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const match = url.match(/^https:\/\/github\.com\/([^/]+)\/([^/]+)\/issues\/(\d+)$/)
const match = url.match(/^https:\/\/github\.com\/([^/?#\s]+)\/([^/?#\s]+)\/issues\/([1-9]\d*)$/)
🤖 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 `@src/public/pages/scripts/test/github_issue.mjs` at line 11, 更新
github_issue.mjs 中生成 match 的 URL 正则:限制 owner 和 repo 不得包含 /、?、# 或空白字符,并要求 issue
编号为正数而非 0;保持完整 URL 格式校验,使非法输入无法生成 parsed 并进入 axe.exclude。

@steve02081504
steve02081504 merged commit ca26e21 into master Aug 1, 2026
13 of 14 checks passed
@steve02081504
steve02081504 deleted the json-editor-aria branch August 1, 2026 14:11
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