Skip to content

refactor: Inject isArchivedByLearner into initial API response#40

Merged
kdmccormick merged 2 commits into
mainfrom
kdmccormick/filter-for-archive
May 14, 2026
Merged

refactor: Inject isArchivedByLearner into initial API response#40
kdmccormick merged 2 commits into
mainfrom
kdmccormick/filter-for-archive

Conversation

@kdmccormick
Copy link
Copy Markdown
Member

@kdmccormick kdmccormick commented May 13, 2026

refactor: Inject isArchivedByLearner into initial API response

This both:

  • demonstrates filter pipeline steps in a practical way which relates to the sample archive functionality.
  • removes the need to call GET ..../course-archive-status/ in order to render the page.

The GET API still exists, as it's called to update the state after a learner clicks Archive/Unarchive (could probably be factored away, but not important)

This removes the old sample filter pipeline step, which changed the course about URL into an example.com URL.

Note: the isArchived key was already taken by the existing "course archival" feature which is an author-controlled thing.

Finally, this commit also updates the uv.lock file, which I missed in #35

Testing

Notice:

  • No course-archive-status GET call
  • isArchivedByLearner is in the API response
Screenshot 2026-05-13 at 2 06 03 PM

AI

I wrote the filter body. Claude wrote the frontend code, with this prompt:

do you see how frontend-plugin-sample replaces the course cards with ones that are archivable, powered by a new model and REST API defined in backend-plugin-sample? it works, but it adds an extra GET call to the course-archive-status API every time the learner dashboard is loaded.

what i recently added (in just the last commit) is a filter pipeline step to put isArchivedByLearner into the initial learner home (a.k.a. learner dashboard) API response. could you update frontend-plugin-sample to use that boolean rather than calling the course-archive-status GET API separately?

you may want to need to look at the learner dashboard source, at ../frontend-app-learner-dashboard. ask questions eagerly

Claude also wrote the tests and docstrings with my guidance, I reviewed everything.

@kdmccormick kdmccormick requested a review from feanil May 13, 2026 18:10
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.17%. Comparing base (913f1b1) to head (b6ab2a9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
+ Coverage   88.40%   92.17%   +3.76%     
==========================================
  Files          14       15       +1     
  Lines         414      447      +33     
  Branches       16       16              
==========================================
+ Hits          366      412      +46     
+ Misses         40       26      -14     
- Partials        8        9       +1     
Flag Coverage Δ
unittests 92.17% <ø> (+3.76%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kdmccormick kdmccormick force-pushed the kdmccormick/filter-for-archive branch 2 times, most recently from 456097f to 4276199 Compare May 13, 2026 20:00
This both:
* demonstrates filter pipeline steps in a practical way which relates to
  the sample archive functionality.
* removes the need to call GET ..../course-archive-status/ in order to
  render the page.

The GET API still exists, as it's called to update the state after a learner
clicks Archive/Unarchive (could probably be factored away, but not important)

This removes the old sample filter pipeline step, which changed the course about
URL into an example.com URL.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@kdmccormick kdmccormick force-pushed the kdmccormick/filter-for-archive branch from 4276199 to b6ab2a9 Compare May 13, 2026 20:15
@kdmccormick kdmccormick merged commit e9b5159 into main May 14, 2026
9 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/filter-for-archive branch May 14, 2026 15:36
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