Skip to content

Conversation

@rohitpaulk
Copy link
Member

@rohitpaulk rohitpaulk commented Nov 1, 2025

Add explicit TypeScript types for the submissions route model and service
injections to enhance type safety and code clarity. Update the model method
to use typed parameters and cast return values for submissions and languages.
Add route model type declaration to the controller to align with route output.
These changes reduce type errors and improve maintainability for course admin
submissions filtering and querying logic.


Note

Adds grayed-out tab states based on submission data, wires submission selection via a new handler, and strengthens TypeScript/Glint typings across submissions route, controller, and components.

  • UI
    • Tabs: Support isGrayedOut in Tabs/TabHeader; apply opacity-25 class when tab.isGrayedOut (app/components/tabs.ts, app/components/tabs.hbs).
    • Submission Details: Mark Diff tab gray when !submission.hasChangedFiles and Code Example tab when no communitySolution (app/components/course-admin/submissions-page/submission-details-container.ts).
    • Submissions Page: Use @onSubmissionSelect={{this.handleSubmissionSelect}} and implement handleSubmissionSelect to set selectedSubmission (app/components/course-admin/submissions-page/index.hbs, index.ts).
  • Type Safety
    • Add Signature interfaces, typed service injections, and nullable state with safer fallbacks in SubmissionsPage component; add Glint registry entries (app/components/course-admin/submissions-page/index.ts).
    • Define CourseAdminSubmissionsRouteModel, type route params/filters, and cast store results; type services (app/routes/course-admin/submissions.ts).
    • Declare controller model type and compute filtered lists from typed slugs (app/controllers/course-admin/submissions.ts).

Written by Cursor Bugbot for commit 33f75d2. This will update automatically on new commits. Configure here.

Add explicit TypeScript types for the submissions route model and service injections to enhance type safety and code clarity. Update the model method to use typed parameters and cast return values for submissions and languages. Add route model type declaration to the controller to align with route output. These changes reduce type errors and improve maintainability for course admin submissions filtering and querying logic.
@github-actions
Copy link

github-actions bot commented Nov 1, 2025

Test Results

674 tests  ±0   623 ✅ ±0   9m 11s ⏱️ -7s
  1 suites ±0    51 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 33f75d2. ± Comparison against base commit 1a617f1.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../components/course-admin/submissions-page/index.ts 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov
Copy link

codecov bot commented Nov 1, 2025

Bundle Report

Changes will increase total bundle size by 2.12kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
client-array-push 38.71MB 2.12kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/chunk.*.js 408 bytes 182.82kB 0.22%
assets/chunk.*.js 1.58kB 3.29MB 0.05%
assets/chunk.*.js 82 bytes 40.73kB 0.2%
assets/chunk.*.js 53 bytes 95.15kB 0.06%

Files in assets/chunk.*.js:

  • ./routes/course-admin/submissions.ts → Total Size: 2.74kB

  • ./controllers/course-admin/submissions.ts → Total Size: 807 bytes

Refactor submissions page component to improve type safety by adding explicit TypeScript typings and interfaces. Initialize tracked properties more defensively to avoid null issues. Replace deprecated Ember service injection syntax with modern declaration style. Add new action handler for submission selection to better manage UI state. Update template to use this action instead of mut helper for clearer data flow. Extend tabs component and submissions page submission details with an isGrayedOut flag to indicate disabled tabs based on submission state, improving UX clarity. Overall, these changes improve code maintainability, type safety, and user interaction on the course admin submissions page.
@rohitpaulk rohitpaulk merged commit 144b2e3 into main Nov 1, 2025
7 of 8 checks passed
@rohitpaulk rohitpaulk deleted the feat-add-typescript-annotations branch November 1, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants