Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/integration-governance.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const MAX_COMMITS = 1000;
const MAX_AUTHOR_BATCH = 50;
// This literal is inside the enrolled .github closure. A caller-supplied
// preparedBy.sourceSHA must never choose a new executable verifier tree.
const TRUSTED_SCRIPTS_TREE = '066d4e1e6d183026098cafe5a312633e517b2031';
const TRUSTED_SCRIPTS_TREE = '75a61a7ab6d25706d9ff889dfa082639336c9bfb';
const SOURCE = 'https://github.com/kubernetes-sigs/kubebuilder-release-tools/tree/012269a88fa4c034a0acf1ba84c26b195c0dbab4';
const sha = value => crypto.createHash('sha256').update(value).digest('hex');
const git = (args, cwd = process.cwd()) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity monitor text now has a 12px floor on phones, so the chips, timestamps and column headers stay readable at 390px wide.
11 changes: 11 additions & 0 deletions src/docs/dashboard-design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,17 @@ the focus trap and the body scroll lock behave as on desktop; desktop layout
is unchanged apart from the affordance. Metrics come from the
`--modal-scroll-*` / `--modal-sheet-*` tokens in `tokens.css`.

### Phone text floor for the Activity monitor

Inside `#activity-monitor-section`, the phone tier
(`@media (max-width: 640px), ((pointer: coarse) and (max-width: 820px))` in
`responsive.css`) remaps `--fs-2xs` and `--fs-xs` to `--fs-sm` (`.75rem`,
12px), so no `.ham-*` text renders below 12px on a phone. Inputs stay at
`--fs-touch`. Desktop sizes are unchanged. New tracker CSS should size text
through `--fs-2xs`/`--fs-xs`/`--fs-sm` and never hard-code a smaller size, so
the floor applies automatically. `dashboard-mobile-shots.mjs` asserts it at
390×844 through the `tracker-text-floor` probe.

### Phone tap targets: `--tap-target-touch`

`--tap-target` (40px) sizes icon-only controls on desktop and the 768px tier.
Expand Down
40 changes: 40 additions & 0 deletions src/pkg/dashboard/activity_monitor_phone_text_floor_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package dashboard

import (
"strings"
"testing"
)

// TestActivityMonitorPhoneTextFloor guards the 12px phone text floor for the
// Activity monitor (#17164): the phone media tier must remap --fs-2xs and
// --fs-xs to --fs-sm inside #activity-monitor-section, plus --ham-odo-digit,
// which :root resolves from --fs-xs before the section override can apply.
func TestActivityMonitorPhoneTextFloor(t *testing.T) {
html := indexHTML(t)

const tier = "@media (max-width: 640px), ((pointer: coarse) and (max-width: 820px)) {"
const rule = "#activity-monitor-section { --fs-2xs: var(--fs-sm); --fs-xs: var(--fs-sm); --ham-odo-digit: var(--fs-sm); }"

found := false
for rest := html; ; {
i := strings.Index(rest, tier)
if i < 0 {
break
}
rest = rest[i+len(tier):]
end := strings.Index(rest, "\n }\n")
if end < 0 {
break
}
if strings.Contains(rest[:end], rule) {
found = true
break
}
}
if !found {
t.Errorf("phone media tier is missing %q — Activity monitor text must stay >= 12px on phones (#17164)", rule)
}
if !strings.Contains(html, "--fs-sm: .75rem;") {
t.Errorf("--fs-sm must remain .75rem (12px), the phone text floor (#17164)")
}
}
1 change: 1 addition & 0 deletions src/pkg/dashboard/static-src/css/responsive.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
.ham-compact .ham-chips { display: inline-flex; flex: 0 0 auto; }
.ham-compact .ham-chip { flex: 0 0 auto; min-height: var(--tap-target); font-size: var(--fs-sm); white-space: nowrap; }
.ham-compact-more[data-ham-active] { background: var(--panel-strong); color: var(--text); border-color: var(--line-strong); }
#activity-monitor-section { --fs-2xs: var(--fs-sm); --fs-xs: var(--fs-sm); --ham-odo-digit: var(--fs-sm); }
}
@media (max-width: 768px) {
body {
Expand Down
1 change: 1 addition & 0 deletions src/pkg/dashboard/static-src/css/tracker.css
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@
dropped and the caption keeps its lead clause on one line. The pill
sheet carries the full title and the needs-human note. */
@media (max-width: 640px), ((pointer: coarse) and (max-width: 820px)) {
#activity-monitor-section .ham-row { padding-block: var(--sp-3); }
#activity-monitor-section .ham-row > .ham-row-head.ham-row-head, #activity-monitor-section .ham-sub > .ham-row-head.ham-row-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--sp-2); row-gap: var(--sp-1); min-height: 0; line-height: var(--lh-control); }
.ham-head-cols, .ham-head-cols > .ham-strip, .ham-head-cols .ham-seg.ham-head-lead, .ham-head-cols .ham-seg.ham-head-pr, .ham-head-cols .ham-pr-line { display: contents; }
#activity-monitor-section .ham-row-head .ham-head-main, #activity-monitor-section .ham-row-head .ham-pr-ref { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; flex: 1 1 auto; min-width: 0; max-width: 100%; gap: 0; }
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2332,6 +2332,7 @@
dropped and the caption keeps its lead clause on one line. The pill
sheet carries the full title and the needs-human note. */
@media (max-width: 640px), ((pointer: coarse) and (max-width: 820px)) {
#activity-monitor-section .ham-row { padding-block: var(--sp-3); }
#activity-monitor-section .ham-row > .ham-row-head.ham-row-head, #activity-monitor-section .ham-sub > .ham-row-head.ham-row-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--sp-2); row-gap: var(--sp-1); min-height: 0; line-height: var(--lh-control); }
.ham-head-cols, .ham-head-cols > .ham-strip, .ham-head-cols .ham-seg.ham-head-lead, .ham-head-cols .ham-seg.ham-head-pr, .ham-head-cols .ham-pr-line { display: contents; }
#activity-monitor-section .ham-row-head .ham-head-main, #activity-monitor-section .ham-row-head .ham-pr-ref { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; flex: 1 1 auto; min-width: 0; max-width: 100%; gap: 0; }
Expand Down Expand Up @@ -6004,6 +6005,7 @@
.ham-compact .ham-chips { display: inline-flex; flex: 0 0 auto; }
.ham-compact .ham-chip { flex: 0 0 auto; min-height: var(--tap-target); font-size: var(--fs-sm); white-space: nowrap; }
.ham-compact-more[data-ham-active] { background: var(--panel-strong); color: var(--text); border-color: var(--line-strong); }
#activity-monitor-section { --fs-2xs: var(--fs-sm); --fs-xs: var(--fs-sm); --ham-odo-digit: var(--fs-sm); }
}
@media (max-width: 768px) {
body {
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/webstatic/style_ratchet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type styleRatchetCounts struct {
var styleRatchetBaselines = map[string]styleRatchetCounts{
"operator static/index.html": {
inlineStyles: 1403,
rawColors: 135,
rawColors: 134,
rawFontSizes: 591,
rawPadding: 204,
rawBorderRadii: 174},
Expand Down
27 changes: 27 additions & 0 deletions src/pkg/dashboard/webstatic/testdata/tracker-text-floor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Dedicated preview only: evaluate (<file contents>)({ dedicatedPreview: true }).
// On phones every rendered text node in the Activity monitor must be >= 12px (#17164).
(async ({ dedicatedPreview = false } = {}) => {
if (!dedicatedPreview) throw new Error('Use a dedicated published-preview tab, not the user’s live dashboard');
const root = document.getElementById('activity-monitor-section');
if (!root) throw new Error(JSON.stringify({ viewport: innerWidth, failures: ['#activity-monitor-section missing'] }));
const phone = innerWidth <= 640;
const failures = [];
const small = [];
let checked = 0;
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
for (let node = walker.nextNode(); node; node = walker.nextNode()) {
if (!node.nodeValue.trim()) continue;
const el = node.parentElement;
const style = getComputedStyle(el);
if (style.display === 'none' || style.visibility === 'hidden' || !el.getClientRects().length) continue;
checked++;
if (parseFloat(style.fontSize) < 12) small.push(el.className + ' ' + style.fontSize);
}
if (phone) {
if (!checked) failures.push('no visible text nodes in the Activity monitor');
if (small.length) failures.push(small.length + ' text nodes below 12px: ' + [...new Set(small)].slice(0, 10).join('; '));
if (document.documentElement.scrollWidth > innerWidth) failures.push('horizontal overflow: scrollWidth ' + document.documentElement.scrollWidth + ' > ' + innerWidth);
}
if (failures.length) throw new Error(JSON.stringify({ viewport: innerWidth, checked, failures }));
return { viewport: innerWidth, checked, below12: small.length, failures };
})
2 changes: 1 addition & 1 deletion src/scripts/dashboard-mobile-shots.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async function main() {
const activityFailures = [];
const fixtureRoot = path.join(process.cwd(), 'src/pkg/dashboard/webstatic/testdata');
const density = JSON.parse(fs.readFileSync(path.join(fixtureRoot, 'tracker-activity-density.json'), 'utf8'));
const probes = ['tracker-header-geometry', 'tracker-decision-interaction', 'tracker-phone-chrome', 'tracker-phone-pill', 'tracker-phone-ergonomics', 'tracker-phone-card'].map(name => ({
const probes = ['tracker-header-geometry', 'tracker-decision-interaction', 'tracker-phone-chrome', 'tracker-phone-pill', 'tracker-phone-ergonomics', 'tracker-phone-card', 'tracker-text-floor'].map(name => ({
name, source: fs.readFileSync(path.join(fixtureRoot, name + '.js'), 'utf8'),
}));
// Phone tier (hivecommons/hive#17160): the chevron strip is hidden behind
Expand Down
Loading