feat(web): add WEEK route and update SelectView to utilize it#1442
feat(web): add WEEK route and update SelectView to utilize it#1442tyler-dane merged 7 commits intomainfrom
Conversation
- Introduced a new WEEK route in the routing constants for better navigation. - Updated SelectView component to default to WEEK route instead of ROOT. - Modified tests to reflect changes in routing behavior, ensuring correct rendering and navigation for the WEEK view. - Implemented loadRootData function to redirect from ROOT to DAY route, enhancing user experience. - Added tests for loadRootData to verify redirection functionality.
There was a problem hiding this comment.
Pull request overview
Adds an explicit /week route for the Week (calendar) view and updates navigation/tests to prefer it, while making / a redirect entrypoint.
Changes:
- Introduced
ROOT_ROUTES.WEEK = "/week"and moved the Calendar view route from/to/week. - Updated view selection + keyboard shortcut navigation to use
/week(and adjusted related tests). - Added a root loader (
loadRootData) so/redirects into the Day flow, plus tests for this redirect.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/web/src/views/Onboarding/hooks/useStepDetection.ts | Removes special-casing for / route normalization in step route detection. |
| packages/web/src/views/Onboarding/hooks/useGuideOverlayState.test.ts | Updates onboarding guide view detection test to treat /week as the week view. |
| packages/web/src/views/Onboarding/constants/onboarding.constants.ts | Replaces hard-coded route strings with ROOT_ROUTES.* and switches week view route to /week. |
| packages/web/src/views/Day/components/DayCmdPalette.test.tsx | Updates expectation for “Go to Week” navigation to /week. |
| packages/web/src/views/Calendar/hooks/useRefetch.test.ts | Updates “week view” test path assumptions from / to /week. |
| packages/web/src/views/Calendar/hooks/shortcuts/useGlobalShortcuts.ts | Changes the 3 shortcut navigation target from / to /week. |
| packages/web/src/views/Calendar/hooks/shortcuts/useGlobalShortcuts.test.ts | Updates shortcut test to expect navigation to /week. |
| packages/web/src/routers/loaders.ts | Adds loadRootData loader to redirect / to the Day route. |
| packages/web/src/routers/loaders.test.ts | Adds unit test coverage for loadRootData redirect behavior. |
| packages/web/src/routers/index.tsx | Routes Calendar view at /week and adds a loader-only / route for redirect. |
| packages/web/src/components/SelectView/SelectView.tsx | Updates Week option route to /week (and treats /week as Week view). |
| packages/web/src/components/SelectView/SelectView.test.tsx | Updates SelectView tests/default route assumptions to /week. |
| packages/web/src/common/constants/routes.ts | Adds WEEK: "/week" to routing constants. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Changed the webpackChunkName from "home" to "week" for the Calendar import in the WEEK route, improving clarity and organization in code splitting.
- Modified test setup to navigate to the WEEK route instead of the root path, ensuring tests reflect the current routing behavior. - Updated utility functions to wait for the correct URL after switching to the WEEK view, enhancing test reliability.
- Enhanced the loadRootData test to verify redirection to the DAY route with today's date appended, improving accuracy in routing behavior. - Imported loadTodayData to retrieve the current date for the test, ensuring the test reflects the expected output.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on March 3
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Closes #1441
Note
Medium Risk
Touches core client routing and default entry behavior (
/now redirects), so any missed references to the old Week route could cause navigation regressions despite broad test updates.Overview
Introduces
ROOT_ROUTES.WEEK(/week) and updates Week-view navigation to use it (notablySelectViewroute detection/options and the global3shortcut).Changes routing so the calendar view is served from
/week, while/now has a loader (loadRootData) that redirects to today’s Day route; adds unit coverage for this redirect. Updates onboarding route configs and multiple unit/e2e tests/utilities to start on and assert against/weekinstead of/.Written by Cursor Bugbot for commit 56a9589. This will update automatically on new commits. Configure here.