Repository navigation
fix(ui): distinguish composite unique constraints - #37750
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findingsComposite-constraint badges and tooltips alter UI interpretation; incorrect group labels could mislead users about which columns jointly define uniqueness. Distinguishes composite UNIQUE groups in the table UI with lettered blue badges and per-group tooltips, while individual uniqueness stays unlettered. Group letters are now resolved consistently even when only a subset of groups is passed in, addressing the letter mismatch finding. No open issues remain. ✅ 1 closed✅ Bug: Group letters follow the subset passed in, not the full table list
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
…37750) (#38178) * fix(ui): distinguish composite unique constraints (#37750) * fix(ui): distinguish composite unique constraints * fix(ui): identify composite unique groups with letters * fix(ui): style composite unique indicators as blue badges * fix(ui): keep composite labels consistent in table history (cherry picked from commit 2790240) * test(ui): adapt composite unique constraint tests to antd tooltips on 2.0 --------- Co-authored-by: IceS2 <[email protected]>
Describe your changes:
Composite UNIQUE membership currently uses the same column-row indicator as individual uniqueness, and deduplicating by constraint type hides overlapping groups. Keep the existing glyphs before the column name and identify each composite group with a small blue badge containing the snowflake and a letter. Standalone constraint icons keep their existing appearance. A column in two groups shows separate A and B indicators, each with its own tooltip. The same group has the same letter across all its member columns.
Earlier indicator, before the group-letter revision:
Type of change:
High-level design:
prepareConstraintIconassigns letters across the table’s composite UNIQUE constraints before selecting the groups containing each column. Each matching group gets a separate icon and letter inside the existing design-system blue Badge, with its column list in the tooltip and accessible name. The badge uses the requested light fill (#EFF8FF), border (#B2DDFF), and icon/letter color (#175CD3) through existing tokens. Letters follow table-constraint order and continue after Z as AA, AB, and so on. Individual uniqueness stays unlettered. The schema name container uses its available width so overlapping indicators stay together before the column name. Column names and constraint indicators share a horizontal centerline in the Columns and version-history views. Version history assigns letters from one shared list of current, added, and deleted groups before rendering each column’s diff badges.Two new translation keys are synchronized and translated across the locale files. This change requires no schema, backend, ingestion, or data migration changes.
Tests:
Use cases covered
Unit tests
yarn test src/components/Entity/VersionTable/VersionTable.test.tsx src/utils/TableUtils.test.tsx src/components/Database/SchemaTable/SchemaTable.test.tsx --watch=false --runInBand— 194 passed across 3 suites. New version-history cases cover overlapping additions, unchanged preceding groups, mixed additions/deletions, and removal of all groups. Coverage percentage was not collected.Backend integration tests
Not applicable — no backend or API changes. The unchanged backend was built locally to run a matching application instance.
Ingestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
PLAYWRIGHT_IS_OSS=true yarn playwright:run playwright/e2e/Features/TableConstraint.spec.ts --project=chromium --workers=1— 4 stages passed, including authentication setup, entity setup, the constraint flow, and cleanup. The run covers the letter indicator and its keyboard tooltip; the final name-container spacing and blue badge styling were checked in Waterfox.The existing constraint flow checks the visible group letter, composite tooltip contents through keyboard focus, and dismissal through Escape. The full impact-mapped suite remains pending;
make playwright_affectedreports shared-helper mapping gaps and a broad selection.Visual regression baselines
Linux visual baseline refresh remains pending. Keeping this PR as a draft for UI review.
Other validation
--declaration false --declarationMap falsecurrently reports TS18048 in unchangedsrc/utils/queryBuilderWidgets/OMSelectWidget.tsx:59(item.labelpossibly undefined). No errors are reported in the files changed here.REVIEW.md:79f49a2baa5. The group-letter finding in table version history is addressed by a shared label source, with regression coverage inVersionTable.test.tsx. Shared renderer and letter-label logic map toTableUtils.test.tsxandTableConstraint.spec.ts; name-cell rendering maps toSchemaTable.test.tsx; grouped icon rendering maps toConstraintIcon.test.tsx.Manual testing performed
UI screen recording:
Not applicable — standalone correction to existing constraint indicators and tooltips. The running application was reviewed locally in Waterfox.
Checklist:
REVIEW.md.

Confidence Score: 5/5
The reviewed changes appear safe to merge.Summary
Composite UNIQUE groups now have separate lettered badges and tooltips, while standalone uniqueness keeps its existing appearance.
The previous version-history finding is fixed. No new actionable issues were found.
Reviews (4) · Last reviewed commit: "fix(ui): keep composite labels consisten..." · Reviewed by Greptile