feat(QTDI-2979): Add labelDisplayMode attribute to @Suggestable#1238
feat(QTDI-2979): Add labelDisplayMode attribute to @Suggestable#1238thboileau wants to merge 2 commits into
Conversation
Add a LabelDisplayMode enum (LABEL, LABEL_ID) and a labelDisplayMode() annotation attribute to @suggestable. The attribute defaults to LABEL, preserving full backward compatibility. When two or more suggestions share the same label, setting labelDisplayMode = LABEL_ID allows the front-end to show both the label and the opaque identifier so the user can make an unambiguous choice (e.g. 'Paris (fr-paris-01)'). The value is serialised as tcomp::action::suggestions::labelDisplayMode in the component metadata map by the existing ActionParameterEnricher, with no changes to component-server-model required. Also includes Spotless reformatting of several pre-existing violations caught during mvn spotless:apply, and a .gitignore update for ai-commons tooling files. Co-Authored-By: GitHub Copilot <ai@noreply>
🔍 Scope & Design Review — QTDI-2979Round 1 — Final verdict: APPROVED AC Coverage
Edge cases — all clear
Findings
Review performed by AI (GitHub Copilot). Scope and design decisions validated by Dev before implementation. |
✅ Compliance Check — QTDI-2979Summary
File-by-file findings
Quality rules
Verdict: COMPLIANT — no Critical findings. Compliance check performed by AI (GitHub Copilot). |
There was a problem hiding this comment.
Pull request overview
This PR extends the public @Suggestable API with a labelDisplayMode attribute so UIs can disambiguate suggestions whose labels are not unique, and updates runtime metadata serialization expectations accordingly.
Changes:
- Add
Suggestable.LabelDisplayModeenum andlabelDisplayMode()attribute (defaultLABEL) tocomponent-api. - Update
ActionParameterEnricherTestto assertlabelDisplayModeis present in serialized suggestion metadata (including a newLABEL_IDcase). - Apply minor formatting-only refactors across several modules and extend
.gitignorefor AI-related local artifacts.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| singer-parent/component-kitap/src/main/java/org/talend/sdk/component/singer/kitap/RecordJsonMapper.java | Formatting-only line wrapping in service initialization. |
| documentation/src/main/java/org/talend/runtime/documentation/Generator.java | Formatting-only line wrapping in exclusion list generation. |
| component-tools/src/test/java/org/talend/sdk/component/tools/ComponentValidatorTest.java | Formatting-only line wrapping in test utility. |
| component-runtime-testing/component-runtime-junit/src/main/java/org/talend/sdk/component/junit5/ComponentExtension.java | Formatting-only line wrapping in extension shutdown. |
| component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/service/RecordServiceImplTest.java | Formatting-only plus indentation adjustments in proxy/test setup. |
| component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/ReflectionServiceTest.java | Formatting-only line wrapping for readability. |
| component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/reflect/parameterenricher/ActionParameterEnricherTest.java | Updates expectations to include labelDisplayMode metadata and adds a LABEL_ID test. |
| component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/ConfigurationMigrationTest.java | Formatting-only line wrapping in test setup. |
| component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/ComponentManagerTest.java | Formatting-only line wrapping in environment configuration test. |
| component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/service/InjectorImpl.java | Formatting-only line wrapping for generic type extraction. |
| component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/reflect/ReflectionService.java | Formatting-only line wrapping in list/array construction path. |
| component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/reflect/ParameterModelService.java | Formatting-only indentation adjustments in annotation/parameter meta building. |
| component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/ComponentManager.java | Formatting-only line wrapping for parameter enricher context creation. |
| component-runtime-impl/src/test/java/org/talend/sdk/component/runtime/record/PluralRecordExtension.java | Formatting-only array initializer spacing. |
| component-runtime-impl/src/main/java/org/talend/sdk/component/runtime/reflect/Defaults.java | Formatting-only line wrapping in method-handle invocation handler setup. |
| component-api/src/main/java/org/talend/sdk/component/api/configuration/action/Suggestable.java | Adds labelDisplayMode() attribute + LabelDisplayMode enum to the public API. |
| .gitignore | Ignore local AI-tooling directories/files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @Test | ||
| void suggestion() { | ||
| assertEquals(new HashMap<String, String>() { | ||
|
|
||
| { |
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
Requirements
Why this PR is needed?
Jira: QTDI-2979 — Allow to configure how the labels are displayed for a suggestable field
When two or more
@Suggestableoptions share the same label, the Studio user cannot distinguish between them. Selecting the wrong option leads to misconfigured jobs that may only fail at runtime, which is costly to debug.This PR provides a TCK-level mechanism that allows component developers to declare that their suggestable field may have non-unique labels, so that the front-end can surface enough information for an unambiguous choice.
What does this PR adds (design/code thoughts)?
component-api—Suggestable.javaLabelDisplayModewith two constants:LABEL(default) — show option label only; no change for existing usages.LABEL_ID— show both label and identifier (e.g.Paris (fr-paris-01)); use when labels may not be unique.labelDisplayMode()defaulting toLabelDisplayMode.LABEL.Serialisation (no change to
ActionParameterEnricher)The existing
ActionParameterEnricheralready serialises all annotation methods generically. The new attribute appears automatically in the component metadata map as:No changes to
component-server-modelare required —SimplePropertyDefinition.metadatais already aMap<String, String>.Tests —
ActionParameterEnricherTest.javasuggestion()test: asserts that the default value produceslabelDisplayMode = "LABEL"in the serialised metadata.suggestionWithLabelId()test: asserts that settinglabelDisplayMode = LABEL_IDproduceslabelDisplayMode = "LABEL_ID".Backward compatibility
The attribute defaults to
LABEL. All existing@Suggestableusages gainlabelDisplayMode = LABELin their metadata map — additive, transparent to consumers that do not know the key.Out of scope
BuiltInSuggestable— not affectedAI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code