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('
| ') && prof.includes('data-action="customersIdentityRemove"') && prof.includes(' | Source | '), '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) + ' | ' + + '' + escapeHtml(meta.join(' · ')) + ' | ' + + '' + buttons + ' |
| Type | Identity | Source |
|---|
No identities.
') + 'What you add here is shown as unconfirmed until the hive owner or a read-write user confirms it.
'; return 'No identities.
') + '| Type | Identity | Source |
|---|
No identities.
') + '