Skip to content

Align timers to shared KaiTimeSource context#67

Open
kojibai wants to merge 2 commits into
mainfrom
codex/refactor-time-sources-in-kai-components
Open

Align timers to shared KaiTimeSource context#67
kojibai wants to merge 2 commits into
mainfrom
codex/refactor-time-sources-in-kai-components

Conversation

@kojibai
Copy link
Copy Markdown
Owner

@kojibai kojibai commented Dec 21, 2025

Summary

  • add KaiTimeProvider/useKaiTime to expose a shared KaiTimeSource pulse stream
  • update Kai tickers, countdowns, and CSS phase alignment to rely on the shared monotonic source
  • retime the Stargate viewer animations using KaiTimeSource pulses for consistent phase

Testing

  • not run (not requested)

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 21, 2025

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

Project Deployment Review Updated (UTC)
phi.network Error Error Dec 21, 2025 1:36am
verify-kai Error Error Dec 21, 2025 1:36am

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.

ℹ️ 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 thread src/hooks/useKaiTime.tsx
Comment on lines +57 to +61
const next = snapshot(source);
setValue(next);

const delay = Math.max(8, Math.min(PULSE_MS, next.msToNextPulse));
timeout = window.setTimeout(schedule, delay);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep msToNextPulse countdown updating continuously

KaiTimeProvider only refreshes its context on a timeout scheduled for next.msToNextPulse, so msToNextPulse stays frozen for the entire 5.2s pulse and then jumps back to ~5236ms at the boundary instead of counting down. Hooks like useKaiTicker now expose a static value, so UIs that render the next-pulse countdown (e.g., SigilPage’s nextPulseSeconds) no longer tick down and appear stuck for most of each pulse. The provider needs to emit more frequent updates (short interval/RAF) rather than once per pulse to preserve the live countdown.

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.

1 participant