Skip to content

refactor(web): rename FieldBase to ChoyFieldBase - #505

Merged
buke merged 2 commits into
feat/choy-ui-kitfrom
feat/choy-ui-fields
Oct 20, 2026
Merged

buke merged 2 commits into
feat/choy-ui-kitfrom
feat/choy-ui-fields

Conversation

@buke

@buke buke commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

User description

Summary

  • Rename FieldBase → ChoyFieldBase (file, component name, imports, test stubs) so the product field shell matches the Choy*Field family and is distinct from vendor/ui Field*.
  • Export ChoyFieldBase plus FieldStateExpr / FormItemProps from kit.ts as the extension surface for custom field widgets.
  • Keep choy-field-base CSS classes and data-anchor="choy.field-base" unchanged.

Test plan

  • ./choysum test unit web --fe
  • Spot-check a form/list field renders after pull (label/help/edit slots still work)

Summary by Sourcery

Rename the web field shell to ChoyFieldBase and expose its extension types while preserving existing field styling and anchors.

New Features:

  • Expose ChoyFieldBase and its FieldStateExpr and FormItemProps types from the web kit for custom field extensions.

Enhancements:

  • Rename the web field base component to ChoyFieldBase and update all field integrations, translation scope, and references to align with the Choy field naming convention.

Tests:

  • Update field component, mount, and integration tests to use and validate the ChoyFieldBase identity.

PR Type

Enhancement, Tests


Description

  • Rename FieldBase to ChoyFieldBase across web field components

  • Export ChoyFieldBase, FieldStateExpr, FormItemProps from kit.ts

  • Update component name, translate scope, and all field imports

  • Update unit tests and stubs to the new component identity


File Walkthrough

Relevant files
Enhancement
18 files
ChoyFieldBase.vue
Rename component name and translate scope                               
+2/-2     
kit.ts
Export ChoyFieldBase and field types                                         
+5/-0     
ChoyBigintField.vue
Switch template and import to ChoyFieldBase                           
+4/-4     
ChoyBinaryField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyBooleanField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyDateField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyDatetimeField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyDecimalField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyHtmlField.vue
Switch template and import to ChoyFieldBase                           
+4/-4     
ChoyImageField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyIntField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyJsonField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyManyToManyField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyManyToOneField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyOneToManyField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoySelectionField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyStatusbarField.vue
Switch template and import to ChoyFieldBase                           
+3/-3     
ChoyVarcharField.vue
Switch template and import to ChoyFieldBase                           
+4/-4     
Tests
2 files
ChoyFieldBase.test.ts
Update base tests to ChoyFieldBase identity                           
+17/-17 
ChoyStoreModeFields.mount.test.ts
Update store-mode mount tests to ChoyFieldBase                     
+14/-14 
Additional files
34 files
ChoyBinaryField.test.ts +13/-13 
ChoyDecimalField.test.ts +5/-5     
ChoyImageField.test.ts +13/-13 
ChoyJsonField.test.ts +7/-7     
ChoyManyToManyField.mount.test.ts +6/-6     
ChoyManyToManyRefTagsField.mount.test.ts +4/-4     
ChoyManyToManyRefTagsField.vue +3/-3     
ChoyManyToManyRefTreeField.mount.test.ts +4/-4     
ChoyManyToManyRefTreeField.vue +3/-3     
ChoyManyToOneField.mount.test.ts +4/-4     
ChoyManyToOneRefField.vue +3/-3     
ChoyMonetaryField.test.ts +5/-5     
ChoyMonetaryField.vue +3/-3     
ChoyNativeScalarFields.mount.test.ts +11/-11 
ChoyNumberField.vue +3/-3     
ChoyOneToManyField.handle.test.ts +11/-11 
ChoyOneToManyKanbanField.vue +3/-3     
ChoyPropertiesField.test.ts +4/-4     
ChoyPropertiesField.vue +3/-3     
ChoySelectionField.test.ts +4/-4     
ChoyStatusbarField.test.ts +7/-7     
ChoyTemporalFields.mount.test.ts +8/-8     
ChoyTextField.vue +3/-3     
ChoyTimeField.vue +3/-3     
relationTypeahead.NameSearch.test.ts +4/-4     
RelationTree.vue +1/-1     
ChoyFormView.vue +1/-1     
SearchFilterGroup.selection.test.ts +2/-2     
viewKinds.ts +2/-2     
fieldClientValidation.ts +1/-1     
useListInlineEdit.ts +1/-1     
fieldsGet.ts +1/-1     
localFormStore.test.ts +1/-1     
localFormStore.ts +1/-1     

Align the field shell with the Choy*Field naming so third-party modules
can treat ChoyFieldBase as the stable kit extension point. Export the
component and FormItemProps/FieldStateExpr from kit.ts; keep
choy-field-base CSS/anchor tokens unchanged.
@sourcery-ai

sourcery-ai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Sorry @buke, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 1 hour by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: choysum-dev/choysum/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: e51e9466-ca82-46ce-977b-0e7e49e60eb3
📥 Commits

Reviewing files that changed from the base of the PR and between 1899d96 and 20f2aea.

📒 Files selected for processing: 56
  • modules/web/i18n/web.pot
  • modules/web/i18n/zh_CN.po
  • modules/web/web/components/field/ChoyBigintField.vue
  • modules/web/web/components/field/ChoyBinaryField.test.ts
  • modules/web/web/components/field/ChoyBinaryField.vue
  • modules/web/web/components/field/ChoyBooleanField.vue
  • modules/web/web/components/field/ChoyDateField.vue
  • modules/web/web/components/field/ChoyDatetimeField.vue
  • modules/web/web/components/field/ChoyDecimalField.test.ts
  • modules/web/web/components/field/ChoyDecimalField.vue
  • modules/web/web/components/field/ChoyFieldBase.test.ts
  • modules/web/web/components/field/ChoyFieldBase.vue
  • modules/web/web/components/field/ChoyHtmlField.vue
  • modules/web/web/components/field/ChoyImageField.test.ts
  • modules/web/web/components/field/ChoyImageField.vue
  • modules/web/web/components/field/ChoyIntField.vue
  • modules/web/web/components/field/ChoyJsonField.test.ts
  • modules/web/web/components/field/ChoyJsonField.vue
  • modules/web/web/components/field/ChoyManyToManyField.mount.test.ts
  • modules/web/web/components/field/ChoyManyToManyField.vue
  • modules/web/web/components/field/ChoyManyToManyRefTagsField.mount.test.ts
  • modules/web/web/components/field/ChoyManyToManyRefTagsField.vue
  • modules/web/web/components/field/ChoyManyToManyRefTreeField.mount.test.ts
  • modules/web/web/components/field/ChoyManyToManyRefTreeField.vue
  • modules/web/web/components/field/ChoyManyToOneField.mount.test.ts
  • modules/web/web/components/field/ChoyManyToOneField.vue
  • modules/web/web/components/field/ChoyManyToOneRefField.vue
  • modules/web/web/components/field/ChoyMonetaryField.test.ts
  • modules/web/web/components/field/ChoyMonetaryField.vue
  • modules/web/web/components/field/ChoyNativeScalarFields.mount.test.ts
  • modules/web/web/components/field/ChoyNumberField.vue
  • modules/web/web/components/field/ChoyOneToManyField.handle.test.ts
  • modules/web/web/components/field/ChoyOneToManyField.vue
  • modules/web/web/components/field/ChoyOneToManyKanbanField.vue
  • modules/web/web/components/field/ChoyPropertiesField.test.ts
  • modules/web/web/components/field/ChoyPropertiesField.vue
  • modules/web/web/components/field/ChoySelectionField.test.ts
  • modules/web/web/components/field/ChoySelectionField.vue
  • modules/web/web/components/field/ChoyStatusbarField.test.ts
  • modules/web/web/components/field/ChoyStatusbarField.vue
  • modules/web/web/components/field/ChoyStoreModeFields.mount.test.ts
  • modules/web/web/components/field/ChoyTemporalFields.mount.test.ts
  • modules/web/web/components/field/ChoyTextField.vue
  • modules/web/web/components/field/ChoyTimeField.vue
  • modules/web/web/components/field/ChoyVarcharField.vue
  • modules/web/web/components/field/relationTypeahead.NameSearch.test.ts
  • modules/web/web/components/internal/RelationTree.vue
  • modules/web/web/components/view/ChoyFormView.vue
  • modules/web/web/components/view/search/SearchFilterGroup.selection.test.ts
  • modules/web/web/components/view/viewKinds.ts
  • modules/web/web/composables/fieldClientValidation.ts
  • modules/web/web/composables/useListInlineEdit.ts
  • modules/web/web/kit.ts
  • modules/web/web/stores/fieldsGet.ts
  • modules/web/web/stores/localFormStore.test.ts
  • modules/web/web/stores/localFormStore.ts
+--------------------------------------------+
| Your exception handling needs a therapist. |
+--------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

This refactor renames the product field shell from FieldBase to ChoyFieldBase throughout implementations, tests, and documentation references, while preserving runtime CSS and anchor contracts and adding the component plus FieldStateExpr/FormItemProps as the public extension surface in kit.ts.

File-Level Changes

Change Details Files
Rename the shared product field shell and update every field component, test stub, and supporting reference to use the new identity.
  • Renames the component file and Vue component name from FieldBase to ChoyFieldBase.
  • Updates scalar, temporal, content, attachment, selection, and relationship fields to import and render ChoyFieldBase.
  • Updates mount tests, SFC stubs, test descriptions, and comments to target the renamed component.
  • Preserves the existing choy-field-base CSS classes and data-anchor="choy.field-base" contract.
modules/web/web/components/field/ChoyFieldBase.vue
modules/web/web/components/field/*.vue
modules/web/web/components/field/*.test.ts
modules/web/web/components/internal/RelationTree.vue
modules/web/web/components/view/ChoyFormView.vue
modules/web/web/components/view/search/SearchFilterGroup.selection.test.ts
modules/web/web/components/view/viewKinds.ts
modules/web/web/composables/fieldClientValidation.ts
modules/web/web/composables/useListInlineEdit.ts
modules/web/web/stores/fieldsGet.ts
modules/web/web/stores/localFormStore.ts
modules/web/web/stores/localFormStore.test.ts
Expose the renamed field shell and its extension types through the web kit.
  • Exports ChoyFieldBase as a component from kit.ts.
  • Exports FieldStateExpr and FormItemProps as public types for custom field widgets.
modules/web/web/kit.ts
Align the base component’s translation scope and regression assertions with its new public name.
  • Changes the component options name and translation scope to ChoyFieldBase.
  • Renames base-component test coverage and asserts the new component name.
modules/web/web/components/field/ChoyFieldBase.vue
modules/web/web/components/field/ChoyFieldBase.test.ts

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

Comment on lines +395 to +397
defineOptions({ name: 'ChoyFieldBase' });

const { _t } = createTranslate('web', { scope: 'web/components/field/FieldBase' });
const { _t } = createTranslate('web', { scope: 'web/components/field/ChoyFieldBase' });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing file rename

The diff only changes defineOptions({ name: 'ChoyFieldBase' }) and the translate scope inside ChoyFieldBase.vue, but every import in the PR points to ./ChoyFieldBase.vue. If the file was not actually renamed from FieldBase.vue (no rename hunk is shown), all field components and tests will fail to resolve the module. Confirm the file rename is part of the commit; otherwise imports break at build/typecheck time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

评估:不合理(误报)。

commit 928b1e85 里已有 rename hunk:
FieldBase.vue → ChoyFieldBase.vue(git show --summary 可见 rename ... (99%))。GitHub Files 视图有时会把 rename 压成「新文件 + 小 diff」,看起来像没改名,但模块路径是对的;本 PR CI typecheck/unit 也已通过。

Comment on lines 185 to 187
test('component options name is ChoyFieldBase (not legacy OFieldBase)', () => {
expect((ChoyFieldBase as any).name || (ChoyFieldBase as any).__name).toBe('ChoyFieldBase');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale test name

The new test asserts the component name is ChoyFieldBase but the test title still says "not legacy OFieldBase". This is a leftover from the old naming and is misleading; it should reference the legacy FieldBase name instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

评估:合理,已修。

测试标题已改为 not legacy FieldBase(20f2aea8)。

defineOptions({ name: 'ChoyFieldBase' });

const { _t } = createTranslate('web', { scope: 'web/components/field/FieldBase' });
const { _t } = createTranslate('web', { scope: 'web/components/field/ChoyFieldBase' });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Translate scope change

The translate scope changed from web/components/field/FieldBase to web/components/field/ChoyFieldBase. If translation catalogs are keyed by scope path, existing translations for this component will no longer resolve and labels/help text will fall back to raw keys. Verify the i18n catalog was updated or that scope is not used as a lookup key.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

评估:合理,已修。

catalog 确实按 msgctxt/scope 查找。已同步更新 modules/web/i18n/zh_CN.po 与 web.pot:FieldBase → ChoyFieldBase(20f2aea8),与 createTranslate(..., { scope: 'web/components/field/ChoyFieldBase' }) 对齐。未保留旧 scope(硬切,与本 PR 命名策略一致)。

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
⚡ Recommended focus areas for review

Breaking public API

kit.ts now exports ChoyFieldBase but the previous FieldBase export (if it existed) is removed without a deprecated alias. Any external module or custom widget importing FieldBase from the kit will break at compile time. Consider keeping a FieldBase alias re-export for one release cycle, or confirm no public export existed before.

export { default as ChoyFieldBase } from './components/field/ChoyFieldBase.vue';
export type {
  FieldStateExpr,
  FormItemProps,
} from './components/field/ChoyFieldBase.vue';

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible bug
Preserve i18n scope key on rename

The i18n scope was renamed along with the component, but translation catalogs are
keyed by scope path. If the catalog still registers web/components/field/FieldBase,
every _t(...) lookup in this component silently falls back to the raw key. Either
keep the old scope string or update the catalog in the same PR.

modules/web/web/components/field/ChoyFieldBase.vue [397]

-const { _t } = createTranslate('web', { scope: 'web/components/field/ChoyFieldBase' });
+const { _t } = createTranslate('web', { scope: 'web/components/field/FieldBase' });
Suggestion importance[1-10]: 6

__

Why: The PR renames the createTranslate scope from web/components/field/FieldBase to web/components/field/ChoyFieldBase. If translation catalogs are keyed by the old scope path, _t(...) lookups could silently fall back to raw keys. This is a plausible regression worth verifying, though it depends on catalog state not visible in the diff.

Low
Possible issue
Keep deprecated alias for renamed export

This is a breaking rename of a public kit export: downstream modules importing
FieldBase from @/web/web/kit will fail to compile. Keep a deprecated alias export
for one release so external modules migrate without a hard cut.

modules/web/web/kit.ts [197-201]

 export { default as ChoyFieldBase } from './components/field/ChoyFieldBase.vue';
 export type {
   FieldStateExpr,
   FormItemProps,
 } from './components/field/ChoyFieldBase.vue';
+/** @deprecated use ChoyFieldBase */
+export { default as FieldBase } from './components/field/ChoyFieldBase.vue';
Suggestion importance[1-10]: 5

__

Why: The PR replaces the public FieldBase kit export with ChoyFieldBase, which is a breaking change for downstream importers. A deprecated alias is a reasonable backward-compat measure, but this is a design/API decision rather than a clear bug, and the diff doesn't show whether FieldBase was ever exported from kit.ts.

Low
Verify no string-based component lookups remain

Renaming the component name breaks any or
component :is="'FieldBase'" string-based lookups elsewhere. Grep for string
references to 'FieldBase' (not just imports) and update them in this PR.

modules/web/web/components/field/ChoyFieldBase.vue [395]

+defineOptions({ name: 'ChoyFieldBase' });
 
-
Suggestion importance[1-10]: 4

__

Why: Renaming the component name could break string-based <keep-alive include> or component :is lookups. This is a valid verification concern, but the improved_code is identical to existing_code and it only asks the user to grep, so impact is limited.

Low
Test gap
Assert legacy component name is gone

The rename changes the component's name, which is used for <keep-alive
include>/exclude matching and devtools. Add a regression test asserting the old
FieldBase name is no longer emitted (or that any alias still resolves), so a future
partial rename is caught.

modules/web/web/components/field/ChoyFieldBase.test.ts [185-187]

   test('component options name is ChoyFieldBase (not legacy OFieldBase)', () => {
     expect((ChoyFieldBase as any).name || (ChoyFieldBase as any).__name).toBe('ChoyFieldBase');
+    expect((ChoyFieldBase as any).name || (ChoyFieldBase as any).__name).not.toBe('FieldBase');
   });
Suggestion importance[1-10]: 3

__

Why: The existing test already asserts the name is ChoyFieldBase, which implicitly covers the rename. Adding a .not.toBe('FieldBase') assertion is redundant and offers marginal value.

Low

@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Update zh_CN.po/web.pot msgctxt and source refs so translate lookups
match createTranslate scope, and clarify the component-name test title.
@buke

buke commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Review follow-up

Finding Verdict
Missing file rename 误报 — commit 含 rename hunk
Stale test title (OFieldBase) 已修
Translate scope / i18n catalog 已修(po/pot 同步)
Keep deprecated FieldBase kit alias 不采纳 — 此前 kit 未导出 FieldBase,本 PR 才首次公开为 ChoyFieldBase

关于 Actions 日志里的 element-plus 404

来自 prepare-embedded-assets → go generate ./internal/bootstrap/web/...,不是 modules/web 产品 UI。

  • internal/bootstrap/web(安装/引导页)仍依赖 [email protected](见 internal/bootstrap/web/package.json + src/main.ts 的 element-plus/es/components/*/style/css side-effect import)。
  • esm-type-fetch 会跟这些 specifier 去拉 .d.ts;style/css 是 CSS 子路径,esm.sh 没有对应 index.d.ts → http 404 warn。
  • AGENTS.md 已注明这类 type-fetch 404 可忽略;该 job 结论是 success,与 PR refactor(web): rename FieldBase to ChoyFieldBase #505 无关。
  • domain 模块里的 element-plus 已由 forbid-legacy-ui-imports 禁止;bootstrap 是另一条嵌入资源线。

若要消掉这些 warn,需要单独改 bootstrap(去掉 EP)或扩展 shouldSkipTypeFetchSubpathSpecifier 跳过 element-plus/.../style/css,不宜塞进本 rename PR。

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

Sourcery assessment

Approved.

@buke
buke merged commit de5bd15 into feat/choy-ui-kit Oct 20, 2026
36 of 38 checks passed
@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Maintainability
Keep deprecated alias for renamed export

This is a breaking rename for external consumers of the kit. If FieldBase was
previously exported here, keep a deprecated alias (export { default as FieldBase })
for one release cycle so downstream modules don't break on upgrade.

modules/web/web/kit.ts [197-201]

 export { default as ChoyFieldBase } from './components/field/ChoyFieldBase.vue';
+/** @deprecated use ChoyFieldBase */
+export { default as FieldBase } from './components/field/ChoyFieldBase.vue';
 export type {
   FieldStateExpr,
   FormItemProps,
 } from './components/field/ChoyFieldBase.vue';
Suggestion importance[1-10]: 4

__

Why: The suggestion is speculative: the diff does not show that FieldBase was previously exported from kit.ts, so the breaking-change claim is unverified. Adding a deprecated alias could be reasonable for backward compatibility, but it is a maintainability nicety rather than a correctness fix.

Low
Possible issue
Guard against stale name-based references

The rename changes the component's name, which is used by Vue devtools and by
keep-alive/ include/exclude matching. If any consumer still
references FieldBase by name (e.g. include="FieldBase"), it will silently stop
matching. Consider a grep for string references to 'FieldBase' and add a regression
test or note.

modules/web/web/components/field/ChoyFieldBase.test.ts [185-187]

   test('component options name is ChoyFieldBase (not legacy FieldBase)', () => {
     expect((ChoyFieldBase as any).name || (ChoyFieldBase as any).__name).toBe('ChoyFieldBase');
+    // Guard against stale string references to the old name in keep-alive/include lists.
+    expect((ChoyFieldBase as any).name).not.toBe('FieldBase');
   });
Suggestion importance[1-10]: 3

__

Why: The added assertion expect(name).not.toBe('FieldBase') is redundant since the preceding line already asserts the name equals 'ChoyFieldBase'. The suggestion is essentially a verification request with marginal value and does not add meaningful coverage.

Low
Verify name-based stub actually applies

This stub is registered by component name in a global-components map, so it only
works if the SUT resolves ChoyFieldBase by name. Verify the SUT actually renders
(not a locally imported FieldBase), otherwise this stub silently no-ops and the test
passes for the wrong reason.

modules/web/web/components/view/search/SearchFilterGroup.selection.test.ts [115-116]

         ChoyFieldBase: {
           name: 'ChoyFieldBase',
+          // Ensure the SUT resolves this stub; assert on a marker class in the test body.
Suggestion importance[1-10]: 3

__

Why: This is a verification request rather than a concrete fix, and the improved_code only adds a comment without changing behavior. It may be a valid concern but offers low actionable impact and cannot score highly per the guidelines.

Low

@buke
buke deleted the feat/choy-ui-fields branch October 20, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant