Skip to content

Conversation

@tamaskozmer
Copy link
Contributor

Test Plan

Folder Bookmarking

  1. Log in to Student app
  2. Navigate to a course's Files
  3. In the root folder, verify the bookmark option is available
  4. Navigate into a subfolder
  5. Verify the bookmark option is NOT available (disabled for non-root folders)

Quiz Routing

  1. Navigate to a course
  2. Open the quiz list
  3. Select a new quiz (LTI quiz)
  4. Verify it routes to Assignment Details correctly

refs: MBL-19568
affects: Student

Release Note

Fixed folder bookmarking to prevent issues with embedded links in non-root folders

  • I have tested this code in Light Mode
  • I have tested this code in Dark Mode
  • I have tested this code on a phone
  • I have tested this code on a tablet
  • I have run all affected unit tests

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

- Disable bookmarking for non-root folders to prevent routing issues with embedded links
- Add route for new quizzes opened from quiz list to Assignment Details

Test Plan:
- Verify bookmarking is only available in root folder
- Verify new quizzes route to Assignment Details correctly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@tamaskozmer tamaskozmer closed this Dec 4, 2025
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Thank you for this PR! I've reviewed the changes related to bookmarking behavior and quiz routing. Here's my assessment:

Changes Overview

  1. FileListFragment.kt: Modified bookmark logic to only enable bookmarking when in a course/group AND at the root folder
  2. RouteMatcher.kt: Added a new route for assignments to support new quizzes navigation from the quiz list

Issues Found

  • FileListFragment.kt:603 - Null safety consideration: Verify the intended behavior when folder is null. Currently folder?.isRoot == true will return false when folder is null, disabling bookmarks. Confirm this is the desired behavior and consider adding a clarifying comment.

  • RouteMatcher.kt:408 - Duplicate route pattern detected: The same URL pattern courseOrGroup("/:COURSE_ID/assignments/:ASSIGNMENT_ID") is registered twice with different previous fragments. This may cause routing ambiguity depending on how the router handles duplicates. Please verify this won't cause navigation issues and consider whether consolidation is needed.

Positive Feedback

  • The code changes are concise and focused
  • Good inline comment explaining the purpose of the new route for new quizzes
  • The bookmark logic change appears to be a targeted fix for a specific use case

Recommendations

  1. Add unit tests for the modified bookmark logic with various folder states (null, root, non-root)
  2. Verify the router's behavior with duplicate route patterns through testing
  3. Consider adding a code comment in FileListFragment explaining why only root folders should be bookmarkable

Test Coverage

Please ensure there are tests covering:

  • Bookmark availability with null folder
  • Bookmark availability with root folder
  • Bookmark availability with non-root folder
  • Navigation from quiz list to assignment details using the new route

Let me know if you have any questions about this feedback!


override val bookmark: Bookmarker
get() = Bookmarker(canvasContext.isCourseOrGroup, canvasContext)
get() = Bookmarker(canvasContext.isCourseOrGroup && folder?.isRoot == true, canvasContext)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential NPE concern: The expression folder?.isRoot == true uses safe navigation, but consider what happens if folder is null. When folder is null, folder?.isRoot evaluates to null, and null == true evaluates to false. This means the bookmark will not be enabled for null folders.

Is this the intended behavior? If folder being null should also disable bookmarking, this is correct. However, if there are scenarios where folder could be null but bookmarking should still be allowed (e.g., at the root level before folder is initialized), this might cause issues.

Consider adding a comment explaining the expected behavior when folder is null.

QuizListFragment::class.java,
AssignmentDetailsFragment::class.java
)
) // Route for new quizzes opened from the quiz list. New quizzes are shown on the Assignment details. This is needed for the bookmarker to find the correct route.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate route pattern: This new route uses the same URL pattern as the route added just above it (lines 401-405):

  • Line 402: courseOrGroup("/:${RouterParams.COURSE_ID}/assignments/:${RouterParams.ASSIGNMENT_ID}")
  • Line 408: courseOrGroup("/:${RouterParams.COURSE_ID}/assignments/:${RouterParams.ASSIGNMENT_ID}")

Both routes point to AssignmentDetailsFragment::class.java as the target fragment, but have different previous fragments (QuizListFragment vs the default).

Questions:

  1. How does the router handle duplicate patterns? Does it use the first match or the last match?
  2. Will this cause any issues with route matching or navigation?
  3. Should these be consolidated into a single route with conditional logic, or is the duplicate intentional for handling different navigation contexts?

The comment explains the intent, but the implementation might cause routing ambiguity.

@tamaskozmer tamaskozmer deleted the tamas/MBL-19568-fix-folder-routing branch December 4, 2025 14:32
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

📊 Code Coverage Report

⚠️ Student

  • PR Coverage: 42.76%
  • Master Coverage: 42.77%
  • Delta: -0.01%

✅ Teacher

  • PR Coverage: 25.45%
  • Master Coverage: 25.45%
  • Delta: +0.00%

✅ Pandautils

  • PR Coverage: 22.56%
  • Master Coverage: 22.56%
  • Delta: +0.00%

📈 Overall Average

  • PR Coverage: 30.26%
  • Master Coverage: 30.26%
  • Delta: -0.00%

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1226 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 449 total, 0 failed, 0 skipped
  • Duration: 29.754s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 2418 total, 0 failed, 0 skipped
  • Duration: 48.372s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 4093
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Thu, 04 Dec 2025 14:47:57 GMT

@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Student Install Page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants