Skip to content

Optimize assignment loading and add native draft sharing - #33

Merged
Noelithub77 merged 1 commit into
mainfrom
fix/assignment-loading-native-sharing
Oct 1, 2026
Merged

Noelithub77 merged 1 commit into
mainfrom
fix/assignment-loading-native-sharing

Conversation

@Noelithub77

Copy link
Copy Markdown
Owner

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-v1 isolates it from existing 1.4.1 OTA clients; package version remains unchanged. Build and device verification notes are in docs/native-assignment-sharing.md.

Validation:

  • All 32 unit tests passed, including draft-only upload, explicit submission, request deduplication, progress bounds, and deadline ordering.
  • Lint and diff checks passed.
  • Android prebuild, native configuration introspection, and Android/web bundle exports passed.
  • Full TypeScript checking reports an existing backgroundImage typing error in the unchanged web gradient component.
  • Native device and real-LMS verification remains pending.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 93dcccc4-44eb-4ad1-bcc8-2eca926a4cf8

📥 Commits

Reviewing files that changed from the base of the PR and between 7f814bc and 7d4f52b.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • app.config.ts
  • docs/native-assignment-sharing.md
  • package.json
  • src/app/+native-intent.tsx
  • src/app/_layout.tsx
  • src/app/course/[courseid]/assignment/[assignmentid].tsx
  • src/app/share-assignment.tsx
  • src/hooks/use-assignment-share-intent.ts
  • src/services/assignment.ts
  • src/stores/assignment-share-store.ts
  • src/stores/assignment-store.ts
  • src/stores/auth-store.ts
  • src/types/assignment.ts
  • src/utils/assignment-share.ts
  • src/utils/upload-progress.ts
  • tests/unit/services/assignment.test.ts
  • tests/unit/utils/assignment-share.test.ts
 _______________________________
< Yippee-ki-yay, mother-bugger! >
 -------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Noelithub77
Noelithub77 merged commit d33faae into main Oct 1, 2026
2 of 5 checks passed
@Noelithub77
Noelithub77 deleted the fix/assignment-loading-native-sharing branch October 1, 2026 08:44
@expo

expo Bot commented Oct 1, 2026

Copy link
Copy Markdown

PR preview update

Expo Go: Open this update

Expo Go QR code

Development build: Open this update

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +114 to +115
if (!details?.canEditSubmission)
throw new Error("This assignment is not accepting uploads right now.");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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.

1 participant