Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,68 @@
name: Bug report
description: 报告可复现的功能、布局或稳定性问题
description: Report a problem that you can reproduce with a feature, a layout or stability
title: "[Bug] "
labels: [bug]
body:
- type: markdown
attributes:
value: |
请先确认问题能在最新构建复现。不要粘贴密码、剪贴板、录音或其他真实输入内容。
Make sure that the problem occurs in the latest build.
Do not paste passwords, clipboard content, recordings or other real typed text.
- type: input
id: version
attributes:
label: APK / commit
placeholder: openIME-1.0-debug.apk 或 commit SHA
label: APK version or commit
placeholder: "0.0.7-beta.1 or a commit SHA"
validations:
required: true
- type: input
id: device
attributes:
label: 设备与 Android 版本
placeholder: Xiaomi 24129PN74C / Android 16
label: Device and Android version
placeholder: "Xiaomi 15 / Android 16"
validations:
required: true
- type: dropdown
id: mode
attributes:
label: 输入模式
label: Input mode
options:
- 26 键拼音
- 9 键拼音
- 英文 / T9
- 数字 / 符号
- Emoji / 剪贴板
- 语音
- 设置 / 浮动键盘
- 其他
- 26-key pinyin
- Nine-key pinyin
- Stroke
- English 26-key
- Digits and symbols
- Emoji and clipboard
- Voice
- Settings and floating keyboard
- Other
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: 复现步骤
description: 请使用脱敏后的示例文字。
label: Steps to reproduce
description: Use sample text that has no personal data.
placeholder: |
1. 打开……
2. 切换到……
3. 点击……
1. Open ...
2. Switch to ...
3. Tap ...
validations:
required: true
- type: textarea
id: expected
attributes:
label: 预期行为
label: Expected behavior
validations:
required: true
- type: textarea
id: actual
attributes:
label: 实际行为
label: Actual behavior
validations:
required: true
- type: textarea
id: evidence
attributes:
label: 脱敏日志或截图
description: 请删除个人路径、输入内容、Token、密码和录音。
label: Logs or screenshots
description: Remove personal paths, typed text, tokens, passwords and recordings.
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Feature request
description: 提议新的输入、适配或维护能力
description: Suggest a new input, compatibility or maintenance feature
title: "[Feature] "
labels: [enhancement]
body:
- type: textarea
id: problem
attributes:
label: 要解决的问题
placeholder: 当前什么场景不方便,谁会遇到?
label: Problem
placeholder: Which situation is difficult today? Who does it affect?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: 建议方案
placeholder: 期望的交互、候选、布局或配置行为。
label: Proposed solution
placeholder: Describe the interaction, candidates, layout or setting that you want.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: 备选方案
label: Alternatives
- type: input
id: device
attributes:
label: 相关设备或窗口尺寸
placeholder: 例如 390dp、平板、折叠屏、横屏
label: Related device or window size
placeholder: "For example 390 dp, tablet, foldable, landscape"
42 changes: 21 additions & 21 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
## 改动说明
## Summary

<!-- 用几句话说明为什么改、改了什么。 -->
<!-- Explain why you make this change and what it changes. Use a few sentences. -->

## 影响范围
## Affected areas

- [ ] 输入引擎 / 候选 / 分词
- [ ] InputConnection / 编辑器行为
- [ ] 键盘布局 / Insets / 浮动键盘
- [ ] 工具面板 / 设置
- [ ] 语音模型 / 音频权限
- [ ] 构建、测试或文档
- [ ] Input engine, candidates, word splitting
- [ ] InputConnection, editor behavior
- [ ] Keyboard layout, insets, floating keyboard
- [ ] Tool panels, settings
- [ ] Voice model, audio permission
- [ ] Build, tests or documents

## 验证
## Verification

- [ ] `:app:testDebugUnitTest`
- [ ] `:app:lintDebug`
- [ ] `:app:assembleDebug`
- [ ] 真实 IME 回归(如适用)
- [ ] 已执行 `git diff --check`
- [ ] Real input method regression (if it applies)
- [ ] `git diff --check`

测试设备、Android 版本和命令:
Test device, Android version and commands:

## 变更记录与版本
## Change log and version

- [ ] 用户可见的改动(功能、行为、修复、权限、数据格式)已写入 `CHANGELOG.md` 的 `[Unreleased]`;纯内部改动不需要
- [ ] 没有修改 `VERSION`(只有发布 PR 才升级版本,见 `docs/RELEASE.md`)
- [ ] PR 标题能独立说清结果:合并时它就是提交标题,描述就是提交正文
- [ ] I added each user-visible change to `[Unreleased]` in `CHANGELOG.md`. Internal changes do not need an entry.
- [ ] I did not change `VERSION`. Only a release PR changes it. See `docs/RELEASE.md`.
- [ ] The PR title states the result. It becomes the commit title, and the description becomes the commit body.

## 隐私与交付检查
## Privacy and delivery

- [ ] 没有提交密码、剪贴板、录音、设备日志或个人路径
- [ ] 模型、词典或第三方文件的来源和许可证没有被破坏
- [ ] 若改动用户数据或设置格式,已说明升级兼容性
- [ ] The change has no passwords, clipboard content, recordings, device logs or personal paths.
- [ ] The change keeps the source and license of each model, dictionary and third-party file.
- [ ] If the change affects user data or settings formats, the description explains upgrade compatibility.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循
[语义化版本](https://semver.org/lang/zh-CN/)。每个 `## [版本] - 日期` 小节就是该版本
GitHub Release 的发布说明;版本与发布流程见 [docs/RELEASE.md](docs/RELEASE.md)。
首个公开版本之前的开发期记录见 [docs/CHANGELOG_PRE_1.0.md](docs/CHANGELOG_PRE_1.0.md)。

## [Unreleased]

Expand Down
97 changes: 59 additions & 38 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,82 @@
# 贡献指南
# Contributing

## 开始之前
Thank you for your interest in openIME.
This guide tells you how to prepare, change and submit code.

1. 安装 JDK 17、Android SDK 36、NDK `27.0.12077973`、CMake `3.22.1` 和 Git LFS。
2. 执行 `git lfs pull`,确认语音模型和 AAR 不是文本指针。
3. 先阅读 [README.md](README.md)、[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
和 [docs/TEST_ARCHITECTURE.md](docs/TEST_ARCHITECTURE.md)。
4. 修改 App 界面时按 [App 界面开发规范](docs/APP_UI_SPEC.md) 实现尺寸、间距、对齐、点击区及大字体适配;先复用现有令牌和资源,不自行引入一套数值。
## Prepare

## 分支与提交
1. Install JDK 17, Android SDK 36, NDK `27.0.12077973`, CMake `3.22.1` and Git LFS.
2. Run `git lfs pull`. Make sure the voice models and the AAR are not text pointers.
3. Read the [README](README.md), the [architecture](docs/ARCHITECTURE.md) and the [test architecture](docs/TEST_ARCHITECTURE.md).
4. For app screens, follow the [app UI specification](docs/APP_UI_SPEC.md).
Use the existing tokens and resources. Do not add new sizes or colors.

- 从最新的 `main` 创建短生命周期分支,命名为 `类型/主题`,类型取 `feat`、`fix`、`docs`、
`chore`、`ci`、`refactor`、`test`,例如 `fix/pinyin-candidate`、`docs/repository`。
- 分支里的提交保持“一个提交一个主题”,说明用简短的一句话写结果(中文或英文均可),例如
`修复九键拼音候选提交`、`fix: keep the rest of the input composing`。合并时会被 squash,
最终进入 `main` 的提交信息是 PR 标题和描述。
- 不要提交 `local.properties`、Gradle/build 输出、根目录截图、UI dump、设备日志、
密码、录音、签名密钥或未经确认的模型文件。
## Branches and commits

## 变更记录与版本
- Create a short-lived branch from the latest `main`.
Name it `type/topic`. The types are `feat`, `fix`, `docs`, `chore`, `ci`, `refactor` and `test`.
Example: `fix/pinyin-candidate`.
- Keep one topic in each commit.
Write the message as one short sentence that states the result.
Example: `fix: keep the rest of the input composing`.
- We squash every PR. The PR title and description become the commit on `main`.
- Do not commit these items:
`local.properties`, build output, screenshots outside `docs/images/`, UI dumps, device logs,
passwords, recordings, signing keys and unverified model files.

- 用户可见的改动(功能、行为、修复、权限、数据格式)在同一个 PR 里写进 `CHANGELOG.md` 的
`## [Unreleased]`;纯内部改动不需要。
- 不要在功能 PR 里修改 `VERSION`:版本只在发布 PR 里升级。版本规则、签名和发布步骤见
[docs/RELEASE.md](docs/RELEASE.md),分支与合并规则见 [docs/REPOSITORY.md](docs/REPOSITORY.md)。
## Change log and version

## 提交前检查
- Add each user-visible change to `## [Unreleased]` in `CHANGELOG.md`, in the same PR.
User-visible changes are features, behavior, fixes, permissions and data formats.
Internal changes do not need an entry.
- Do not change `VERSION` in a feature PR. Only a release PR changes it.
See the [release process](docs/RELEASE.md).

```powershell
.\gradlew.bat :app:testDebugUnitTest :app:lintDebug :app:assembleDebug --no-daemon --console=plain
git diff --check
git status --short
```
## Check your change

Linux / macOS / Git Bash 上再运行版本与变更记录检查(CI 也会运行):
Run these commands before you open a PR:

```bash
./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug --no-daemon --console=plain
python3 -m unittest discover -s scripts -p 'test_*.py'
python3 scripts/release_check.py check
git diff --check
```

如果改动了真实输入链路,使用明确的设备 Serial 运行至少一组核心回归:
The CI runs the same checks.

If you change the input path, run one core regression on a named device or emulator:

```powershell
.\scripts\core_regression.ps1 -Serial <serial>
```

如果改动了布局或 Insets,再运行 `visual_check.ps1`,并在 PR 中说明测试设备的
Android 版本、窗口宽度和是否使用浮动键盘。
App 界面同时按 `docs/APP_UI_SPEC.md` 检查普通屏、320dp 大字体和宽屏;运行
`scripts/beta4_e2e.py` 并保存截图、UI XML、结果 JSON 和日志作为可重复的验收工件。
If you change layout or insets, also run `scripts/visual_check.ps1`.
In the PR, state the Android version, the window width and whether you used the floating keyboard.

If you change an app screen, run `scripts/beta4_e2e.py`.
Check normal, 320 dp wide with large fonts, and wide screens.
Keep the screenshots, UI XML, result JSON and logs.

## Pull requests

Describe these items in the PR:

- the purpose of the change
- the parts of the product that it affects
- the test commands and their results
- known limitations
- any change to dictionaries, models, permissions or data formats

Remove personal data from screenshots.
Do not upload real typed text, passwords, clipboard content or recordings.

## Pull Request
`main` is protected.
A PR needs a passing **Build and verify** check before it can merge.
The compatibility tests on API 26, 29, 31 and 34 also run on each PR.
Fix a failing compatibility test before you merge.

PR 描述应包含:改动目的、影响范围、测试命令和结果、已知限制,以及是否修改了
词典、模型、权限或数据格式。涉及截图时请脱敏;不要在 PR 中上传真实输入内容、
密码、剪贴板或录音。
## Conduct

`main` 受保护:只能通过 PR 合并,且 **Build and verify** 必须通过;PR 一律 squash 合并,
合并后分支自动删除。API 26 / 29 / 31 / 34 兼容测试同样会在 PR 上运行,红了请先修再合并。
Be respectful and keep discussions about the work.
Report security problems in private. See [SECURITY.md](SECURITY.md).
Loading
Loading