Skip to content

Simplify wallet, speed optimization#737

Merged
feruzm merged 6 commits intodevelopfrom
pagespeed
Apr 3, 2026
Merged

Simplify wallet, speed optimization#737
feruzm merged 6 commits intodevelopfrom
pagespeed

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Apr 3, 2026

Summary by CodeRabbit

  • New Features

    • "Collect All" button to claim rewards and points
    • Pending earnings display with potential earnings breakdown
    • UTC date formatter for consistent timestamps
    • Image upload with signature support
  • Accessibility

    • Added descriptive aria labels to navigation and UI controls
    • Profile links and discussion controls improved for screen readers
  • Performance

    • Deferred error-reporting init and added preconnect to improve load
  • Improvements

    • Expandable wallet details toggle; layout and style tweaks
  • Tests & Docs

    • Added component tests and testing/instructions documentation

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7a50f123-9c51-40e0-a338-ce150eff679a

📥 Commits

Reviewing files that changed from the base of the PR and between eea7c3b and 23d798a.

📒 Files selected for processing (5)
  • .claude/skills/add-test/instructions.md
  • CLAUDE.md
  • apps/web/src/specs/features/entry/entry-page-discussions-wrapper.spec.tsx
  • apps/web/src/specs/features/shared/time-label.spec.tsx
  • apps/web/src/specs/features/wallet/profile-wallet-pending-earnings.spec.tsx
✅ Files skipped from review due to trivial changes (3)
  • CLAUDE.md
  • apps/web/src/specs/features/wallet/profile-wallet-pending-earnings.spec.tsx
  • .claude/skills/add-test/instructions.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/src/specs/features/shared/time-label.spec.tsx
  • apps/web/src/specs/features/entry/entry-page-discussions-wrapper.spec.tsx

📝 Walkthrough

Walkthrough

Deferred Sentry client initialization with early error buffering; added wallet UI pieces (pending earnings, collect-all button, summary detail toggle) and tests; accessibility and time-label formatting updates; CSS moved for market drag/placeholder; added UTC date formatter; changed upload image endpoints and added signed upload helper; minor layout head/script adjustments; new i18n keys.

Changes

Cohort / File(s) Summary
Sentry client config
apps/web/sentry.client.config.ts
Replace immediate Sentry.init with SENTRY_CONFIG constant and deferred browser init: install temporary window handlers to buffer early errors, initialize via requestIdleCallback/setTimeout, remove handlers, call Sentry.init, set tag, and flush buffered errors.
Profile wallet UI & tests
apps/web/src/app/(dynamicPages)/profile/[username]/wallet/_components/profile-wallet-collect-all-button.tsx, .../profile-wallet-pending-earnings.tsx, .../profile-wallet-summary.tsx, apps/web/src/app/(dynamicPages)/profile/[username]/wallet/page.tsx, apps/web/src/specs/features/wallet/profile-wallet-pending-earnings.spec.tsx
Add ProfileWalletCollectAllButton and ProfileWalletPendingEarnings, persistable show/hide details in summary, reorder page rendering, and add tests for pending earnings and collectable UI.
Entry discussions wrapper & tests
apps/web/src/app/(dynamicPages)/entry/.../entry-page-discussions-wrapper.tsx, apps/web/src/specs/features/entry/entry-page-discussions-wrapper.spec.tsx
Add "reveal comments" flow for anonymous users (show button when entry.children > 0), switch to SortOrder.created, pass activeUsername correctly, and add tests for anonymous vs authenticated behavior.
TimeLabel and date utils + tests
apps/web/src/features/shared/time-label/index.tsx, apps/web/src/utils/parse-date.ts, apps/web/src/specs/features/shared/time-label.spec.tsx
Split relative/local formatted display in TimeLabel, add dateToFormattedUtc util, and add tests validating SSR-safe fallback and mount-time updates.
SDK upload changes
packages/sdk/src/modules/private-api/requests.ts
Introduce UPLOAD_HOST, switch uploadImage to fixed host, and add uploadImageWithSignature(file, username, signature) helper endpoint.
Accessibility & small UI tweaks
apps/web/src/features/shared/discussion/index.tsx, .../entry-menu/index.tsx, .../navbar/navbar-mobile.tsx, .../profile-link/index.tsx, .../entry-payout/entry-payout-detail.tsx
Add aria-labels to multiple controls, reorder payout-date block, add opacity-60 to breakdown text, and minor UI/text adjustments.
Layout head/script changes
apps/web/src/app/layout.tsx
Change /scripts/config-stub.js to async, remove a cross-origin preload image used for LCP, and add preconnect for Sentry ingest host.
Styles moved / adjusted
apps/web/src/app/market/index.scss, apps/web/src/styles/_animations.scss, apps/web/src/styles/_base.scss
Move drag/placeholder styles from _base.scss to market-specific SCSS (add cursor-drag rules), remove many rotation keyframes from _animations.scss.
i18n
apps/web/src/features/i18n/locales/en-US.json
Add wallet and reveal-comments message keys (collect-all, collect-all-ok, show-details, hide-details, claimable-label, potential-label, potential-hint, discussion.reveal-comments).
Tests & docs
apps/web/src/specs/..., .claude/skills/add-test/instructions.md, CLAUDE.md
Add multiple component/unit tests and test-writing guidance; update global mock guidance and test instructions documentation.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as ProfileWalletCollectAllButton
  participant Rewards as RewardsService
  participant Points as PointsService
  participant QC as QueryClient
  participant Notif as NotificationService

  User->>UI: Click "Collect all"
  UI->>UI: verify isOwnProfile\nset isCollecting = true
  UI->>Rewards: claimRewards() (if rewards available)
  Rewards-->>UI: success / error
  UI->>Points: claimPoints() (if points available)
  Points-->>UI: success / error
  UI->>Notif: accumulate success messages
  UI->>QC: invalidate account/points/wallet queries
  UI->>Notif: show success toast (if any)
  UI->>UI: set isCollecting = false
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Fix wallet actions #611 — touches wallet UI and data-fetch layers overlapping the new wallet components and layout changes.
  • Move private api to sdk #606 — edits the private-api requests.ts upload endpoints and helpers similar to the SDK upload changes here.
  • Engine/SPK to SDK #608 — related wallet/SDK surface and auth/signing changes that may interact with wallet claim flows and SDK usage.

Suggested labels

patch

Poem

🐰
I hopped through code at break of dawn,
Buffered errors until Sentry was drawn.
I gathered rewards and tiny points too—
"Collect all!" I cheered, "for me and you!"
Nose twitch, tail flick — deploy, we're through!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and overly broad, using non-specific terms like 'Simplify wallet' and 'speed optimization' that don't clearly convey the primary changes made across 20+ files. Consider a more specific title that highlights the main change, such as 'Defer Sentry initialization and add wallet collection UI components' or 'Add wallet pending earnings UI and defer Sentry init'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pagespeed
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch pagespeed

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.

coderabbitai[bot]

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm merged commit 10b0eac into develop Apr 3, 2026
1 check passed
@feruzm feruzm deleted the pagespeed branch April 3, 2026 13:06
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