Repository navigation
Conversation
Adds a Builders and projects section to the public community page. The API builds the community path from the node and its parents, reads nearbuilders.org /v1/builders and /v1/projects with ?cityNode=, keeps only items tagged with that path, and reports nearbuilders.org as unavailable instead of failing. The base URL is the nearbuildersUrl API variable (default https://nearbuilders.org). Closes #451
Multi Review ·
|
Return no path when a community's ancestor chain doesn't reach a root, keep only https project logos, count totals from raw tags, share one in-flight request per path, prune stale cache entries after an hour, and read the join link from the API base URL.
Use Effect.fn for communityPath, derive the result type from the contract schema, validate nearbuildersUrl in the config schema instead of falling back silently, and tidy names and imports in the section.
…ilders # Conflicts: # api/src/index.ts # bos.app.ts
…ilders # Conflicts: # api/src/discovery-contract.ts
…ilders # Conflicts: # api/src/index.ts # ui/src/routes/_public/n/-node-page.test.tsx
…ilders # Conflicts: # ui/src/routes/_public/n/-node-page.test.tsx
…ilders # Conflicts: # ui/src/routes/_public/n/$slug.tsx
|
@multi-review full |
|
@elliotBraem approved by @itexpert120, ok to merge when you get a chance |
Closes #451, part of NEARBuilders/nearbuilders.org#285
Adds a "Builders and projects" section to the public community page (
/n/$slug), read from nearbuilders.org.illinois/chicago, orillinoisfor a top-level one) and reads/v1/builders?cityNode=and/v1/projects?cityNode=server-side (new publicgetCommunityBuilders).cityNodematches the path are kept. Production nearbuilders.org ignores the param today and returns everything, so this keeps the section on the empty state until feat: tag builders and projects with their citynode.app community nearbuilders.org#301 ships.nearbuildersUrlAPI variable, default https://nearbuilders.org.No changeset: main no longer has a
.changesetfolder.Tested
pnpm run typecheck,pnpm run lint,pnpm run testpass. New API integration tests (nested path, top-level path with the filter ignored, nearbuilders down, unknown node) and UI tests (list + links, empty state, down state), all with made-up data.Locally in the browser, with a stub of the two nearbuilders endpoints serving made-up builders/projects and three made-up communities in the dev DB: nested community list, empty state, nearbuilders-down state, signed out at desktop and 375px, and signed in. No console errors from this change.
Against live nearbuilders.org (no stub): the API returns
okwith no items in ~1s, and the page shows the empty state, signed out, no console errors.Review follow-ups: outage backoff (30s), shared in-flight request, stale fallback up to an hour, https-only logos, and no path when a community's parent chain is broken. All have unit tests.
Not tested
Screenshots