docs(gantt): make QuickFilterBar JSDoc English and point at the bundle keys (#4021) - #4883
Merged
Merged
Conversation
…e keys (#4021) Commandment #-1 covers code comments, not just user-facing text. Three lines in `QuickFilterBar.tsx` carried Chinese copy: the module header's parenthetical and the `all` / `clear` members of `QuickFilterLabels`. The Chinese in those two member docs was also stale. It quoted the literals the host used to hardcode; objectstack#5427 moved all four strings into the `gantt.quickFilter.*` bundle namespace, so the quoted copy no longer matched any call site. Each member now names the bundle key `ObjectGantt` resolves it from, and the interface gains a short header stating the fallback behaviour. Comment-only: no code, type, or string changed. Co-authored-by: Claude <noreply@anthropic.com>
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Collaborator
Author
|
【PM 验收 · ACCEPT】objectui 分片 PM(session_01GTRjn8xBqp75dk7kFupVRt)对 #4021(XS,Commandment #-1 注释英文化)的实施验收: 实物核验:2 文件,QuickFilterBar.tsx 的 22 行改动非注释行为 0(PM 逐行核),空 frontmatter changeset(门认可形态);测试夹具中文按卡内裁定未动。模型标识 0、releases 0。判据:zh 字符 grep 该文件归零(before 3 行 after 0);四个词条键实存核验带 file:line(en 词条 :871、插件回退表、宿主调用点)+ locale-parity 钉子绿;行为测试 10/10 不变。反向验证如实记「无门可红」且给出成因证据(grep eslint/scripts 零门强制该条款)—— 不假称有门,判据换正向核验,合规。CI 亲读:19 项全 completed(17 success + 2 skipped),零失败。 新 finding #4884(plugin-gantt 其余六文件 163 行中文注释 + 「仓内无门强制该条款」成因)查重合格,留分诊 —— 它同时是「要不要建门」的机制化候选,分诊轮一并定。 处置:undraft + auto-merge(SQUASH)。 Generated by Claude Code |
yinlianghui
marked this pull request as ready for review
August 16, 2026 23:53
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 17, 2026
…bjectstack-ai#4884) (objectstack-ai#4888) * docs(gantt): make the remaining plugin-gantt source comments English (objectstack-ai#4884) Commandment #-1 covers code comments, not just user-facing text. The sequel to objectstack-ai#4021 / PR objectstack-ai#4883, which cleared the same package's `QuickFilterBar.tsx`: the six remaining non-test source files carried 163 lines of Chinese in JSDoc, trailing `//` notes and JSX comment blocks. All 163 are now English. Where a comment named a UI label it now points at the `gantt.*` bundle key that actually resolves it, rather than quoting a Chinese literal no call site holds: `gantt.toolbar.saveLayout`, `gantt.toolbar.refresh`, `gantt.menu.removeDependency`, `gantt.menu.addPredecessor` / `addSuccessor`, `gantt.menu.view`, `gantt.column.start` / `end`, `gantt.conflict.confirm` / `cancel`, `gantt.autoScheduleDlg.none`. Same class of staleness PR objectstack-ai#4883 fixed for the quick-filter labels. Two facts corrected to match the code as it stands: - The drag-conflict dialog's comment block sat above the auto-schedule dialog (`pendingAutoSchedule`); the dialog it describes is ~60 lines further down at `pendingConflict`. Moved back over its own JSX. - `ObjectGantt.tsx`'s `timeSegments` JSDoc example used Chinese band labels. The example now uses English labels, matching `ShiftBandConfig.label`'s own doc in `shifts.ts`; the doc states explicitly that `label` is caller-localized display text, which is what the example is illustrating. Also removed one CJK bracket pair that `\p{Han}` does not match, so the package's non-test sources are clean under both a Han scan and a CJK-punctuation scan. Comment-only: every one of the six files is byte-identical after stripping comments with the TypeScript compiler, so no code, type, or string changed. Co-authored-by: Claude <noreply@anthropic.com> * docs(gantt): tighten comment rewrap in GanttView/ObjectGantt (objectstack-ai#4884) Follow-up polish on the same comment-only change, no new translation: - `rescheduleOnConflict` JSDoc lost its sentence-ending period when the Chinese parenthetical was dropped, running two sentences together. - Three comment blocks (the resize grab-zone note, `borderColorField`, `summaryExtent`, and the hidden-native-scrollbar CSS note) had ragged wraps left over from substituting longer English text; reflowed. Still byte-identical after comment stripping on all six files. Co-authored-by: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
Fixes #4021
改了什么
packages/plugin-gantt/src/QuickFilterBar.tsx三处中文注释改成纯英文 —— 诫条 #-1 的措辞覆盖 code comments,不止用户可见文案。QuickFilterLabels的all(第 41 行)与clear(第 43 行)成员注释。顺带把该 interface 四个成员的注释都指向宿主词条键(卡内建议形态),并给 interface 本身加了一句说明回退行为。
为什么不只是换语言
那两条成员注释里的中文同时也是过期信息:它们引的是宿主曾经硬编码的字面量,而 objectstack#5427 已把四条文案挪进
gantt.quickFilter.*词条,注释里的引文不再对应任何调用点。所以不是原样翻译,而是改写成"这个 label 由宿主从哪个键取值":all--gantt.quickFilter.allclear--gantt.quickFilter.clearempty--gantt.quickFilter.emptyresultSummary--gantt.quickFilter.resultSummary(并注明它是单花括号占位符、由调用点.replace解析,不是 i18next 插值 —— 这条约定在useGanttTranslation.ts与gantt-quickfilter-locale-parity.test.ts里都被钉住,objectui#4157 是把它写反的前情)四个键均先核实存在再落笔:
packages/i18n/src/locales/en.ts:871的quickFilter块、packages/plugin-gantt/src/useGanttTranslation.ts:90-102的独立回退表、调用点packages/plugin-gantt/src/ObjectGantt.tsx:1417-1423。interface 头新增的那句(
all/clear/empty回退英文默认值,resultSummary省略即隐藏 summary)也按实现核过:QuickFilterBar.tsx:288-290与:314。范围
QuickFilterBar.test.tsx:40一带的中文夹具 —— issue 正文已裁明那是被验证的测试数据,是否统一改写由维护者定,不属本单。验证
注释-only 改动没有任何门可以为它变红,如实记录:仓内没有任何 lint 规则或脚本机械强制诫条 #-1 的英文注释条款(
eslint.config.js与scripts/均无对应规则,这也正是这类残留能长期存在的原因)。因此判据是下面两条正向核验,而不是"改前红、改后绿":\p{Han},该文件):改前 3 行(10 / 41 / 43),改后No matches found。跑过的命令:
changeset
按
check-changeset-presence自身读数处理:packages/plugin-gantt/src/**在受守面内,故必须声明;而这是零行为变更,用该门明文承认的空 frontmatter 形态声明(.changeset/quickfilterbar-jsdoc-english.md),不发版本。相邻发现(不扩围)
plugin-gantt其余源码文件仍有同形中文注释 ——GanttView.tsx(93 行)、ObjectGantt.tsx(51)、shifts.ts(9)、scheduling.ts(8)、ResourceWorkload.tsx(1)、workload.ts(1)。已逐一确认全部位于注释内(JSDoc 括注、行尾注释、JSX 注释块),非测试源码里没有中文运行期字符串,故与本单同属 observation-class。按"别的文件不扩围"另开单记录,不在本 PR 处理。Generated by Claude Code