From 74779ee12b412fba41c5ee93cf620cfed8181dd1 Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Wed, 18 Nov 2026 14:46:18 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Customers:=20show=20identities=20as?= =?UTF-8?q?=20a=20compact=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #19113 Signed-off-by: Andy Anderson --- .../changed-19113-customers-identities-table.md | 1 + src/pkg/dashboard/customers_ui_test.go | 1 + src/pkg/dashboard/static-src/css/customers.css | 7 +++++++ src/pkg/dashboard/static-src/js/customers.js | 9 +++++---- src/pkg/dashboard/static/index.html | 16 ++++++++++++---- 5 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 changelog.d/changed-19113-customers-identities-table.md diff --git a/changelog.d/changed-19113-customers-identities-table.md b/changelog.d/changed-19113-customers-identities-table.md new file mode 100644 index 0000000000..ed5d91ec88 --- /dev/null +++ b/changelog.d/changed-19113-customers-identities-table.md @@ -0,0 +1 @@ +- Customers: a profile shows its identities as a compact table (Type, Identity, Source, with the row actions in the last column) instead of one bordered box per identity. At phone width the table scrolls inside its own frame, not the page. Same data, actions and empty state. diff --git a/src/pkg/dashboard/customers_ui_test.go b/src/pkg/dashboard/customers_ui_test.go index 791a13f313..d1a6145e3f 100644 --- a/src/pkg/dashboard/customers_ui_test.go +++ b/src/pkg/dashboard/customers_ui_test.go @@ -141,6 +141,7 @@ must(list.includes('data-action="customersAccept"') && list.includes('data-actio must(list.includes('data-arg0="me"') && list.includes('data-arg0="p_abc"'), 'list rows do not open me and the customer'); must(!list.includes('Ada') && list.includes('<b>Ada</b>'), 'a name reached the page unescaped'); must(prof.includes('data-action="customersForget"'), 'owner profile lacks Forget'); +must(prof.includes('Identity') && prof.includes(''), 'identities are not a table with headers, a row header and row actions'); must(customersFlagEmoji('DE') === '\u{1F1E9}\u{1F1EA}' && customersFlagEmoji('de') === '' && customersFlagEmoji('') === '' && customersFlagEmoji(null) === '', 'flag emoji'); must(list.includes('class="kc-pill customers-pill customers-country" role="img" aria-label="Country: ') && list.includes(' DE'), 'the row lacks the country pill with its text code and accessible name'); must(customersCountryPill({ profile: { country: { value: '' } } }) === '' && customersCountryPill({}) === '', 'a malformed or missing country must render nothing'); diff --git a/src/pkg/dashboard/static-src/css/customers.css b/src/pkg/dashboard/static-src/css/customers.css index e65ed54a37..dc78abd51e 100644 --- a/src/pkg/dashboard/static-src/css/customers.css +++ b/src/pkg/dashboard/static-src/css/customers.css @@ -58,6 +58,13 @@ .customers-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); min-width: 0; max-width: 100%; } .customers-row[data-me="true"] { border-color: var(--accent); } .customers-row .customers-row-title { overflow-wrap: anywhere; } + /* Identities table: one aligned grid; it scrolls inside its own wrapper at phone width, never the page. */ + .customers-table-wrap { max-width: 100%; overflow-x: auto; } + .customers-ident-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); } + .customers-ident-table th, .customers-ident-table td { text-align: left; vertical-align: middle; padding: var(--table-cell-pad-y) var(--table-cell-pad-x); border-bottom: var(--line-width) solid var(--line-subtle); } + .customers-ident-table thead th { color: var(--muted); font-weight: 600; } + .customers-ident-table .customers-ident-value { font-weight: var(--fw-semibold); overflow-wrap: anywhere; } + .customers-ident-table .customers-ident-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); border-bottom: 0; } .customers-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); min-width: 0; } /* The tag toggle in a profile is the row's tag pill as a button: one pill recipe in both places. Off is dimmed and neutral; the auto marker is small. */ button.kc-pill.customers-tag-toggle { position: relative; font-family: inherit; cursor: pointer; } diff --git a/src/pkg/dashboard/static-src/js/customers.js b/src/pkg/dashboard/static-src/js/customers.js index 2ca88e0f9a..17449301a5 100644 --- a/src/pkg/dashboard/static-src/js/customers.js +++ b/src/pkg/dashboard/static-src/js/customers.js @@ -446,16 +446,17 @@ if (!fixed) { buttons += ''; } - return '
' + escapeHtml(CUSTOMERS_KIND_LABELS[i.kind] || i.kind) + '' + - '
' + escapeHtml(i.value) + '
' + - (meta.length ? '
' + escapeHtml(meta.join(' · ')) + '
' : '') + '
' + buttons + '
'; + return '
' + + '' + + '' + + ''; } function customersIdentitiesHtml(p) { const ids = p.identities || []; const note = customersIsFull() ? '' : '

What you add here is shown as unconfirmed until the hive owner or a read-write user confirms it.

'; return '
' + note + - '
' + (ids.length ? ids.map(i => customersIdentityRowHtml(p, i)).join('') : '

No identities.

') + '
' + + (ids.length ? '
') && prof.includes('data-action="customersIdentityRemove"') && prof.includes('Source
' + escapeHtml(CUSTOMERS_KIND_LABELS[i.kind] || i.kind) + '' + escapeHtml(i.value) + '' + escapeHtml(meta.join(' · ')) + '' + buttons + '
' + ids.map(i => customersIdentityRowHtml(p, i)).join('') + '
TypeIdentitySource
' : '

No identities.

') + '
' + '' + '
'; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index a1606d5cfc..fecc5d0d94 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -6517,6 +6517,13 @@ .customers-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); min-width: 0; max-width: 100%; } .customers-row[data-me="true"] { border-color: var(--accent); } .customers-row .customers-row-title { overflow-wrap: anywhere; } + /* Identities table: one aligned grid; it scrolls inside its own wrapper at phone width, never the page. */ + .customers-table-wrap { max-width: 100%; overflow-x: auto; } + .customers-ident-table { width: 100%; border-collapse: collapse; font-size: var(--fs-xs); } + .customers-ident-table th, .customers-ident-table td { text-align: left; vertical-align: middle; padding: var(--table-cell-pad-y) var(--table-cell-pad-x); border-bottom: var(--line-width) solid var(--line-subtle); } + .customers-ident-table thead th { color: var(--muted); font-weight: 600; } + .customers-ident-table .customers-ident-value { font-weight: var(--fw-semibold); overflow-wrap: anywhere; } + .customers-ident-table .customers-ident-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); border-bottom: 0; } .customers-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); min-width: 0; } /* The tag toggle in a profile is the row's tag pill as a button: one pill recipe in both places. Off is dimmed and neutral; the auto marker is small. */ button.kc-pill.customers-tag-toggle { position: relative; font-family: inherit; cursor: pointer; } @@ -54499,16 +54506,17 @@ if (!fixed) { buttons += ''; } - return '
' + escapeHtml(CUSTOMERS_KIND_LABELS[i.kind] || i.kind) + '' + - '
' + escapeHtml(i.value) + '
' + - (meta.length ? '
' + escapeHtml(meta.join(' · ')) + '
' : '') + '
' + buttons + '
'; + return '' + escapeHtml(CUSTOMERS_KIND_LABELS[i.kind] || i.kind) + '' + + '' + escapeHtml(i.value) + '' + + '' + escapeHtml(meta.join(' · ')) + '' + + '' + buttons + ''; } function customersIdentitiesHtml(p) { const ids = p.identities || []; const note = customersIsFull() ? '' : '

What you add here is shown as unconfirmed until the hive owner or a read-write user confirms it.

'; return '
' + note + - '
' + (ids.length ? ids.map(i => customersIdentityRowHtml(p, i)).join('') : '

No identities.

') + '
' + + (ids.length ? '
' + ids.map(i => customersIdentityRowHtml(p, i)).join('') + '
TypeIdentitySource
' : '

No identities.

') + '
' + '' + '
';