Feature/cases back#273
Conversation
- Remove internal scroll from cs_info-secondary to allow whole page scrolling - Change fixed heights to auto for cs_full-details and cs_info containers - Add top: 0 to image to keep it fixed at top of card - Add margin-top to cs_info to position primary/secondary content lower - Add .DS_Store to gitignore for macOS
…se study - Add scrollMemory.js to persist /cases scroll position in sessionStorage - Update Barba enter callback to restore scroll on /cases return, handling full page reload - Add filter state persistence in search-handler.js via sessionStorage - Save filters on card click, restore on /cases load when returning from case study - Fix Barba transition blink by always removing old container before reload
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR adds scroll position persistence for the case-studies listing page, saving the scroll offset before leaving via Barba transitions and restoring it on re-entry or full page reload, coordinating with existing filter-anchor scroll logic. A new Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Convert consecutive line comments to block comments in scrollMemory.js - Capitalize comment first letters - Use object destructuring for pathname - Replace ternary with if/else - Add error logging to catch blocks - Convert negated condition to positive in index.js - Extract initFilterModal, initFontChanger, initImageLozad to separate modules - Reduce index.js from 344 to 298 lines to meet max-lines rule
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@website/public/js/modules/case-studies-page/search-handler.js`:
- Around line 28-36: `getFilterStateSnapshot` is hardcoding filter keys instead
of staying in sync with `restoreFilterState`, so new entries in `filterState`
can be lost on save/restore. Update the snapshot logic in `search-handler.js` to
build the filter object dynamically from `filterState` keys, just like
`restoreFilterState` iterates them. Keep `search` as the separate text field,
and ensure any new filter set added to `filterState` is automatically included
without manual listing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: f6c3ee60-77a2-4ef0-bc89-fbc53c2e4054
📒 Files selected for processing (5)
.gitignorewebsite/modules/asset/ui/src/index.jswebsite/modules/asset/ui/src/scrollMemory.jswebsite/modules/asset/ui/src/scss/_cases.scsswebsite/public/js/modules/case-studies-page/search-handler.js
| function getFilterStateSnapshot() { | ||
| return { | ||
| industry: Array.from(filterState.industry), | ||
| stack: Array.from(filterState.stack), | ||
| caseStudyType: Array.from(filterState.caseStudyType), | ||
| partner: Array.from(filterState.partner), | ||
| search: searchTerm || '' | ||
| }; | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
getFilterStateSnapshot hardcodes filter types, diverging from restoreFilterState.
restoreFilterState iterates Object.keys(filterState) to rebuild state, but getFilterStateSnapshot manually lists industry, stack, caseStudyType, partner. If a new filter type is added to the filterState object, it will be cleared on restore (saved snapshot lacks the key → Array.isArray(undefined) → []) but never persisted, silently dropping the user's selection.
♻️ Proposed refactor — build snapshot dynamically
function getFilterStateSnapshot() {
- return {
- industry: Array.from(filterState.industry),
- stack: Array.from(filterState.stack),
- caseStudyType: Array.from(filterState.caseStudyType),
- partner: Array.from(filterState.partner),
- search: searchTerm || ''
- };
+ const snapshot = {};
+ Object.keys(filterState).forEach(function (filterType) {
+ snapshot[filterType] = Array.from(filterState[filterType]);
+ });
+ snapshot.search = searchTerm || '';
+ return snapshot;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| function getFilterStateSnapshot() { | |
| return { | |
| industry: Array.from(filterState.industry), | |
| stack: Array.from(filterState.stack), | |
| caseStudyType: Array.from(filterState.caseStudyType), | |
| partner: Array.from(filterState.partner), | |
| search: searchTerm || '' | |
| }; | |
| } | |
| function getFilterStateSnapshot() { | |
| const snapshot = {}; | |
| Object.keys(filterState).forEach(function (filterType) { | |
| snapshot[filterType] = Array.from(filterState[filterType]); | |
| }); | |
| snapshot.search = searchTerm || ''; | |
| return snapshot; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@website/public/js/modules/case-studies-page/search-handler.js` around lines
28 - 36, `getFilterStateSnapshot` is hardcoding filter keys instead of staying
in sync with `restoreFilterState`, so new entries in `filterState` can be lost
on save/restore. Update the snapshot logic in `search-handler.js` to build the
filter object dynamically from `filterState` keys, just like
`restoreFilterState` iterates them. Keep `search` as the separate text field,
and ensure any new filter set added to `filterState` is automatically included
without manual listing.
- Remove unused initFilterModal import from index.js - Remove extra blank line - Fix block comment formatting with proper * prefixes - Convert function declarations to function expressions in extracted modules - Fix block comment formatting in scrollMemory.js
2.Scroll position reset when returning to the list. After going from a case back to the case studies list, the user gets thrown to the top of the page, to the hero section. We need to preserve the scroll position so the user returns to where they left off.
Updated case studies to behave like a normal scrolling page and preserve user position when navigating back. The case detail layout now uses auto-sized sections without internal overflow, so full Objective/Challenge/Solution/Results/Tech Stack content is visible. The
/caseslist now saves and restores scroll and filter/search state via sessionStorage, and.DS_Storeis ignored.