Skip to content

fix(endorsements): sidebar endorse updates counter and Received tab - #110

Merged
holkexyz merged 2 commits into
feat/positioning-redesignfrom
fix/endorsement-received-overlay
May 29, 2026
Merged

fix(endorsements): sidebar endorse updates counter and Received tab#110
holkexyz merged 2 commits into
feat/positioning-redesignfrom
fix/endorsement-received-overlay

Conversation

@holkexyz

Copy link
Copy Markdown
Member

Summary

  • The sidebar Endorse button only refetched the viewer's given endorsements, so the button flipped to "Endorsed" but the profile's "Endorsed by N" counter and the Endorsements tab's Received list (both backed by the 5-min received-endorsements scan cache) lagged until the indexer caught up.
  • Added a shared optimistic overlay to useReceivedEndorsements (module store + useSyncExternalStore, mirroring endorsement-closure-cache) and wired the sidebar button to push add/remove into it on write success, so every consumer of the subject's received list reflects the change immediately.
  • Removed the now-redundant tab-local overlay and the dead EndorseShortcut (never rendered since the toggle moved to the sidebar).

Test plan

  • On a foreign profile, click Endorse in the left sidebar → "Endorsed by N" counter increments immediately and the new endorsement appears on the Endorsements tab Received list without a reload.
  • Revoke from the sidebar → counter decrements and the entry disappears from the Received list immediately.
  • After the 5-min cache / indexer catch-up, no double-counting (overlay de-dups by award URI).
  • npx tsc --noEmit clean; npm run lint shows no new warnings.

🤖 Generated with Claude Code

The sidebar Endorse button only refetched the viewer's *given*
endorsements, so the button flipped to "Endorsed" but the profile's
"Endorsed by N" counter and the Endorsements tab Received list (both
backed by the 5-min received-endorsements scan cache) lagged until the
indexer caught up.

Add a shared optimistic overlay to useReceivedEndorsements (module
store + useSyncExternalStore, mirroring endorsement-closure-cache) and
have the sidebar button push add/remove into it on write success, so
every consumer of the subject's received list reflects the change
immediately. Removes the now-redundant tab-local overlay and the dead
EndorseShortcut (never rendered since the toggle moved to the sidebar).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
certified-app Ready Ready Preview, Comment May 29, 2026 9:45am

Request Review

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c87bcee-c7e6-46d9-9fd4-a7d64186afeb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/endorsement-received-overlay

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 and usage tips.

Resolves PR #110 conflicts against the merged overnight-review work
(PR #111). PR #110 and overnight-review's quality-005 independently
removed the same dead received-overlay + EndorseShortcut; the conflicts
were reconciled to keep BOTH intents:

- profile-endorsements.tsx: kept the base (extracted PersonCard via
  quality-012, useClickOutsideClose, stable comparators); PR #110's
  overlay removal was already satisfied. Re-added PR #110's accurate
  'overlay now lives in the hook' comment.
- use-received-endorsements.ts: auto-merged — PR #110's shared optimistic
  overlay (module store + useSyncExternalStore) AND quality-032's
  focus-revalidation AbortController both retained.
- profile-sidebar.tsx + endorse-reason-confirm.ts: kept quality-048's
  testable orchestrator and threaded PR #110's optimistic push through a
  new optional onAwardCreated callback (fires the instant the award
  lands), so the sidebar still updates the counter + Received tab
  immediately. Added two unit tests for the new callback path.

Gate: vitest 476 passing, tsc 0 errors, lint 0 errors / 67 warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@holkexyz
holkexyz marked this pull request as ready for review May 29, 2026 09:48

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@holkexyz
holkexyz merged commit e70c9fb into feat/positioning-redesign May 29, 2026
2 of 3 checks passed
@holkexyz
holkexyz deleted the fix/endorsement-received-overlay branch May 29, 2026 09:51
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