Repository navigation
[Measurement run – do not merge] STORY-142: Save for later + private Reading list (frontend, Fusion) - #84
[Measurement run – do not merge] STORY-142: Save for later + private Reading list (frontend, Fusion)#84devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Article.bookmarked + ArticlesService bookmark/unbookmark/queryBookmarked - Amber Save/Saved toggle next to Favorite on the article page (anonymous -> /login) - Own-profile Reading list tab guarded against other usernames, with unsave/pagination/empty state - Profile tabs react to username param changes; dark article banner per design - Add zone.js devDependency so existing specs resolve it Co-Authored-By: Pedro Tabio <paltat@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Real-backend STORY-142 verification passed with signed-in users and SQLite persistence; independent API checks: 24 passed. Supplementary UI pagination/backfill checks also passed. Default external avatars were unavailable. CI remains red on six existing profile-settings failures; identical failures reproduced on clean main (details and run link in the description). Not exercised in UI: network-failure/concurrent-mutation scenarios or other browsers. |
…t or switches account Co-Authored-By: Pedro Tabio <paltat@gmail.com>
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| <span class="counter">({{ a.favoritesCount }})</span> | ||
| </app-favorite-button> | ||
|
|
||
| <app-bookmark-button [article]="a" (toggle)="onToggleBookmark($event)" /> |
There was a problem hiding this comment.
🟡 Authors cannot save their own articles
For an article's author, canModify() hides both Save buttons behind the reader-only branch. Authors cannot add their own articles to their reading list.
Learn more
Both article action rows render the Save button only when canModify() is false. That signal is true when the signed-in user's username matches the article author's username in ngOnInit. The author branch renders only edit and delete controls, so an author viewing their own article cannot invoke the new bookmark endpoint.
Example: Ana opens an article she published. She sees Edit and Delete in the banner and lower action row, but no Save button; she cannot add the article to her reading list.
Recommended fix: Render app-bookmark-button outside the canModify() alternatives in both action rows, preserving the author-only edit/delete controls and the reader-only follow/favorite controls.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Confirmed: the button sits in the reader branch next to Favorite, so authors don't see it on their own articles. This follows the story brief ("Show Save for anonymous… and readers") and matches how Favorite works. I've asked the coordinator whether authors should get it too. If so, the fix is to move <app-bookmark-button> out of the canModify() branch in both action rows.
Story: STORY-142 (coordinated from parent session https://devin-gtm.devinenterprise.com/sessions/1ab6e443eb49449d9482f7c1a6d9e583). Backend PR for this run: COG-GTM/spring-boot-realworld-example-app#1203 (also a separate measurement rerun, draft). E2E evidence and screenshots will also be added by the coordinator.
Summary
Adds a private Save for later toggle and an own-profile Reading list tab. Built against the shared contract:
(All require auth. There is no public count.)
Article.bookmarked: boolean(required). NewArticlesService.bookmark / unbookmark / queryBookmarked(limit, offset).BookmarkButtonComponent(app-bookmark-button) shows an amber outlined "🔖 Save" or a filled "🔖 Saved". It sits next to Favorite in both the banner and the bottom action rows on the article page, for readers and anonymous users. UnlikeFavoriteButtonComponent, which readsisAuthenticated(false while auth isloading), it waits forauthState !== 'loading'and takes one value. Then:unauthenticatednavigates to/login, as does a 401 from the API.unavailableand other errors show an inlinerole="alert"message and keep the previous state.aria-busyis set.profile/:username/reading-listusesreadingListGuard, which waits for auth init so a persisted session isn't bounced on reload. Anonymous users go to/login; any other username goes to/profile/:username. It also setsrunGuardsAndResolvers: 'always', so the guard runs again when Angular reuses the route for a different username.ProfileReadingListComponentkeeps the API order and pages 10 at a time.articlesCount, which updates the pager. If items remain beyond the current page, it refetches in the background to fill the gap. If the page becomes empty, it goes back one page.Nothing saved yet. Use 🔖 Save on any article.authState/currentUser. If the viewer logs out (or a 401 purges the session) or the current account changes while the list is open, it clears the results and goes to/loginor the new user's profile.ProfileComponentnow readsroute.paramMap(it used to readsnapshot). The articles and favorites tabs do the same. Without this, going from/profile/anato/profile/ericon a reused route kept the old profile and itsisUserflag, which could leave the Reading list tab visible on someone else's profile.#333). The theme's banner is white.zone.js, butpackage.jsondid not list it, so all 6 spec files failed to resolve it onmain. This PR addszone.js ~0.16.0as a devDependency. Thebun.lockchange is limited to that one line; the lockfile's stale@angular/coreentry is left alone.api.interceptor.tsis not modified.Validation (shell)
bun run test -- --run: 10 files, 210 passed.mainhad 180 tests, all blocked by the zone.js import. The 30 new tests cover:bun run build: succeeds with no warnings.npx tsc -p tsconfig.app.json --noEmit: clean.bun run format:check: clean.Not covered here: running the app against the real backend. The coordinator handles that.
Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/bb2f2df700d749dc9ba3497b2efb0838
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/bb2f2df700d749dc9ba3497b2efb0838?variant=devin
Devin Review