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 web/e2e/report-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test("submits a report via address search and shows the success screen", async (
locationMethod: "ADDRESS_SEARCH",
});

await page.getByRole("button", { name: "Report another car" }).click();
await page.getByRole("button", { name: "Report another vehicle" }).click();
await expect(page.getByRole("heading", { name: "Report a Double-Parked Vehicle" })).toBeVisible();
});

Expand Down
Binary file added web/public/primary-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 28 additions & 17 deletions web/src/components/AppHeader.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.header {
background: var(--boston-navy-800);
color: white;
background: white;
color: var(--boston-navy-800);
/* A white header needs its own separation from the page background
(--color-bg is a very light gray) since it can no longer rely on a
dark fill to read as a distinct band. */
border-bottom: 1px solid var(--color-border);
/* Keeps the brand row clear of the iPhone notch/dynamic island when
installed as a standalone app (requires viewport-fit=cover, already
set in index.html). */
Expand All @@ -9,24 +13,22 @@

.brandRow {
display: flex;
align-items: baseline;
align-items: center;
gap: var(--space-3);
padding: 0 var(--space-5) var(--space-3);
flex-wrap: wrap;
}

.cityTag {
font-family: var(--font-heading);
font-size: 1rem;
font-weight: 700;
letter-spacing: 0.08em;
color: var(--boston-gold-500);
.logo {
height: 32px;
width: auto;
}

.title {
font-family: var(--font-heading);
font-size: 1.15rem;
font-weight: 700;
color: var(--boston-blue-optimistic);
}

/* Two equal-width buttons spanning the full header width, like a tab bar,
Expand All @@ -40,25 +42,34 @@
.navLinkActive {
flex: 1;
text-align: center;
color: white;
text-decoration: none;
padding: var(--space-3) var(--space-4);
font-weight: 600;
}

.navLink {
background: #f2f2f2;
color: var(--boston-navy-800);
}

.navLink:hover {
background: var(--boston-navy-700);
background: var(--boston-navy-100);
}

/* Each state needs its own outline color -- a single shared color can't
clear WCAG 1.4.11's 3:1 non-text contrast minimum against both a light
gray AND the blue it sits next to at the same time. */
.navLink:focus-visible {
outline-color: var(--boston-blue-optimistic);
outline-offset: -3px;
}

/* The default blue focus ring falls below WCAG 1.4.11's 3:1 non-text
contrast minimum against this dark navy background; gold clears it. */
.navLink:focus-visible,
.navLinkActive:focus-visible {
outline-color: var(--boston-gold-500);
outline-color: white;
outline-offset: -3px;
}

.navLinkActive {
background: var(--boston-gold-500);
color: var(--boston-navy-900);
background: var(--boston-blue-optimistic);
color: white;
}
7 changes: 4 additions & 3 deletions web/src/components/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ export function AppHeader() {
return (
<header className={styles.header}>
<div className={styles.brandRow}>
<span className={styles.cityTag} aria-hidden="true">
CITY OF BOSTON
</span>
{/* The logo itself reads "City of Boston" (with the city's red
underline mark), so it carries that meaning on its own -- no
separate text label needed alongside it. */}
<img src="/primary-logo.png" alt="City of Boston" className={styles.logo} />
<span className={styles.title}>Double Parking Reporter</span>
</div>
<nav className={styles.nav} aria-label="Primary">
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/InstallPrompt.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

.text {
margin: 0 0 var(--space-3);
font-size: 0.92rem;
font-size: 1rem;
color: var(--color-text);
}

Expand Down
8 changes: 4 additions & 4 deletions web/src/pages/Dashboard/Dashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
.customRange label {
display: flex;
flex-direction: column;
font-size: 0.85rem;
font-size: 1rem;
gap: 2px;
}

Expand Down Expand Up @@ -120,7 +120,7 @@
right: var(--space-3);
background: var(--boston-red-600);
color: white;
font-size: 0.75rem;
font-size: 1rem;
font-weight: 700;
padding: 4px 10px;
border-radius: 999px;
Expand All @@ -134,7 +134,7 @@

.metricsGrid h3 {
margin-top: 0;
font-size: 0.95rem;
font-size: 1rem;
color: var(--color-text-muted);
}

Expand All @@ -152,7 +152,7 @@
.metricCaption {
color: var(--color-text-muted);
margin: 0;
font-size: 0.9rem;
font-size: 1rem;
}

.streetList {
Expand Down
8 changes: 4 additions & 4 deletions web/src/pages/Dashboard/MetricsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export function MetricsPanel({ stats }: { stats: Stats }) {
<ResponsiveContainer>
<BarChart data={hourData} aria-label="Bar chart of reports by hour of day">
<CartesianGrid strokeDasharray="3 3" vertical={false} />
<XAxis dataKey="label" tick={{ fontSize: 11 }} interval={2} />
<YAxis allowDecimals={false} tick={{ fontSize: 11 }} />
<XAxis dataKey="label" tick={{ fontSize: 16 }} interval={2} />
<YAxis allowDecimals={false} tick={{ fontSize: 16 }} />
<Tooltip />
<Bar dataKey="count" fill="#0c2340" radius={[4, 4, 0, 0]} />
</BarChart>
Expand Down Expand Up @@ -86,8 +86,8 @@ export function MetricsPanel({ stats }: { stats: Stats }) {
<ResponsiveContainer>
<LineChart data={stats.trend} aria-label="Line chart of report volume over time">
<CartesianGrid strokeDasharray="3 3" vertical={false} />
<XAxis dataKey="date" tick={{ fontSize: 11 }} />
<YAxis allowDecimals={false} tick={{ fontSize: 11 }} />
<XAxis dataKey="date" tick={{ fontSize: 16 }} />
<YAxis allowDecimals={false} tick={{ fontSize: 16 }} />
<Tooltip />
<Line type="monotone" dataKey="count" stroke="#c8102e" strokeWidth={2} dot={false} />
</LineChart>
Expand Down
95 changes: 48 additions & 47 deletions web/src/pages/Report/AddressSearchStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,58 +73,59 @@ export function AddressSearchStep({
);

return (
<section aria-labelledby="search-heading" className={styles.stepSection}>
<h2 id="search-heading">Search for the address</h2>
<label htmlFor="address-input" className={styles.fieldLabel}>
Street address in Boston
</label>
<input
id="address-input"
type="text"
role="combobox"
aria-expanded={suggestions.length > 0}
aria-controls="address-listbox"
aria-autocomplete="list"
aria-activedescendant={activeIndex >= 0 ? `address-option-${activeIndex}` : undefined}
className={styles.textInput}
value={query}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={handleKeyDown}
placeholder="e.g. 1 City Hall Square"
autoComplete="off"
/>
<p role="status" aria-live="polite" className="visually-hidden">
{loading
? "Searching…"
: suggestions.length
? `${suggestions.length} suggestions available`
: ""}
</p>
{error && <p className={styles.errorText}>{error}</p>}
{suggestions.length > 0 && (
<ul id="address-listbox" role="listbox" className={styles.suggestionList}>
{suggestions.map((s, i) => (
<li
key={s.id}
id={`address-option-${i}`}
role="option"
aria-selected={i === activeIndex}
className={i === activeIndex ? styles.suggestionActive : styles.suggestion}
onMouseDown={() => selectSuggestion(s)}
>
{s.placeName}
</li>
))}
</ul>
)}
{/* Reserves the space the floating bar below covers, so the last of
the suggestion list isn't hidden behind it. */}
<>
<section aria-labelledby="search-heading" className={styles.stepSection}>
<h2 id="search-heading">Search for the address</h2>
<label htmlFor="address-input" className={styles.fieldLabel}>
Street address in Boston
</label>
<input
id="address-input"
type="text"
role="combobox"
aria-expanded={suggestions.length > 0}
aria-controls="address-listbox"
aria-autocomplete="list"
aria-activedescendant={activeIndex >= 0 ? `address-option-${activeIndex}` : undefined}
className={styles.textInput}
value={query}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={handleKeyDown}
placeholder="e.g. 1 City Hall Square"
autoComplete="off"
/>
<p role="status" aria-live="polite" className="visually-hidden">
{loading
? "Searching…"
: suggestions.length
? `${suggestions.length} suggestions available`
: ""}
</p>
{error && <p className={styles.errorText}>{error}</p>}
{suggestions.length > 0 && (
<ul id="address-listbox" role="listbox" className={styles.suggestionList}>
{suggestions.map((s, i) => (
<li
key={s.id}
id={`address-option-${i}`}
role="option"
aria-selected={i === activeIndex}
className={i === activeIndex ? styles.suggestionActive : styles.suggestion}
onMouseDown={() => selectSuggestion(s)}
>
{s.placeName}
</li>
))}
</ul>
)}
</section>
{/* Outside the card on purpose -- see MapPinStep.tsx for why. */}
<div className={styles.floatingActionsSpacer} aria-hidden="true" />
<div className={styles.floatingActions}>
<button className={styles.linkButton} onClick={onBack}>
Choose a different method
</button>
</div>
</section>
</>
);
}
Loading
Loading