Skip to content

Conversation

@kojibai
Copy link
Owner

@kojibai kojibai commented Dec 31, 2025

Motivation

  • Prevent the Sigil Explorer UI from re-rendering mid-interaction (scrolling, toggling) which causes perceived refreshes on mobile.
  • Keep existing explorer logic and behavior but batch and apply updates only when the user is idle to improve stability and performance.

Description

  • Added pending refs pendingTransferBumpRef and pendingNowPulseRef to hold deferred transfer and pulse updates.
  • Introduced bumpTransferRevSafe and setNowPulseSafe to enqueue updates when the UI is interacting and apply them immediately when idle.
  • Extended flushDeferredUi to apply queued nowPulse and transfer bumps along with existing pending UI changes (setLastAdded, registryRev).
  • Replaced direct calls to setTransferRev and setNowPulse in storage/transfer event handlers, broadcast listeners, and the pulse interval with the safe variants to avoid phantom refreshes.

Testing

  • No automated tests were executed for this change.
  • Manual runtime behavior: existing deferred UI flush logic will now include pending pulse and transfer updates (ensure in-app QA for scroll/toggle stability).

Codex Task

@vercel
Copy link

vercel bot commented Dec 31, 2025

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

Project Deployment Review Updated (UTC)
phi-network-5aii Ready Ready Preview, Comment Dec 31, 2025 5:53pm

@kojibai kojibai merged commit 1307e95 into main Dec 31, 2025
2 checks passed
Copy link

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

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1278 to +1284
const now = nowMs();
if (now < interactUntilRef.current || scrollingRef.current) {
pendingNowPulseRef.current = next;
scheduleUiFlush();
return;
}
startTransition(() => setNowPulse(next));

Choose a reason for hiding this comment

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

P2 Badge Clear pending pulse when applying immediate update

When interaction ends, the 6s interval can fire before the scheduled deferred flush runs. In that case setNowPulseSafe applies the new pulse immediately while leaving pendingNowPulseRef intact, and the later flushDeferredUi still applies the older pending value (lines 1200–1203) — this can make nowPulse jump backwards and revert value snapshots/phi totals. This only occurs if an interval tick lands between interaction end and the deferred flush, but it is a real timing window; consider clearing pendingNowPulseRef when applying the immediate update to avoid stale overwrites.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants