Repository navigation
refactor(web): the Crew request poll uses the shared visible-refresh hook - #351
Merged
Merged
Conversation
…hook The gating atom already skips environments with no pending seat approval, and a newly polled environment's query fetches on mount, so the hand-written poll lifecycle was redundant. The Crew request poll now uses createVisibleRefreshHook like every other J5 poll; each tick sends nothing while no approval is pending. startVisibleRefresh is private again. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: Jacksondr5/j5code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: Comment |
bryantderosier
requested review from
BastiHu,
Jacksondr5 and
tyler-barton-horizon
September 28, 2026 17:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #309 merged, the Crew seat-approval poll still had a hand-written lifecycle: module-level consumer counting, a poll key, start/stop functions, and a
startVisibleRefreshexport. Jackson's review on #309 pointed out that the gating atom already does the gating, so none of that was needed.What I changed
apps/web/src/j5/crew/crewRuntimeRequestsClient.ts:useCrewRuntimeRequestsRefreshis nowcreateVisibleRefreshHook(refreshPolledEnvironments, CREW_RUNTIME_REQUESTS_POLL_INTERVAL_MS). The removed pieces areconsumers,polledKey,stopPoll,syncPoll, the consumer-count and key effects, and theuseEffectimport.apps/web/src/j5/useVisibleRefresh.ts: thestartVisibleRefreshexport is gone, and the file is back to its shape before feat(crews): answer a Crew thread's provider approvals and questions from the Inbox #309.refreshCrewRuntimeRequests, the forced re-read after an answer, is unchanged.Why this shape
polledCrewRuntimeRequestsAtom(apps/web/src/j5/state.ts) only mounts an environment's query while that environment has a pending approval.Atom.swr({ revalidateOnMount: true }).refreshPolledEnvironmentssends nothing while no environment is polled.So the shared hook gives the same result with far less code.
Invariants
Surfaces
Out of scope
Upgrade and data
None.
Verification
apps/webtypechecks (exit 0).vp test run apps/web/src/j5: 329 passed. The purecrewApprovalPollPlantests still cover the gating decision.Review focus
Claude Opus 5.5 via Claude Code in J5 Code
🤖 Generated with Claude Code