Commit c095383
feat(web): remove reminder from day and week views (#1402)
* refactor(web): enhance Header and MemoryRouter components for improved reminder handling
- Updated `Header` component to conditionally render the `Reminder` based on the `showReminder` prop, allowing for more flexible UI rendering.
- Refactored `useReminderHotkey` to accept an `enabled` parameter, enabling or disabling the hotkey functionality based on the reminder state.
- Modified `MemoryRouter` utility to accept `initialEntries` for better routing control in tests.
- Removed the `Edit Reminder` option from the command palette and related tests to streamline the user interface and focus on essential functionalities.
* refactor(tests): remove redundant reminder tests from Calendar.form.test.tsx
- Deleted tests related to reminder functionality in the Calendar form, including keyboard shortcuts and command palette interactions, to streamline the test suite and focus on essential features.
- Removed unused import from DayCmdPalette.tsx to clean up the codebase.
* refactor(Calendar): simplify SidebarDraftProvider props
- Removed the `measurements` prop from `SidebarDraftProvider` in `CalendarView`, streamlining its usage.
- Updated the `SidebarDraftProvider` component to reflect the removal of the `measurements` prop, enhancing clarity and reducing complexity.
* refactor(tests): enhance custom render function in mock.render.tsx
- Updated the `customRender` function to include a `CustomWrapper` option, allowing for more flexible component wrapping during tests.
- Simplified the wrapper logic by creating a new `Wrapper` component that conditionally includes `CustomWrapper` or defaults to `BaseProviders`, improving test setup clarity.
* refactor(tests): update mock event data and enhance test state structure
- Removed local date utility from event mocks to standardize date handling.
- Updated `EUROPE_TRIP` event dates to fixed values for consistency in tests.
- Introduced a new `timer.baktest.ts` file with comprehensive tests for the Timer class, covering initialization, error handling, and event emissions.
- Enhanced `state.weekEvents` mock to reflect accurate event counts and success states, improving test reliability.
- Refactored `store.test.util.ts` to simplify state type definitions, ensuring better compatibility with mock data.
* refactor(tests): streamline mock state and enhance type definitions
- Removed unused event states from `state.weekEvents` mock to simplify the structure.
- Updated `store.test.util.ts` to improve type definitions for test state, ensuring better compatibility with mock data.
- Added `importGCal` state to `sync` in `preloadedState` for improved testing scenarios.
- Enhanced type safety in `Sidebar.render.test.tsx` by specifying types for `dateCalcs` and `measurements` props.
* Update packages/web/src/views/Day/view/DayViewContent.tsx
Co-authored-by: Copilot <[email protected]>
* refactor(tests): clean up DayCmdPalette test imports and mocks
- Removed unused imports and streamlined mock setup in `DayCmdPalette.test.tsx` to enhance test clarity and maintainability.
- Simplified the test structure by eliminating unnecessary dependencies, improving overall test performance.
* refactor(Header): improve reminder focus handling with useCallback
- Updated the `Header` component to utilize `useCallback` for the reminder focus handler, enhancing performance by memoizing the function.
- Simplified the hotkey functionality to conditionally focus the reminder based on the `showReminder` prop, improving code clarity and maintainability.
---------
Co-authored-by: Copilot <[email protected]>1 parent 7419f4c commit c095383
File tree
21 files changed
+169
-192
lines changed- packages
- core/src
- __mocks__/v1/events
- util
- web/src
- __tests__
- __mocks__
- state
- utils
- providers
- state
- views
- Calendar
- components
- Draft/sidebar/context
- Header
- Sidebar
- hooks/shortcuts
- CmdPalette
- Day
- components
- Header
- view
- Now/view
21 files changed
+169
-192
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 36 | | |
47 | 37 | | |
48 | 38 | | |
| |||
51 | 41 | | |
52 | 42 | | |
53 | 43 | | |
54 | | - | |
55 | | - | |
| 44 | + | |
| 45 | + | |
56 | 46 | | |
57 | 47 | | |
58 | 48 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
93 | 105 | | |
94 | 106 | | |
95 | 107 | | |
96 | | - | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
| |||
Lines changed: 28 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
61 | 73 | | |
62 | 74 | | |
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
66 | 81 | | |
67 | 82 | | |
68 | 83 | | |
69 | 84 | | |
70 | 85 | | |
71 | 86 | | |
72 | 87 | | |
73 | | - | |
74 | | - | |
| 88 | + | |
| 89 | + | |
75 | 90 | | |
76 | 91 | | |
77 | 92 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
Lines changed: 5 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 87 | | |
114 | 88 | | |
115 | 89 | | |
| |||
140 | 114 | | |
141 | 115 | | |
142 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
143 | 120 | | |
144 | 121 | | |
145 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | 145 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 68 | + | |
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | 17 | | |
21 | 18 | | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
Lines changed: 1 addition & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| |||
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
| |||
76 | 70 | | |
77 | 71 | | |
78 | 72 | | |
79 | | - | |
80 | 73 | | |
81 | 74 | | |
82 | 75 | | |
| |||
0 commit comments