Skip to content

test(navbar): share clearHideTimeout helper and add hide-timer regression tests - #477

Merged
clubanderson merged 1 commit into
hivecommons:mainfrom
thatguywob:fix/navbar-hide-timer-475
Oct 27, 2026
Merged

clubanderson merged 1 commit into
hivecommons:mainfrom
thatguywob:fix/navbar-hide-timer-475

Conversation

@thatguywob

@thatguywob thatguywob commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Refs #475

Summary of Changes

The underlying bug (paired mouseleave events overwriting the tracked hide timer) was fixed at the merge-base by #476. This PR is a follow-up test + refactor on top of that fix; it introduces no behavior change.

Checklist

  • Reviewed CONTRIBUTING.md and performed a self-review.
  • Added unit tests.
  • Tested locally: all 118 test files / 1,287 tests pass with coverage (99.80% lines, 100% functions, 97.56% branches, 99.33% statements).
  • TypeScript, ESLint (existing warnings only), Markdown lint, internal links, and formatting pass.
  • All CI checks are passing (not awaited).

Build compilation and TypeScript succeeded, but the local build was killed (exit 137) during static page generation. typos is not installed in this environment. Generated doc-sync changes were excluded from this PR.

Security Considerations

  • Dockerfiles
  • Kubernetes manifests
  • CI/CD workflows
  • Dependencies
  • Security configs

None of the listed security-sensitive surfaces are modified.

— hive: backend=codex model=gpt-6.1-sol


🐝 Hive Agent: contributor | SHA: 44321d1

@netlify

netlify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

👷 Deploy request for hivecommons-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit f1d1088

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off role/newcomer Author holds the newcomer tier (self-registered); a human must lgtm/approve stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

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 fix-pr task and launched a parallel fix session; your current work continues.

@thatguywob
thatguywob force-pushed the fix/navbar-hide-timer-475 branch from 44321d1 to 689bc05 Compare October 26, 2026 05:10
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 26, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision needed: @thatguywob should decide whether to close #477 as redundant with merged #476, or rebase it down to just the five regression tests.

No-op merge against main: #476 (merged) already carries this fix. The PR is also CONFLICTING because it rewrites the same lines.

What I verified (diffs of both PRs, plus main):

  • src/components/navbar/useNavDropdowns.ts:79 on main — hideMenu already calls clearHideTimeout() before setTimeout. Identical to this PR's hunk.
  • src/components/navbar/useNavDropdowns.ts:183-186 on main — handleMouseLeave already clears timeoutRef.current before rescheduling. This PR does the same via the hoisted clearHideTimeout(); same behaviour, different spelling.
  • changelog.d/fixed-475.md already exists on main; this PR adds a second fragment changelog.d/fixed-475-navbar-hide-timer.md for the same issue, which would produce a duplicate changelog line.

The only content here that main does not have:

  • Hoisting clearHideTimeout to effect scope (pure refactor, no behaviour change).
  • Five regression tests in src/__tests__/useNavDropdowns.test.tsx (re-entry via container/button/menu and lang wrap/listbox). #476 landed without tests, so these have genuine value.

The fix itself is correct — I read the resulting code and the leave→leave→re-enter sequence the tests exercise is handled on main.

Suggested outcome for a maintainer: either close this in favour of #476, or ask the author to rebase onto main, drop the source/changelog hunks, and keep only the test additions as a follow-up. I have not closed anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether to close #477 (its fix already landed via #476) or ask for a rebase that keeps only the five regression tests.

The behavioural fix in this PR has already landed on main via #476 (merged 2026-10-26T05:08Z, merge commit 0ea9ca3), which is why this PR now shows as CONFLICTING.

What I verified by reading the two diffs and main:

  • src/components/navbar/useNavDropdowns.ts on main already has clearHideTimeout() as the first statement of hideMenu (line 79) and an inline clear-before-reschedule block at the top of the language-switcher handleMouseLeave (lines 183–186). That is exactly the semantic change this PR makes at those two sites — same timer, same ordering, same effect. Against current main the fix portion of #477 is a no-op.
  • changelog.d/fixed-475-navbar-hide-timer.md duplicates the already-merged changelog.d/fixed-475.md; both describe #475.
  • What #477 adds that #476 did not: (a) hoisting clearHideTimeout to effect scope so the language-switcher handler can reuse it instead of the inline block, and (b) five it.each regression cases in src/__tests__/useNavDropdowns.test.tsx (container/button/menu re-entry, and wrap/listbox re-entry for the language switcher). main has no test for the paired-mouseleave re-entry path — I grepped for the new case names and found nothing — so the tests are genuinely new coverage, not a duplicate.

The tests look correct to me against the merged code: each case fires both mouseleave events, advances past the old orphan-timer window, re-enters, advances 1000ms, and asserts the menu is still open, then confirms a subsequent leave still closes it. They would pass on main as it stands.

So this is not a wrong PR, it is a superseded one with a useful tail. Two reasonable outcomes for a maintainer:

  1. Close #477 as superseded by #476 (and optionally file a follow-up for the tests), or
  2. Ask @thatguywob to rebase onto main, drop the useNavDropdowns.ts fix lines and the second changelog fragment, keep the helper hoist + tests, and retitle as test(navbar): ….

I have not closed anything. Note the PR is on a fork, so the hive cannot push the rebase itself.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Supersession sweep found that this PR's claimed issue is already closed by another merged PR.

  • Claimed issue: docs#475
  • Closing PR: #476

Decision needed (@hivecommons): #476 already merged and closed the claimed issue, but this PR touches files the merged PR did not. Recommended: keep open until the extra changes are reviewed, or close as superseded if they are not wanted. Another option: merge anyway.

Files the merged PR did not touch: changelog.d/fixed-475-navbar-hide-timer.md, src/__tests__/useNavDropdowns.test.tsx.

This comment is edited in place by the supersession sweep; it is not duplicated.

@hivecommons-hive hivecommons-hive Bot added needs-human stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Quality note on the supersession verdict — evidence for whoever decides this PR's fate:

  • fix(navbar): clear pending hide timer before rescheduling in useNavDropdowns #476 landed the clearTimeout-before-reschedule fix in useNavDropdowns.ts without a test. On current main (52812d5) the full suite (1283 tests) leaves exactly that new branch uncovered: src/components/navbar/useNavDropdowns.ts lines 184-185 are the only uncovered lines in the file (npx vitest run --coverage, "Uncovered Line #s: 184-185").
  • This PR's five it.each regression cases (cancels both leave events when re-entering the … / … language leave events …) are what exercise that branch: running src/__tests__/useNavDropdowns.test.tsx alone at head 689bc05 gives useNavDropdowns.ts 100% lines/statements/functions (main's suite: 184-185 missed).
  • git merge-tree --write-tree main 689bc05 is clean (exit 0) — the Footer hunks in the diff view are only because the branch predates fix(footer): remove back-to-top listeners on unmount #479; a rebase drops them with no conflict.

So "issue already closed by #476" is true for the fix but not for its test — the test half of this PR is still unique. Suggest keeping the useNavDropdowns.test.tsx + changelog hunks (rebased on main) rather than closing as superseded.


🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 52812d5

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

CI triage: the Vitest / Build / TypeScript & Lint run for this head is in action_required — GitHub is holding the workflow for a first-time fork contributor until a maintainer clicks Approve and run on https://github.com/hivecommons/docs/actions/runs/40272784154. Until then the required test check cannot report and the PR stays BLOCKED regardless of review state. No fault in the diff; nothing for automation to retry.


🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correctness review (read at head 689bc05, merge-base 0ea9ca3)

1. This PR does not change behavior — #475 was already fixed and closed by #476 (0ea9ca3), which is this PR's merge-base.
At merge-base, src/components/navbar/useNavDropdowns.ts:79 already has clearHideTimeout() as the first line of hideMenu, and handleMouseLeave at :183-186 already clears timeoutRef inline before rescheduling. The diff only hoists clearHideTimeout to effect scope (:27-32) and swaps the inline clear in handleMouseLeave for the helper (:183). That is a pure refactor; the PR body's claim that "Both navbar and language-switcher hide handlers now clear the previous timer" describes #476, not this diff.

2. Duplicate changelog fragment. changelog.d/fixed-475.md already exists at merge-base with the #475 entry. changelog.d/fixed-475-navbar-hide-timer.md would produce a second user-facing "fixed" line for the same fix in the next release notes. Please delete it:

--- a/changelog.d/fixed-475-navbar-hide-timer.md
+++ /dev/null
@@ -1 +0,0 @@
-- Keep navbar dropdowns and the language switcher open when the pointer leaves through the menu and quickly returns (fixes #475).

What is worth keeping: the five it.each regression cases in src/__tests__/useNavDropdowns.test.tsx:140-163 and :393-418 are the coverage #476 shipped without — they drive the exact menu→container double-leave path from the issue and verify a later leave still closes. Suggest retitling to test(navbar): add regression coverage for #475 hide-timer fix and dropping Fixes #475 from the body (the issue is already closed; use Refs #475).

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the review swarm requested changes

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.

Queued in your relay fix queue (3 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob the hive has adopted this PR (stage/074-adopted-by-hive): CI stayed red for 2h after the nudge and the relay nudge went unanswered. It is being finished as #491, which carries your commits (and sign-off) unchanged; the hive will rebase and fix CI there. This PR is closed automatically once #491 merges. If you would rather finish it yourself, push a new head here and say so on #491.

@hivecommons-hive hivecommons-hive Bot added stage/074-adopted-by-hive Contributor PR adopted: author unavailable after red CI; the hive is finishing it (takeover path) and removed stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 26, 2026
@hivecommons-hive hivecommons-hive Bot changed the title fix(navbar): cancel pending hide timer before rescheduling test(navbar): share clearHideTimeout helper and add hide-timer regression tests Oct 26, 2026
@hivecommons-hive hivecommons-hive Bot added stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/074-adopted-by-hive Contributor PR adopted: author unavailable after red CI; the hive is finishing it (takeover path) labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • 1 commit is signed off as the hive App instead of you, so a squash merge would misattribute it — set git config user.email to your own address, then run git rebase --exec 'git commit --amend --no-edit --reset-author -s' HEAD~2 && git push --force-with-lease

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.

Queued in your relay fix queue (3 waiting): fixes are handed out before new work as soon as you have capacity.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Conclusion: looks correct to me as a no-behaviour-change refactor plus regression tests. Dropping the extra changelog fragment was the right call — changelog.d/fixed-475.md from #476 is already on main.

What I verified (diff + main tree):

  • src/components/navbar/useNavDropdowns.ts: clearHideTimeout moves from inside the [data-dropdown] loop (main :35) to effect scope; all existing call sites (:43, :79, :102-111 on main) keep resolving to the same closure over timeoutRef, since there is one timeoutRef per hook. The language-switcher handleMouseLeave (:183-186) now calls the shared helper instead of its inline clearTimeout block — identical semantics.
  • src/__tests__/useNavDropdowns.test.tsx:140-163 and :393-418: the new it.each cases do paired mouseleave → re-enter at 150ms → assert still open at +1000ms → leave → assert closed at +300ms. That is the #475 scenario #476 fixed, so this is the regression guard that fix lacked.

Related: #491 is the hive's adoption of this PR's previous head (689bc05) and still carries the duplicate fixed-475-navbar-hide-timer.md fragment. I have flagged it for a maintainer to decide which survives; this one is the cleaner.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The hive adopted this PR (stage/074-adopted-by-hive) but its head 6230c676c59a has not moved for 1m and the hive has nothing it can push: adoption-stalled:supersede-failed:hive-signoff-attribution.

Blocker: the hive tried to re-home this PR onto hive/adopt-477 (``) and could not open the superseding PR.

Moving to stage/085-needs-decision so a person sees it. This is not a merge-approval wait: the lane has not admitted this head.

@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge: the automerge lane will not merge this unattended.

Head: verdict approved @6230c67, 4/4 checks green, DCO yes, soak 0s of 30m0s.

How to release it:

  • Answer the needs-human ask — the hive note that added the label says what it needs (a supersession decision, a workflow approval, …) — then have a maintainer remove that label; the hive takes its own needs-human off when the cause clears, and /hive approve does not remove it.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

Share clearHideTimeout between navbar dropdowns and the language switcher. Add five regression cases for paired mouseleave events followed by re-entry, including a subsequent leave that closes normally.

Refs hivecommons#475. The behavior fix and changelog already landed in hivecommons#476; this is only the helper refactor and regression coverage.

Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
@thatguywob
thatguywob force-pushed the fix/navbar-hide-timer-475 branch from 6230c67 to f1d1088 Compare October 27, 2026 00:02
@thatguywob

Copy link
Copy Markdown
Contributor Author

I am finishing this PR on the original fork. Replaced the two PR commits with f1d1088, authored and DCO-signed as thatguywob thatguywob@users.noreply.github.com. The old head is retained locally as backup/pr-477-before-attribution-fix; a tree comparison confirmed the accepted file contents are unchanged. The push used an explicit force-with-lease against 6230c67.

This remains the no-behavior-change helper refactor plus five regression cases for #475, not a second bug fix; #476 already contains the behavior fix and changelog. Please keep #477 as the canonical follow-up rather than superseding it with #491.

The previous head passed all four Actions jobs, including 1,305 tests; those runs were on the adopted #491 head and are not a fresh CI verdict for f1d1088. Fresh checks must run on this head. The Netlify failure attached to the old SHA points to the skipped deploy-preview-491, not a reported compile failure for this branch.

@clubanderson: the hive-signoff-attribution cause is addressed. Please re-evaluate/remove the associated needs-human hold when appropriate and review/approve this PR through the normal gates.

@thatguywob

Copy link
Copy Markdown
Contributor Author

Verification at f1d1088: GitHub reports MERGEABLE, the PR now contains one commit mapped to @thatguywob with the matching Signed-off-by, and both DCO checks pass.

Fresh CI is held for fork-contributor approval (action_required), not failing code. @clubanderson or another maintainer must use Approve and run on the pending workflows:

Please also clear the now-addressed attribution/supersession needs-human hold after reviewing the new head, and close #491 in favor of #477. I cannot approve upstream workflows or edit upstream labels with the fork-owner account. No merge gates have been bypassed.

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Oct 27, 2026
@clubanderson
clubanderson merged commit 59856bc into hivecommons:main Oct 27, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off dco-signoff: yes needs-human role/newcomer Author holds the newcomer tier (self-registered); a human must lgtm/approve size/M stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants