Repository navigation
Conversation
lyrenius
marked this pull request as draft
November 23, 2026 08:46
robertying
requested changes
Nov 23, 2026
robertying
left a comment
Owner
There was a problem hiding this comment.
Thanks for this! Grouping by the teacher's categories is a good fit for the Files tab. The grouping helper is pure and well tested, keying categories by id so a rename keeps a section collapsed is a nice touch, and adding collapsedFileCategories needs no store version bump since mergeUserData fills in missing keys.
I ran it on an iPhone and an Android phone with the mock account. The design needs another pass before this goes in:
Design
- Remember the view choice. By Time / By Category is component state, so every course opens on By Time again, while the collapsed sections (which only exist in By Category) are saved. Please save the choice too, either once for the app or per course next to the collapsed sections.
- Avoid a second segmented control. The new control sits right under Notices / Assignments / Files, looks almost the same, and scrolls away with the list. A view menu in the header (
ToggleMenu, as Search uses for its options) would keep the screen lighter. - Match the app's other section headings. Search's section headers are a good reference:
- Line the heading up with the file titles under it. It starts further left now, on both platforms.
- Use the same text style and color as other section headings (primary on Android).
- Give it
accessibilityRole="header"as well, so screen readers can jump between categories. - Show how many files a section holds, at least when it's collapsed.
- Don't repeat the category on each card in By Category. The heading already says it.
- Category order. Sorting by each category's latest upload moves a section to the top whenever a file is added to it. Web Learning's
FileCategoryhas acreationTime; ordering by it would match the website and keep sections where students expect them. What was the intent here?
Tests
The helper, the store and the screen's main paths are covered. Please add:
- Tests for the Android and Electron versions in
src/screens/__tests__/androidandsrc/screens/__tests__/web. They render their own segmented control and the new chevron icons. - A category with two or more files in the screen test, so it checks that files in a section still have dividers between them and the last one before the next heading doesn't.
- Pull to refresh in By Category, and the file list changing while a section is collapsed (a new upload, or a file moving to another category).
- A test that the view choice is still set after the course is reopened, once it's saved.
- Mock data: give a few mock courses' files categories, including one course with both categorized and uncategorized files, so the view can be tried with the mock login and a Maestro step can cover it (
.maestro/04-tabs.yamlalready opens a mock course).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1801
Add a By Category option to the course Files tab so students can find related files using the categories teachers set in Web Learning. By Time is the default.
Categories appear as vertical sections, with Uncategorized last. Every section starts expanded, and selecting its heading toggles it independently. The app remembers which sections are collapsed for each course on the device and
restores them after relaunch.
Testing