Fix recurring mobile file-list scrolling (#370)#615
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesResponsive file scrolling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/angular/src/app/pages/files/file-list.component.html`:
- Around line 25-61: Extract the duplicated app-file row markup and its bindings
into a shared ng-template, then render that template from both the native `@for`
branch and the cdkVirtualFor branch using NgTemplateOutlet. Add NgTemplateOutlet
to the component imports and pass each branch’s file and isEven values so both
paths preserve their current behavior and use the same row definition.
In `@src/angular/src/app/pages/files/file-list.component.spec.ts`:
- Around line 178-201: Extend the FileListComponent tests to mock
window.matchMedia with a fake MediaQueryList, verify the constructor uses the
expected query and registers the change listener, dispatch a change event to
confirm useNativeScrolling updates, and destroy the fixture to assert the same
listener is removed via ngOnDestroy. Keep the existing direct-signal rendering
assertions unchanged.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 18f801d6-0242-4d31-bd31-9d00c678d209
📒 Files selected for processing (4)
src/angular/src/app/pages/files/file-list.component.htmlsrc/angular/src/app/pages/files/file-list.component.scsssrc/angular/src/app/pages/files/file-list.component.spec.tssrc/angular/src/app/pages/files/file-list.component.ts
Summary
Root cause
The CDK viewport was configured with a fixed 82px item size, but mobile rows are not fixed-height: they wrap and can expand for details and actions. The resulting offset drift causes rows to be skipped during scrolling. Angular/CDK patch updates address a separate scroll-anchoring regression but cannot correct this layout mismatch.
Addresses the recurrence reported in #370.
Validation
npx ng test --watch=false --include=src/app/pages/files/file-list.component.spec.ts(39 passed)npx ng lintnpx ng buildThe full local suite reached 562/569 tests under Node 26; the remaining seven failures are the existing
localStoragetest-environment incompatibility and are unrelated to this change.Summary by CodeRabbit
New Features
Bug Fixes