Commit 2f8b4ed
Phase 7.3b: Migrate Assignment/Book Info Components to Plain CSS (#3060)
* Migrate AssignedTopBar component from styled-components to plain CSS
- Replaced styled-components with plain CSS using CSS variables
- Created AssignedTopBar.css with responsive breakpoints
- Converted StyledTopBarWrapper to use TopBarWrapper with className
- Converted StyledSectionTitle to plain h2 element with className
- Used CSS variables for dynamic theme values (colors, heights)
- Followed migration patterns from PLAIN_CSS_MIGRATION_LEARNINGS.md
- All component logic remains unchanged
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Migrate BuyBook component from styled-components to plain CSS
This commit migrates the BuyBook component following the simplified
plain CSS migration approach documented in PLAIN_CSS_MIGRATION_LEARNINGS.md.
Changes:
- Created BuyBook.css with plain CSS styles
- Updated BuyBook.tsx to use className instead of styled-components
- Used CSS variables for dynamic values (max-width and color)
- Applied disablePrintClass for print hiding behavior
- Followed established patterns from other migrated components
The component maintains identical functionality and styling while removing
the styled-components dependency.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Migrate Attribution component from styled-components to plain CSS
- Convert class component to functional component with hooks
- Replace connect() HOC with useSelector hook
- Create Attribution.css with all component styles
- Use CSS variables for dynamic values (theme colors, widths)
- Replace styled Summary/Details with plain HTML elements
- Implement htmlMessage pattern inline (Content and CodeRunnerNote components)
- Maintain all existing functionality:
- Auto-scroll on toggle
- Close on page navigation
- Special attribution for python books
- Support for special book IDs
- Export named Attribution component for testing
- Use classNames package for className composition
- Follow patterns from PLAIN_CSS_MIGRATION_LEARNINGS.md
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Migrate Assigned.tsx from styled-components to plain CSS
- Replace styled-components imports with classNames
- Convert StyledButton, ToastOverride, and PlatformWrapper to plain React components
- Create Assigned.css with corresponding styles
- Use CSS variables for dynamic values (contentTextWidth, topbarDesktopHeight, assignedMobileTop)
- Convert theme.breakpoints.mobile() to @media query with correct breakpoint (75em)
- Maintain all existing functionality and component behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Assorted fixups
Combine summary style entries
Minor lint stuff
Lint
mobileToolbarOpen is not in props
Co-Authored-By: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Fix Attribution test failure by using useLayoutEffect for page changes
The test 'closes attribution on navigation' was failing because it expected
the 'open' attribute to be removed synchronously when the page changes.
When converting from class component to functional component, the page change
detection logic was using useEffect, which runs asynchronously after the
browser has painted. The original class component used componentDidUpdate,
which runs synchronously during the commit phase.
Changed the page change effect from useEffect to useLayoutEffect to match
the original synchronous behavior of componentDidUpdate. This ensures the
'open' attribute is removed immediately when the page changes, making the
test pass.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Copilot suggestions
Address Copilot review feedback on AssignedTopBar and Attribution
**AssignedTopBar.tsx:**
- Conditionally render the <h2> heading only when section?.title exists
- Prevents empty headings which are an accessibility issue for screen readers
- While section should always be defined in practice (as Roy noted), this
handles edge cases during initial render and follows best practices
**Attribution.tsx:**
- Revert useEffect dependency array back to [] (empty)
- The toggle event listener doesn't depend on `page` and should only
run on mount/unmount
- Re-running this effect on every page change is unnecessary and wasteful
- The page change logic is already handled in the separate useLayoutEffect
These changes address Copilot's accessibility concern while maintaining
the correct React hook behavior.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fix AssignedTopBar to handle undefined section during loading
The AssignedTopBar component was expecting section to always be defined,
but sections[currentSectionIndex] can be undefined while the book and
assigned sections are still loading.
Changes:
- Made section prop optional: LinkedArchiveTreeSection | undefined
- Added early return (null) when section is not yet available
- This allows the Page component to render its loader during loading state
- Fixes the test "renders loading state without book"
This addresses both Copilot's concern about empty headings and Roy's
observation that the test was failing. The component now properly handles
the loading state by returning null instead of rendering an empty h2.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
props.section is always defined
Co-Authored-By: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Moved undefined check for section up to Assigned
Co-Authored-By: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Specificity fix - noticed Kinetic banner had wrong spacing
Co-Authored-By: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Roy Johnson <roy.e.johnson@rice.edu>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: staxly[bot] <35789409+staxly[bot]@users.noreply.github.com>1 parent 3a18860 commit 2f8b4ed
13 files changed
Lines changed: 1092 additions & 7895 deletions
File tree
- src/app/content
- __snapshots__
- components
- __snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
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 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
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 | 38 | | |
190 | | - | |
| 39 | + | |
191 | 40 | | |
192 | 41 | | |
193 | 42 | | |
194 | 43 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | 44 | | |
253 | | - | |
| 45 | + | |
| 46 | + | |
254 | 47 | | |
255 | 48 | | |
256 | 49 | | |
| |||
291 | 84 | | |
292 | 85 | | |
293 | 86 | | |
294 | | - | |
| 87 | + | |
295 | 88 | | |
296 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
297 | 94 | | |
298 | 95 | | |
299 | 96 | | |
| |||
302 | 99 | | |
303 | 100 | | |
304 | 101 | | |
305 | | - | |
| 102 | + | |
306 | 103 | | |
307 | 104 | | |
308 | 105 | | |
309 | 106 | | |
310 | 107 | | |
311 | 108 | | |
312 | 109 | | |
313 | | - | |
| 110 | + | |
314 | 111 | | |
315 | 112 | | |
316 | 113 | | |
317 | 114 | | |
318 | 115 | | |
319 | 116 | | |
320 | | - | |
| 117 | + | |
321 | 118 | | |
322 | 119 | | |
323 | 120 | | |
| |||
344 | 141 | | |
345 | 142 | | |
346 | 143 | | |
347 | | - | |
| 144 | + | |
348 | 145 | | |
349 | 146 | | |
| 147 | + | |
350 | 148 | | |
351 | 149 | | |
352 | 150 | | |
353 | 151 | | |
354 | 152 | | |
| 153 | + | |
355 | 154 | | |
356 | 155 | | |
357 | 156 | | |
| |||
398 | 197 | | |
399 | 198 | | |
400 | 199 | | |
401 | | - | |
| 200 | + | |
402 | 201 | | |
403 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
404 | 211 | | |
405 | 212 | | |
406 | 213 | | |
407 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
408 | 222 | | |
409 | 223 | | |
410 | 224 | | |
411 | | - | |
| 225 | + | |
412 | 226 | | |
413 | 227 | | |
414 | 228 | | |
| |||
418 | 232 | | |
419 | 233 | | |
420 | 234 | | |
421 | | - | |
| 235 | + | |
422 | 236 | | |
423 | 237 | | |
424 | 238 | | |
| |||
434 | 248 | | |
435 | 249 | | |
436 | 250 | | |
437 | | - | |
| 251 | + | |
438 | 252 | | |
439 | 253 | | |
440 | 254 | | |
| |||
504 | 318 | | |
505 | 319 | | |
506 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
507 | 326 | | |
508 | 327 | | |
509 | 328 | | |
| |||
0 commit comments