Skip to content

🐛 app: misc fixes#1014

Open
dieguezguille wants to merge 2 commits into
mainfrom
fixes
Open

🐛 app: misc fixes#1014
dieguezguille wants to merge 2 commits into
mainfrom
fixes

Conversation

@dieguezguille
Copy link
Copy Markdown
Member

@dieguezguille dieguezguille commented May 13, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved spotlight target measurement for more stable and accurate positioning.
    • SIWE authentication now respects wallet connection state when determining the owner.
  • Improvements

    • Authentication error handling distinguishes a “wallet busy” condition and surfaces a focused toast message.
    • App layout now conditionally shows authentication flow when appropriate, improving sign-in UX.

Review Change Stack

@dieguezguille dieguezguille self-assigned this May 13, 2026
@dieguezguille dieguezguille added the bug Something isn't working label May 13, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: b14a5be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/mobile Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: eaf94722-6724-4287-95e4-78b1d1c27ef3

📥 Commits

Reviewing files that changed from the base of the PR and between 34f5bc3 and b14a5be.

📒 Files selected for processing (6)
  • .changeset/odd-seas-ring.md
  • src/app/(main)/_layout.tsx
  • src/components/home/InstallmentsSpotlight.tsx
  • src/utils/reportError.ts
  • src/utils/server.ts
  • src/utils/useAuth.ts

Walkthrough

Spotlight target measurement now requires consecutive-stable geometry before finalizing and defers scroll adjustment; a changeset records the patch. Separately, AppLayout and server SIWE logic are adjusted for connection-aware owner derivation, error classification adds walletBusy/walletDisconnected, and useAuth short-circuits on wallet-busy errors.

Changes

Spotlight Target Measurement Fix

Layer / File(s) Summary
Target measurement polling improvement with release annotation
src/components/home/InstallmentsSpotlight.tsx, .changeset/odd-seas-ring.md
Polling interval tightened to 120ms and attempts increased to 40; measurement finalizes only after consecutive identical x, y, width, height; scroll-to-adjust is gated behind scrolled. Changeset documents the patch.

Auth & Error Classification

Layer / File(s) Summary
AppLayout: auth gating and wallet connection
src/app/(main)/_layout.tsx
Adds React Query lookups for method and credential, uses ownerConfig connection state, and conditionally returns Auth when method === "siwe", credential exists, and wallet is not connected while ownerConfig.state.current is null.
SIWE owner derivation conditional on connection status
src/utils/server.ts
When method === "siwe", owner is set only if wagmi connection status for ownerConfig is "connected"; otherwise owner is undefined.
reportError: wallet classification flags
src/utils/reportError.ts
Adds walletBusy and walletDisconnected flags, includes them in authKnown/knownWarning, and exposes walletBusy in the returned classification object.
useAuth: wallet-busy early-return handling
src/utils/useAuth.ts
handleError now checks walletBusy from classifyError(error), shows a translated "Wallet is busy…" toast (native, short, warning haptics) and returns early before generic cancellation/fallback handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • franm91
  • cruzdanilo
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'misc fixes' is vague and generic, not clearly describing the primary change even though the PR objectives and actual changes focus on specific spotlight target measurement fixes and wallet-related improvements. Align the PR title with the main objective: use a descriptive title like 'Fix spotlight target measurement and wallet connection handling' that captures the primary changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 fixes

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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the spotlight target measurement in InstallmentsSpotlight.tsx by increasing the polling frequency and introducing a stability check to ensure measurements are consistent before updating the state. The feedback suggests making the stability check more robust by explicitly verifying the existence of the previous measurement object, which enhances code clarity and prevents potential TypeScript issues.

Comment thread src/components/home/InstallmentsSpotlight.tsx Outdated
@sentry
Copy link
Copy Markdown

sentry Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 67.64706% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.32%. Comparing base (c4d553a) to head (b14a5be).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/components/home/InstallmentsSpotlight.tsx 45.45% 6 Missing ⚠️
src/utils/useAuth.ts 0.00% 4 Missing ⚠️
src/utils/server.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1014      +/-   ##
==========================================
+ Coverage   72.23%   72.32%   +0.09%     
==========================================
  Files         240      240              
  Lines        9519     9595      +76     
  Branches     3082     3125      +43     
==========================================
+ Hits         6876     6940      +64     
- Misses       2369     2381      +12     
  Partials      274      274              
Flag Coverage Δ
e2e 72.32% <67.64%> (+5.23%) ⬆️

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dieguezguille dieguezguille changed the title 🐛 app: fix spotlight target measurement 🐛 app: misc fixes May 14, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b14a5be0f2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

targetRef.current?.measureInWindow((x, y, width, height) => {
if (width > 0 && height > 0 && y >= 0 && y + height <= screenHeight) {
const valid = width > 0 && height > 0 && y >= 0 && y + height <= screenHeight;
if (valid && previous?.x === x && previous.y === y && previous.width === width && previous.height === height) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Relax spotlight stability check tolerance

The new stabilization gate requires two measureInWindow samples to be exactly equal on x, y, width, and height before calling setTarget, but these values can fluctuate by small fractional amounts during/after scroll on real devices. In that case the equality condition never passes, the interval times out after 40 attempts, and the spotlight silently never appears. Using a small tolerance (or a bounded delta) avoids this regression while still filtering unstable measurements.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant