|
| 1 | +--- |
| 2 | +status: in-progress |
| 3 | +depends: [chat-redirect] |
| 4 | +specs: |
| 5 | + - specs/screens/chat.md |
| 6 | +issues: [230] |
| 7 | +--- |
| 8 | + |
| 9 | +# Plan: In-app links to /chat navigate to the server |
| 10 | + |
| 11 | +## Scope |
| 12 | + |
| 13 | +Clicking "Slack" in the footer (and every other in-app link to `/chat`) |
| 14 | +shows the SPA's 404 page, because the links are React Router `<Link>`s and |
| 15 | +`/chat` is a server-side redirect the client router has no route for. A |
| 16 | +new tab or a refresh works, which is why it went unnoticed. |
| 17 | + |
| 18 | +**In:** the five `/chat` links (footer, Volunteer, events empty state, |
| 19 | +project "Chat Channel" button, project card "Chat") become plain anchors; |
| 20 | +a lint rule rejects router links whose literal target starts with `/chat`, |
| 21 | +`/api/` or `/calendar`. |
| 22 | + |
| 23 | +**Out:** the visible Slack entry point in the header (#231). |
| 24 | + |
| 25 | +## Implements |
| 26 | + |
| 27 | +- [screens/chat.md](../specs/screens/chat.md#linking-to-it-from-the-app) |
| 28 | + |
| 29 | +## Approach |
| 30 | + |
| 31 | +1. `<Link to="/chat…">` → `<a href="/chat…">`, keeping classes and the |
| 32 | + `Button asChild` wrappers. |
| 33 | +2. `no-restricted-syntax` in `eslint.config.js` for `apps/web`: a |
| 34 | + `to` attribute whose string literal, or template literal's first |
| 35 | + chunk, starts with one of the server prefixes. |
| 36 | + |
| 37 | +## Validation |
| 38 | + |
| 39 | +- [ ] `npm run type-check && npm run lint && npm test` clean. |
| 40 | +- [ ] The rule flags the five links before the fix (checked by running |
| 41 | + lint against the unfixed tree). |
| 42 | +- [ ] In the built app, clicking footer "Slack" leaves the SPA for the |
| 43 | + Slack SSO start URL instead of rendering the 404 page. |
| 44 | + |
| 45 | +## Risks / unknowns |
| 46 | + |
| 47 | +- The lint rule only sees literal targets; a computed `to={someVar}` |
| 48 | + slips past. Acceptable: every current server link is a literal. |
| 49 | + |
| 50 | +## Notes |
| 51 | + |
| 52 | +## Follow-ups |
0 commit comments