Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
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
9 changes: 9 additions & 0 deletions docs/responsive-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Responsive layout

The Angular UI was checked in headless Chrome, signed in as `agent`, at 360, 414, 768, 1024, 1280, 1440, and 1920 CSS pixels, plus phone landscape (740×360 and 896×414), tablet portrait and landscape, and a 640px-wide viewport standing in for 200% browser zoom on a 1280px laptop. Colors, type, copy, routes, and `data-testid` values are unchanged.

Shared tokens live in `frontend/src/styles.css`: `--page-gutter`, `--card-padding`, `--tap-min` (2.75rem), and `--content-max` (62.5rem). Media queries repeat three widths because they cannot read variables: 40rem (640px), 48rem (768px), and 64rem (1024px). Below 40rem the page gutter and card padding shrink. Below 64rem, nav links, profile links, and table actions are at least 44px tall. Buttons and fields are at least 44px at every width.

The header keeps “Northstar CRM” on one line and lets the nav wrap under it on a phone. Home choice cards use `repeat(auto-fit, minmax(min(100%, 17rem), 1fr))`, so a phone shows one column, a 768px tablet shows two, and a laptop shows the original three. Customer lookup keeps the table from 640px up. Below that, each row is a stacked card with the same Profile and Edit links. The create form shows the public-ID sentence in a wrapping field instead of a single-line input that was clipping it. Interaction headings and timeline rows wrap instead of overlapping around 640px, and rows stack below 768px. Login’s show/hide control is a 44px target. The viewport meta tag was already `width=device-width, initial-scale=1`.

Still not ideal: above 1024px the nav stays the original compact text so a projector view matches the old header. At 768px the third home card sits alone on the next row, and the interaction timeline stacks each field rather than keeping one tight row. A 360px header wraps Log out onto its own line. Wide screens stay centered (1000px, 900px, and 440px) instead of stretching to 1920px. Screenshots are in `frontend/responsive-screenshots/` and are gitignored.
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ testem.log
# System files
.DS_Store
Thumbs.db

# Local responsive audit screenshots (before/after). Not part of the app.
/responsive-screenshots
43 changes: 38 additions & 5 deletions frontend/src/app/app.component.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
header {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 1rem max(1.25rem, calc((100% - 1100px) / 2));
gap: 0.75rem 1.25rem;
padding: 0.75rem max(var(--page-gutter), calc((100% - 1100px) / 2));
border-bottom: 1px solid #dce3ec;
background: #fff;
}

.brand {
flex: 0 0 auto;
color: #142b49;
font-size: 1.15rem;
font-weight: 700;
white-space: nowrap;
text-decoration: none;
}

header nav,
header nav ul {
display: flex;
align-items: center;
flex: 1 1 28rem;
flex-wrap: wrap;
gap: 1rem;
align-items: center;
justify-content: flex-end;
gap: 0.25rem 1rem;
min-width: min(100%, 18rem);
}

header nav ul {
Expand Down Expand Up @@ -60,8 +66,12 @@ header nav a {
text-decoration: none;
}

header nav span {
overflow-wrap: anywhere;
}

main {
padding: 0 1.25rem;
padding-inline: var(--page-gutter);
}

button {
Expand All @@ -78,3 +88,26 @@ button {
button:hover {
background: #f3f6fa;
}

@media (max-width: 64rem) {
header {
align-items: flex-start;
}

.brand,
header nav a {
display: inline-flex;
align-items: center;
min-height: var(--tap-min);
}

header nav a {
padding-inline: 0.2rem;
}
}

@media (max-width: 40rem) {
header nav {
justify-content: flex-start;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ import { CustomerStatus } from './customer.model';
} @else {
<form class="customer-form" (ngSubmit)="save()">
<label for="public-id">Public ID</label>
<input
id="public-id"
name="publicId"
[value]="customerId || 'Assigned automatically when created'"
readonly
aria-describedby="public-id-help"
/>
<p id="public-id" class="readonly-value" aria-describedby="public-id-help">
{{ customerId || 'Assigned automatically when created' }}
</p>
<span id="public-id-help" class="field-help">
This ID is assigned by the system and cannot be changed.
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ <h1 tabindex="-1">Look up a customer</h1>
<p class="empty-state" data-testid="empty-state">No customers match this search and status.</p>
} @else {
<div class="table-wrap">
<table>
<table role="table">
<caption class="visually-hidden">Customers</caption>
<thead>
<tr>
<th scope="col">Customer ID</th>
<th scope="col">Customer name</th>
<th scope="col">Status</th>
<th scope="col">Actions</th>
<thead role="rowgroup">
<tr role="row">
<th scope="col" role="columnheader">Customer ID</th>
<th scope="col" role="columnheader">Customer name</th>
<th scope="col" role="columnheader">Status</th>
<th scope="col" role="columnheader">Actions</th>
</tr>
</thead>
<tbody>
<tbody role="rowgroup">
@for (customer of visibleCustomers(); track customer.customerId) {
<tr data-testid="customer-row">
<td><code>{{ customer.customerId }}</code></td>
<td>{{ customer.fullName }}</td>
<td><span class="status" [class]="'status status-' + customer.status.toLowerCase()">{{ customer.status }}</span></td>
<td class="customer-actions">
<tr role="row" data-testid="customer-row">
<td role="cell" data-label="Customer ID"><code>{{ customer.customerId }}</code></td>
<td role="cell" data-label="Customer name">{{ customer.fullName }}</td>
<td role="cell" data-label="Status"><span class="status" [class]="'status status-' + customer.status.toLowerCase()">{{ customer.status }}</span></td>
<td role="cell" class="customer-actions" data-label="Actions">
<a class="table-action" [routerLink]="['/customers', customer.customerId]" data-testid="customer-profile">Profile<span class="visually-hidden"> for {{ customer.fullName }}</span></a>
<a class="table-action" [routerLink]="['/customers', customer.customerId, 'edit']" data-testid="customer-edit">Edit<span class="visually-hidden"> {{ customer.fullName }}</span></a>
</td>
Expand Down
42 changes: 12 additions & 30 deletions frontend/src/app/features/customers/customer-pages.component.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
:host {
display: block;
max-width: 1000px;
max-width: var(--content-max);
margin: 2rem auto;
padding: 0 1.25rem;
padding-inline: var(--page-gutter);
}

.page-card {
padding: 2rem;
padding: var(--card-padding);
border: 1px solid #dce3ec;
border-radius: 16px;
background: #fff;
Expand Down Expand Up @@ -42,13 +42,14 @@ h1 {

.choice-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
gap: 1rem;
margin-top: 2rem;
}

.choice-card {
display: flex;
min-width: 0;
min-height: 220px;
flex-direction: column;
padding: 1.25rem;
Expand Down Expand Up @@ -96,11 +97,17 @@ h1 {
.page-heading,
.filters {
display: flex;
flex-wrap: wrap;
align-items: end;
justify-content: space-between;
gap: 1rem;
}

.page-heading > div {
flex: 1 1 16rem;
min-width: 0;
}

.page-heading {
margin-bottom: 1.5rem;
}
Expand Down Expand Up @@ -128,7 +135,7 @@ h1 {
}

select {
min-width: 180px;
min-width: min(100%, 11.25rem);
padding: 0.65rem 0.75rem;
border: 1px solid #667c96;
border-radius: 8px;
Expand Down Expand Up @@ -317,28 +324,3 @@ button:disabled {
background: #e6f5ed;
color: #17653b;
}
@media (max-width: 720px) {
.choice-grid {
grid-template-columns: 1fr;
}

.choice-card {
min-height: auto;
}
}

@media (max-width: 520px) {
.page-card {
padding: 1.25rem;
}

.page-heading,
.filters {
align-items: stretch;
flex-direction: column;
}

select {
width: 100%;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
:host {
display: block;
max-width: 900px;
max-width: 56.25rem;
margin: 2rem auto;
padding: 0 1.25rem;
padding-inline: var(--page-gutter);
}

.interactions {
padding: 2rem;
padding: var(--card-padding);
border: 1px solid #dce3ec;
border-radius: 16px;
background: #fff;
Expand All @@ -17,9 +17,17 @@
.activity-heading,
.entry-controls {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 1rem;
gap: 0.75rem 1rem;
}

.page-heading > div,
.customer {
flex: 1 1 18rem;
min-width: 0;
max-width: 100%;
}

.page-heading {
Expand Down Expand Up @@ -52,6 +60,7 @@ h1 {
time {
color: #536987;
font-size: 0.875rem;
overflow-wrap: anywhere;
}

code {
Expand Down Expand Up @@ -85,6 +94,7 @@ code {
input {
width: 100%;
min-width: 0;
flex: 1 1 14rem;
padding: 0.75rem 0.85rem;
border: 1px solid var(--control-border, #667c96);
border-radius: 8px;
Expand Down Expand Up @@ -130,6 +140,7 @@ button:hover {
grid-template-columns: 6rem minmax(0, 1fr) auto auto;
align-items: center;
gap: 1rem;
min-width: 0;
padding: 0.9rem 1rem;
border: 1px solid #e5eaf0;
border-radius: 10px;
Expand Down Expand Up @@ -170,7 +181,7 @@ button:hover {

.interaction-facts {
display: grid;
grid-template-columns: minmax(120px, 0.35fr) 1fr;
grid-template-columns: minmax(7.5rem, 0.35fr) minmax(0, 1fr);
gap: 0.7rem 1rem;
margin: 1.5rem 0;
}
Expand Down Expand Up @@ -209,7 +220,9 @@ button:hover {
}

.summary {
min-width: 0;
color: #253b57;
overflow-wrap: anywhere;
}

.empty-state {
Expand All @@ -230,7 +243,9 @@ button:hover {

.page-actions {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 0.75rem;
margin-top: 1.5rem;
}

Expand All @@ -249,20 +264,26 @@ button:hover {
background: #f3f6fa;
}

@media (max-width: 600px) {
.interactions {
padding: 1.25rem;
@media (max-width: 48rem) {
.activity-list li {
grid-template-columns: 1fr;
gap: 0.35rem;
}
}

@media (max-width: 40rem) {
.page-heading,
.entry-controls {
align-items: stretch;
flex-direction: column;
}

.activity-list li {
grid-template-columns: 1fr;
gap: 0.35rem;
.page-heading > div,
.customer,
.entry-controls input,
.entry-controls button {
flex: 0 1 auto;
width: 100%;
}
}

Expand Down
Loading
Loading