Repository navigation
🌱 refactor: extract iframe embed state and lifecycle - #24407
hivecommons-hive[bot] merged 2 commits into
Conversation
Refs kubestellar#24400; isolate iframe configuration, persistence, and refresh logic while preserving rendering. Hive-Run: kubestellar#24400 Hive-Plan: iframe-embed-hook-extraction Hive-Spec: issue-24400#extract-custom-hooks Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
✅ Deploy Preview for kubestellarconsole ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
I reproduced locally ( Flagged lines (current HEAD Fix: delete all 19 I can't push to this branch (fork PR, comment-only access), so flagging here for you to apply. 🐝 Hive Agent: — hive: agent=architect backend=copilot model=claude-opus-4.7 copilot=1.0.88 |
There was a problem hiding this comment.
Read the extracted hook side-by-side with the pre-move IframeEmbed.tsx and the component at this head: the state, persistence, sanitization, and refresh logic is a faithful move. sanitizeIframeUrl is still applied at every boundary (initial config at useIframeEmbed.ts:65, localStorage restore at :92, save at :130, reload at :116), the component keeps PRESET_EMBEDS/DEFAULT_SANDBOX locally (IframeEmbed.tsx:17,20), and nothing in the JSX references state the hook no longer returns. Hook tests cover the scheme-rejection and timer-lifecycle paths. Logic-wise this looks correct to me.
One concrete blocker — build-gate is red because of the lint suppressions, not the code:
web/src/components/cards/useIframeEmbed.ts:94–210— all 19// eslint-disable-next-line no-restricted-syntax -- Preserve the batched state updates…directives are reported by build-gate's Frontend lint step as "Unused eslint-disable directive (no problems were reported from 'no-restricted-syntax')" (job 117484386923). The restriction those comments anticipate evidently doesn't apply in this.tsfile, so the lint run that forbids unused disables fails. Severity: medium — the PR cannot merge until they're removed.
Fix is mechanical: delete the 19 unused directives (and their comments) in useIframeEmbed.ts and push. No behavior change needed. I can't push to the fork branch, so flagging for @Karibhou.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
|
@Karibhou this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Your relay session received this as a |
Remove 19 unused no-restricted-syntax directives reported by build-gate after the hook extraction. Hive-Run: kubestellar#24400 Hive-Plan: iframe-embed-hook-extraction Hive-Spec: issue-24400#extract-custom-hooks Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
There was a problem hiding this comment.
Correctness: read the extraction against main's IframeEmbed.tsx — it is faithful. sanitizeIframeUrl is still applied at every boundary the original enforced (localStorage restore, save, reload; main lines 107–110, 136–142, 176–179), demo-mode refresh suppression is preserved, and the hook adds dedicated regression tests plus null-guards on savedEmbeds that the original lacked. Looks correct to me.
But this PR conflicts with #24409, which also creates web/src/components/cards/useIframeEmbed.ts and rewrites IframeEmbed.tsx as part of its 4-component split (closing #24405, the child of #24400 this PR refs). I read both diffs: the two extractions are semantically identical, differing only in style — this one names its constants and tests the hook; #24409 is a verbatim move bundled with EventsTimeline/Kubedle/ContainerTetris. Whichever merges second conflicts on both files.
Question for a maintainer: pick one — land this PR and have #24409 rebase to drop its IframeEmbed portion, or land #24409 wholesale and close this one as superseded. I left the same note on #24409. I have not closed anything.
(The Test (chromium, shard 2) failure predates this judgment; if it reruns green it was unrelated to the iframe change — none of this PR's files are exercised by that shard's failure signature I could attribute to the diff.)
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @d95a770, 30/31 checks green, 1 pending, DCO yes, soak 0s of 30m0s. Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
hive CI finding — required merge gating is blocked by Test (chromium, shard 2) failing: This PR only touches 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88 |
c0ce2ba
into
kubestellar:main
⏹️ Post-Merge Verification: cancelledCommit: |
Keep the merged IframeEmbed extraction from kubestellar#24407 and retain the three distinct card hook extractions. Remove duplicate iframe visual coverage from this PR. Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
Summary
IframeEmbedmixed its JSX with configuration state, localStorage persistence, URL validation, and refresh timers. Extract those responsibilities intouseIframeEmbed, reducing the component from 457 to 284 lines while keeping its JSX unchanged.Refs #24400 — partial: addresses
IframeEmbed; the other 24 listed components remain for separate focused PRs.Changes
Validation
app-visual.config.tsand demo mode: passed against saved baselines without updates; inspected settings and demo-placeholder screenshots.git diff --checkpassed.AGENTS.md.Checklist
main; scoped to the existing iframe card and its tests.— hive: backend=codex