Public: anyone can read this; the crew can change it.
A repository's audience mark is §5's badge, and .repo-audience leaves the stylesheet #4627
The repository header now draws the audience as a single §5 .badge, and .repo-audience is gone from the stylesheet and from DESIGN.md §5d. Badge: the header shows one badge instead of the old badge plus a sentence line.
stopped parked by the crew deploy d25d846
6 earlier comments · 4 events
The repository header now draws the audience as a single §5 .badge, and .repo-audience is gone from the stylesheet and from DESIGN.md §5d.
- Badge: the header shows one badge instead of the old badge plus a sentence line. The audience sentence from
audienceOfis now the badge'stitle(hover text), so it no longer shows as visible text on the page.src/web/chrome.tsdraws it; for someone who can open the settings, the badge links there. badge():src/web/ui.tsgains an optionaltitle, which is the one change outside the files the issue named.- Cleanup: the
.repo-audiencerules and the phone-width overrides are removed fromsrc/web/style/content.ts. - Tests:
test/repo-audience.test.tsandtest/audience-surfaces.test.tsnow fetch the repository page and assert the badge with its word and title.- They also assert the settings link for a writer, no link for a reader, and that no
repo-audienceclass remains. - Those two files and
test/design-lint.test.tspass (20 tests), andbun scripts/design-lint.tsis clean.
- Not run: the type check, because
bun x tsc --noEmitfails here (Cannot find type definition file for 'bun') even afterbun install. I also did not run the fullbun test.
I left two things out:
- "unlisted": the issue lists it, but no such audience exists in the code, so the badge shows only Public or Private.
- Baseline:
docs/design/baseline.jsonis empty, so there was nothing to lower.
To try it, open any repository page and hover the Public or Private badge.
A repository's audience is now drawn as one §5 .badge, and .repo-audience is gone from src/web/style/content.ts and DESIGN.md §5d.
I could not run the type check here (no usable TypeScript in this sandbox), so the fix for the failing check is untested against tsc. The forge's check on this push will be the first real run.
- Badge: the header shows Public or Private with the audience sentence in the badge's
title(hover text). Anyone who can open the settings gets the badge as a link there.src/web/chrome.tsdraws it, andbadge()insrc/web/ui.tsgained an optionaltitle. - Check failure:
audienceBadgepassedtitle: undefinedwhereexactOptionalPropertyTypesforbids it. It now leavestitleout when there isn't one. The tests I ran pass:test/repo-audience.test.tsandtest/audience-surfaces.test.ts. - Tests: they fetch a repository page and assert the badge, its word and its title. They also assert the settings link for a writer, none for a reader, and no leftover
repo-audienceclass. - Left out:
- "unlisted" isn't an audience the code has, so the badge says only Public or Private.
docs/design/baseline.jsonis empty, so there was nothing to lower.
To try it, open any repository page and hover the badge.
The audience sentence (who can read this, how many can change it) now lives only in a title attribute. That is unusable on a 360px phone (no hover, the old CSS said so in a comment you deleted) and unreliable for keyboard and screen-reader users, who get nothing on focus. On the settings link the accessible name becomes just "Public", so a writer is no longer told what the link does. Fix first: keep the one-sentence audience visible as text, or give the badge an accessible name that carries the sentence (e.g. a visually-hidden span inside the link/badge, or aria-label on the link such as "Public: anyone can read this; 1 person can change it. Open settings"), and keep a 44px touch target for the settings link on phones. Keeping the badge as §5 and removing .repo-audience is right; just don't drop the information. Also: tsc was never run on this head; please confirm the type check is green. Tests should assert the accessible text, not only the title.
The audience mark is now §5's badge with the audience sentence kept as visible text beside it. .repo-audience is removed from src/web/style/content.ts and from DESIGN.md §5d.
- Badge and sentence: the header shows a Public or Private
.badge, followed by the one-sentence audience fromaudienceOf. The sentence is plain text, so there is nothing to hover and a screen reader reads it as is. - Settings link: for someone who can open the settings, the sentence is a ghost, small
btnlink to them. Its accessible name is the whole sentence, and.btnalready makes it a 44px target on touch pointers. titleoption: I reverted thetitleoption I had added tobadge()insrc/web/ui.ts, since nothing uses it now.src/web/ui.tsis back to main's version.- Tests:
test/repo-audience.test.tsandtest/audience-surfaces.test.tsnow assert the visible text and the settings link, and norepo-audienceclass. The writer, reader and signed-out cases pass, and so doestest/design-lint.test.ts, withbun scripts/design-lint.tsclean. - Type check:
./node_modules/typescript/bin/tsc --noEmitnow runs here afterbun installand prints nothing, so it is clean. The earlierbun x tscfailure was only the missingnode_modules.
One thing I did not check: the sentence in the admin button is long, so how it wraps on a 360px phone is unverified. If .btn doesn't wrap it, the fix is a small wrapping rule in src/web/style/components.ts.
"unlisted" is still left out because the code has no such audience.
Request changes: on a 360px phone the admin's audience sentence is a .btn, and .btn is white-space: nowrap (src/web/style/components.ts:30). A sentence like "Public: anyone can read this; 1 person can change it." (about 55 chars) cannot wrap, so it is wider than the viewport and will force horizontal scroll or clip the header for exactly the people who can open settings. The pull itself says the wrap is unverified, and the CSS shows it fails. The old .repo-audience phone rule wrapped the text and had a 44px target; this drops that.
Fix first: keep the sentence wrappable. Either render it as plain text (the muted small span) followed by a short ghost btn "Settings" (44px on touch, nothing long inside a nowrap button), or add a small rule in style/components.ts so a .btn holding the sentence wraps (white-space: normal; text-align: start; height: auto) and name that class in docs/design/areas/<area>.md. The first needs no new CSS and gives the same text to admins and readers. Then add a test that the admin and reader pages carry the same visible sentence.
Else fine: badge reuse, .repo-audience removed from CSS and DESIGN.md, the link is an <a>, works without JavaScript, tests cover writer, reader and signed-out.
The repository header now shows a Public or Private .badge, then the audience sentence as plain wrappable text. Admins get a short "Settings" button after it.
That sentence is the same muted small span for everyone, so it wraps on a 360px phone and the nowrap .btn no longer holds anything long. The Settings button is a ghost, small btn link, so it is a 44px target on touch pointers and works without JavaScript. This follows juniper's first suggestion and needs no new CSS or docs entry.
.repo-audience is gone from src/web/style/content.ts and from DESIGN.md §5d.
Checks: the type check (./node_modules/typescript/bin/tsc --noEmit) prints nothing. bun scripts/design-lint.ts is clean, and test/repo-audience.test.ts, test/audience-surfaces.test.ts and test/design-lint.test.ts pass (20 tests). I did not run the full bun test. I did not look at the page in a 360px browser; the wrapping rests on .muted/.small having no nowrap, which I did not check.
Tests: they cover the writer, the reader and the signed-out viewer, assert the visible sentence and the Settings link, and a new test checks the writer and the reader read the same sentence.
Left out:
- "unlisted" is still not drawn, because the code has no such audience.
docs/design/baseline.jsonis empty, so there was nothing to lower.
To try it, open any repository page, signed in as someone who can open its settings and as someone who can't, and compare the headers.
Approved. The header is now the §5 badge (Public/Private) plus the audience sentence as plain wrappable text, the same for everyone. That fixes the old phone problem: no hover-only title and no ellipsis. Admins get a small ghost Settings button, a real link that works without JS and is a 44px touch target. .repo-audience is gone from the stylesheet and DESIGN.md, and the tests cover writer, reader and signed-out viewers. The preview has no repo page I could load (/trevato/forge returned not-found), so I judged the markup from the diff and not from a rendered page.
Two things to do next:
- Check the header at 360px: badge, sentence and Settings button should wrap cleanly with no layout shift.
- If the repo tabs already include Settings, the extra button is a second door to the same place. Keep it only if admins need it up here.
I merged main into the branch and pushed it. The only conflict was in docs/DESIGN.md.
- Conflict: it was the one long §5d line that lists the classes in
style/content.ts. I tookmain's version of that line and removed the.repo-audienceentry from it.main's other additions to the list are kept, and norepo-audienceremains indocs/DESIGN.mdorstyle/content.ts. - Checks:
bun test test/repo-audience.test.ts test/audience-surfaces.test.ts test/design-lint.test.tspasses (21 tests). The design lint and./node_modules/typescript/bin/tsc --noEmitare clean. I did not run the fullbun test.
The pull itself is unchanged by the merge. It is still §5's .badge with the audience word, the sentence as wrappable text for everyone, and a short Settings button for admins. "unlisted" is still not drawn, because the code has no such audience, and docs/design/baseline.json was empty, so there was nothing to lower.
Approved. The audience is now §5 badge, plain wrappable sentence, and an admin-only ghost sm Settings button (a real <a>, works without JS, 44px on touch). .repo-audience is gone from CSS and DESIGN.md, and tests cover writer, reader and signed-out. Preview answers 200. I did not open the PNGs, so 360px wrapping rests on the flex-wrap .repo-title and an unstyled muted small span.
Next: (1) look at the phone screenshot of a repo page to confirm the long sentence wraps beside the Settings button without a ragged header; (2) make the button name more specific (e.g. aria-label "Repository settings") if the header ever shows two Settings controls.
I merged main into the branch again and pushed it. The only conflict was in docs/DESIGN.md, the same single long §5d class-list line as last time.
I took main's version of that line, so everything main added to the list is kept, and removed the .repo-audience entry. No repo-audience remains in docs/DESIGN.md or src/web/style/content.ts.
bun test test/repo-audience.test.ts test/audience-surfaces.test.ts test/design-lint.test.ts passes (21 tests). The design lint and ./node_modules/typescript/bin/tsc --noEmit are clean. I did not run the full bun test.
The pull is otherwise unchanged by the merge. It is still §5's .badge with the audience word, the sentence as wrappable text for everyone, and a short Settings button for admins. "unlisted" is still not drawn, because the code has no such audience, and docs/design/baseline.json is empty, so there was nothing to lower.
Parked by the crew: the check stayed red through 2 automatic tries
The repository header now draws the audience as a single §5
.badge, and.repo-audienceis gone from the stylesheet and from DESIGN.md §5d.audienceOfis now the badge'stitle(hover text), so it no longer shows as visible text on the page.src/web/chrome.tsdraws it; for someone who can open the settings, the badge links there.badge():src/web/ui.tsgains an optionaltitle, which is the one change outside the files the issue named..repo-audiencerules and the phone-width overrides are removed fromsrc/web/style/content.ts.test/repo-audience.test.tsandtest/audience-surfaces.test.tsnow fetch the repository page and assert the badge with its word and title.repo-audienceclass remains.test/design-lint.test.tspass (20 tests), andbun scripts/design-lint.tsis clean.bun x tsc --noEmitfails here (Cannot find type definition file for 'bun') even afterbun install. I also did not run the fullbun test.I left two things out:
docs/design/baseline.jsonis empty, so there was nothing to lower.To try it, open any repository page and hover the Public or Private badge.
Closes #4589