Skip to content

docs: 示例与测试改用中性的场景名和接口路径 - #46

Merged
HarlonWang merged 1 commit into
mainfrom
chore/neutral-examples
Oct 28, 2026
Merged

HarlonWang merged 1 commit into
mainfrom
chore/neutral-examples

Conversation

@HarlonWang

@HarlonWang HarlonWang commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

文档、代码注释与测试里的示例改成中性写法:验证码场景名用 signup、接口路径用 /api/v1/...、「人机验证」作通称,去掉具体宿主的名字与指标。只改示例文本,不改行为。

  • pnpm --filter tinyui-native test 通过;Kotlin 测试只改了断言里的字符串

🤖 Generated with Claude Code

Summary by Sourcery

将文档、注释和测试中的示例改为中性命名与通用接口路径,同时保持运行行为不变。

Enhancements:

  • 更新文档、代码注释和测试中的示例,采用中性的验证码场景名、人机验证术语及通用 API 路径,避免绑定具体宿主或服务指标。

Documentation:

  • 将应用模型、原生 API 和路线图中的具体产品示例替换为中性表述。

Tests:

  • 同步更新 Kotlin 和 TypeScript 测试中的示例路径、场景名及断言。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

本 PR 仅调整文档、注释和测试中的示例文本:统一使用 signup、/api/v1/... 及“人机验证”等中性表述,并同步更新相关断言;运行行为和接口实现未改变。

File-Level Changes

Change Details Files
将验证码示例统一为中性的场景名,并同步更新跨语言测试与 HTTP 标签断言。
  • 将 USER_REGISTER 替换为 signup
  • 更新 Kotlin、TypeScript 测试及 native API 注释中的对应示例
compose/src/commonTest/kotlin/app/tinyui/PageHostTest.kt
packages/native/src/http.ts
packages/native/test/native.test.ts
将文档中的接口示例路径统一为 /api/v1/...,移除具体宿主或应用前缀。
  • 更新验证码和注册接口示例路径
  • 同步调整测试请求与断言中的路径
docs/native-api.md
packages/native/test/native.test.ts
移除文档示例中的具体产品、验证服务和性能指标名称,改用中性表述。
  • 将具体宿主名替换为注册流程或通用后端描述
  • 将具体验证服务改为“人机验证”
  • 将具体性能门槛改为宿主预算
docs/app-model.md
docs/native-api.md
docs/roadmap.md

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

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d6bd908-c319-4225-823d-c45ec9bdca33
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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

CodeSeer 审查

结论:批准

摘要

本次改动将测试、注释和文档中的验证码场景名、接口路径及宿主相关表述替换为中性示例。Kotlin 与 TypeScript 测试的断言和对应测试输入保持一致,未见由这些文本替换引入的行为变化或接口不一致。

整个 PR 至 48c3e20 · gpt-5.6-terra

@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 1 issue

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

## Individual Comments

### Comment 1
<location path="compose/src/commonTest/kotlin/app/tinyui/PageHostTest.kt" line_range="64" />
<code_context>
+                if (event === "onTagged") { __host_call("http.request", 21, JSON.stringify({ channel: "app", method: "POST", url: "/code", body: {}, tags: { captchaScene: "signup" } })); __host_call("http.request", 22, JSON.stringify({ channel: "app", method: "GET", url: "/code", tags: { n: 1 } })); }
</code_context>
<issue_to_address>
**Kotlin example keeps an unversioned route**

When the tagged-request fixture runs, `onTagged` still calls `/code`, and the fake channel only recognizes that route, so the Kotlin test continues to demonstrate a path outside the stated `/api/v1/...` convention.

Change the fixture URL and its fake-channel matcher to a path such as `/api/v1/code`.
</issue_to_address>

Sourcery assessment

Approved.


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

if (event === "onZone") patches.push(["p",1,"text", [__host_query("i18n.timeZone", "{}"), __host_query("i18n.zoneOffset", JSON.stringify({ ms: 1767225600000 })), __host_query("i18n.zoneOffset", JSON.stringify({ ms: 1782864000000 }))].join("|")]);
if (event === "onI18nSubscribe") { __host_send("i18n.subscribe", "{}"); patches.push(["p",1,"text","subscribed"]); }
if (event === "onTagged") { __host_call("http.request", 21, JSON.stringify({ channel: "app", method: "POST", url: "/code", body: {}, tags: { captchaScene: "USER_REGISTER" } })); __host_call("http.request", 22, JSON.stringify({ channel: "app", method: "GET", url: "/code", tags: { n: 1 } })); }
if (event === "onTagged") { __host_call("http.request", 21, JSON.stringify({ channel: "app", method: "POST", url: "/code", body: {}, tags: { captchaScene: "signup" } })); __host_call("http.request", 22, JSON.stringify({ channel: "app", method: "GET", url: "/code", tags: { n: 1 } })); }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ Low · Kotlin example keeps an unversioned route

When the tagged-request fixture runs, onTagged still calls /code, and the fake channel only recognizes that route, so the Kotlin test continues to demonstrate a path outside the stated /api/v1/... convention.

Change the fixture URL and its fake-channel matcher to a path such as /api/v1/code.

Prompt for AI agents
In `compose/src/commonTest/kotlin/app/tinyui/PageHostTest.kt` at line 64:

**Kotlin example keeps an unversioned route**

When the tagged-request fixture runs, `onTagged` still calls `/code`, and the fake channel only recognizes that route, so the Kotlin test continues to demonstrate a path outside the stated `/api/v1/...` convention.

Change the fixture URL and its fake-channel matcher to a path such as `/api/v1/code`.

@HarlonWang
HarlonWang merged commit 1385c31 into main Oct 28, 2026
5 checks passed
@HarlonWang
HarlonWang deleted the chore/neutral-examples branch October 28, 2026 10:50
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.

1 participant