Skip to content

Commit b35dbc5

Browse files
Merge pull request #247 from CodeForPhilly/fix/home-browse-projects
fix(web): "Browse all N projects" under Join a Project
2 parents f46f8be + 6bcefe7 commit b35dbc5

4 files changed

Lines changed: 57 additions & 2 deletions

File tree

‎apps/web/src/screens/Home.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export function Home() {
152152
)}
153153
<div className="mt-6 text-right">
154154
<Link to="/projects" className="text-primary hover:underline">
155-
See all {totalProjects ?? ''} projects →
155+
{totalProjects === null ? 'Browse all projects →' : `Browse all ${totalProjects} projects →`}
156156
</Link>
157157
</div>
158158
</section>

‎apps/web/tests/Home.test.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ describe('Home', () => {
5757
});
5858
});
5959

60+
it('links to the full project list with its count', async () => {
61+
renderScreen(
62+
<AuthProvider>
63+
<Home />
64+
</AuthProvider>,
65+
);
66+
67+
expect(await screen.findByRole('link', { name: 'Browse all 42 projects →' })).toHaveAttribute('href', '/projects');
68+
});
69+
6070
it('shows the get-involved cards', async () => {
6171
renderScreen(
6272
<AuthProvider>

‎plans/home-browse-projects.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
status: done
3+
depends: [home-page-alive]
4+
specs:
5+
- specs/screens/home.md
6+
issues: []
7+
pr: 247
8+
---
9+
10+
# Plan: "Browse all N projects" on the home page
11+
12+
## Scope
13+
14+
Chris: "See all 274 projects →" under Join a Project should say "browse"
15+
or "search". The link opens the searchable, filterable project list.
16+
17+
**In:** "Browse all N projects →", falling back to "Browse all projects →"
18+
until the count loads (it rendered a double space before). **Out:** other
19+
"See all" links (events, activity), which open plain lists.
20+
21+
## Implements
22+
23+
- [screens/home.md](../specs/screens/home.md) — Featured projects.
24+
25+
## Approach
26+
27+
One string in `Home.tsx`; a test on the link's text and target.
28+
29+
## Validation
30+
31+
- [x] `npm run type-check && npm run lint && npm test` clean.
32+
- [x] Home test: "Browse all 42 projects →" links to `/projects`.
33+
34+
## Risks / unknowns
35+
36+
- None.
37+
38+
## Notes
39+
40+
- "Browse" over "Search": the page leads with the list and its filters;
41+
search is one of several ways in.
42+
43+
## Follow-ups
44+
45+
- **None.**

‎specs/screens/home.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ When there are no upcoming events the strip is **hidden entirely** (unlike the f
5656
- Title
5757
- Tagline = `project.summary`, or first line of `overviewExcerpt` if `summary` is null
5858
- Click: links to `/projects/<slug>`
59-
- Below the grid: "See all 268 projects →" link to `/projects`. The count is `metadata.totalItems` from a separate cheap `HEAD`-style call (or piggybacked from the featured response — implementer's call).
59+
- Below the grid: "Browse all 268 projects →" link to `/projects`, where the list can be searched and filtered ("Browse all projects →" until the count loads). The count is `metadata.totalItems` from a separate cheap `HEAD`-style call (or piggybacked from the featured response — implementer's call).
6060

6161

6262
### 3. Get involved

0 commit comments

Comments
 (0)