feat(QTDI-2979): Add labelDisplayMode attribute to @Suggestable#1238
Open
thboileau wants to merge 1 commit into
Open
feat(QTDI-2979): Add labelDisplayMode attribute to @Suggestable#1238thboileau wants to merge 1 commit into
thboileau wants to merge 1 commit 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>
Contributor
Author
🔍 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. |
Contributor
Author
✅ Compliance Check — QTDI-2979Summary
File-by-file findings
Quality rules
Verdict: COMPLIANT — no Critical findings. Compliance check performed by AI (GitHub Copilot). |
|
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.

0 New Issues
1 Fixed Issue
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