Optimize assignment loading and add native draft sharing - #33
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (17)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
PR preview updateExpo Go: Open this update Development build: Open this update |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d4f52b247
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!details?.canEditSubmission) | ||
| throw new Error("This assignment is not accepting uploads right now."); |
There was a problem hiding this comment.
Revalidate before rejecting an assignment
When a cached assignment entry is less than 30 minutes old, fetchAssignmentDetails() returns without making a request. If that entry was fetched before the assignment opened and has canEditSubmission: false, this check rejects the selection before the forced edit-session request on the next line can verify its current state. The share flow therefore remains unusable for the newly opened assignment until the cache expires or is refreshed elsewhere; force-refresh the details here or let the forced edit request be the source of truth.
Useful? React with 👍 / 👎.
| import { | ||
| getAssignmentViewUrl, | ||
| getSharedAssignmentTargets, | ||
| type SharedAssignmentTarget, |
There was a problem hiding this comment.
Move the shared target type into the central type module
SharedAssignmentTarget is imported directly from a utility module instead of being defined under src/types and re-exported through @/types. Move the interface to the assignment type module and import it from the central index to preserve the repository's required type boundary.
AGENTS.md reference: AGENTS.md:L215-L215
Useful? React with 👍 / 👎.
Assignment details now render after the view-page request while submission options load separately through a deduplicated edit-session request. This removes repeated session probes and edit-page fetches. The header shows the assignment title once, batch upload progress stays within 0–100%, and Open LMS always opens the assignment view page.
Native image/PDF sharing opens a deadline-ordered assignment picker. Selecting an assignment uploads files to a temporary Moodle draft; a separate Submit button saves that same draft and preserves existing online text. Pending shares survive login, and interrupted uploads can be cancelled.
The native share module requires a new build. Runtime
1.4.1-share-intent-v1isolates it from existing1.4.1OTA clients; package version remains unchanged. Build and device verification notes are indocs/native-assignment-sharing.md.Validation:
backgroundImagetyping error in the unchanged web gradient component.