Skip to content

fix(connections): toggle a card only when it opens to more, and open one card at a time - #36305

Merged
iamwhatever merged 1 commit into
mainfrom
fix/connections-card-accordion
Nov 13, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/connections-card-accordion

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On the Connections page, a card's name is a toggle only when toggling changes what the card shows, and opening one card closes the others.

Every card's name carried an expand chevron. On a card whose provider registers its own OAuth client (Notion, Linear, Stripe, Vercel, GitLab here), the closed card already shows its whole action row, so the chevron only rotated. A card held open by its state (waiting for approval, needs attention, not verified) also showed a chevron that did nothing, and so did the Google entry in the same state. Opening a second card left the first one open, and open cards span two or three grid columns.

Why it matters

Every user of the Connections page sees a control that does nothing on most cards, and open cards pile up across the grid until each one is closed by hand.

Not a goal

  • Changing what an open card shows, or which providers need an OAuth app.
  • Changing which states force a card open.

What changed (motivation → approach → change)

Card Before After
Opening adds nothing (no OAuth app part, not connected or needs setup) chevron, click only rotates it plain name
Forced open by its state (card or Google entry) chevron, click does nothing plain name
Opening one card others stay open others close

The symptom came from two places. The card drew the toggle whenever the page passed an expand handle, without asking whether toggling changes anything. The page kept open cards in a set that only ever added entries. Now ConnectionsPageCard.tsx draws the toggle only when the card is not forced open and has an OAuth app part or a state whose actions hide while closed. ConnectionsPage.tsx keeps at most one open entry, for a click, a ?provider= link and a settings highlight alike. Cards that need the user still stay open on their own, outside that set.

Backwards compatibility

Compatible: no API, setting or stored state changes; links that open a card still open it.

Removes nothing: the toggle is dropped only where clicking it changed nothing on screen, and every action stays reachable.

Tests

  • ConnectionsPage.coverage.test.tsx: a not-connected card with no OAuth app part has no toggle and keeps Connect; a card with an OAuth app part opens and closes on its name; opening GitHub closes Notion and opening the Google entry closes GitHub; a forced-open card has no toggle. The two old tests that pinned the dead chevron are rewritten.
  • ConnectionsPage.coverageTestUtils.tsx: the helper that clicked every card open now opens only the Google entry, since opening every card no longer settles.
  • Determinism: the whole file passed 4 times in shuffled order (--sequence.shuffle, seeds 1, 7, 13, 42; 89/89 each).

Proof: not provable -- frontend test (prove.py runs Python only)

Manual verification

Captured the built SPA with stubbed APIs (light and dark): Notion's name has no chevron, GitHub opens, then opening Asana closes GitHub.

Screenshots / video

At rest: Notion, Linear, Stripe, Vercel and GitLab have no chevron; GitHub and Asana keep theirs.

at rest, light

GitHub opened, then Asana opened and GitHub closed by itself:

GitHub open, light

Asana open, GitHub closed, dark

Related Issues

Closes #36276

Sibling sweep

Swept: git grep -nE "ChevronDown|aria-expanded" -- website/src/pages/connections/
Sibling: website/src/pages/connections/ConnectionsPage.tsx -- changed here
Sibling: website/src/pages/connections/ConnectionsPageCard.tsx -- changed here

Pattern harvest

Not generalizable: the dead toggle came from this card's own rule for what shows while closed, not a pattern other pages share.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 13, 2026 02:15
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 3fb7316fa35b040fcb09e95692bf23c8d5d43b92 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Every item removes a dead control or the pile-up of open cards that #36276 reports; the one-open-at-a-time behaviour stays inside the accepted RFC's "a card expands in place" shape.

What this change ships

Inventory (6 items) — 6 justified

Intent: on the Connections page, show a card's name as a toggle only when clicking it changes something, and keep one card open at a time. FIX.

  1. A not-connected or needs-setup card with no OAuth app part (Notion, Linear, Stripe, Vercel, GitLab) shows a plain name, with no chevron — justified
  2. A card held open by its state shows a plain name, with no toggle and no aria-expanded — justified
  3. The Google entry, when held open by a product's state, shows a plain name — justified
  4. Opening a card closes whichever card was open — justified
  5. A ?provider= link or a settings highlight now opens only its card and closes any other — justified
  6. The test helper that opened every card now opens only the Google entry, and two tests that pinned the dead chevron are rewritten — justified

[FIRST-PRINCIPLES-REVIEWED] 3fb7316

Description read

[DESCRIPTION-READ] 979fc5dfa96c10fb51aac5f876ddf27be3e21bf77860bedc4a83fd51fe766dda

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 3fb7316fa35b040fcb09e95692bf23c8d5d43b92 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the toggle now shows only where it changes the card, the accordion is a one-line state change that is easy to revert, and the three attached screenshots show this revision.

Notes

  • The page's Google entry and ConnectionsPageCard.tsx each compute the forced-open state list (waiting-for-approval/needs-attention/not-verified) separately, and this PR adds a new reader of it (googleForcedOpen). Exporting one predicate would keep "forced open" and "no toggle" from drifting apart.

[DESIGN-REVIEWED] 3fb7316

Description read

[DESCRIPTION-READ] 7a5740a9d5bde22472c352ca2a2858d7f640bd565fe4a78b57a7bc15f02f7a99

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of 3fb7316fa35b040fcb09e95692bf23c8d5d43b92 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

cannot evaluate: missing a recording of the new accordion, where opening one card closes another and the grid reflows, and a screenshot of a card held open by its state, whose name is now plain text.

Evidence gaps

  • Accordion close and reflow. In ConnectionsPage.tsx, toggleExpanded now does prev.has(entry) ? new Set() : new Set([entry]). Clicking Asana collapses the GitHub card the user had open, and the grid re-lays out around the newly wide card. The recording list is empty. The blind reader wrote: "Opening one card makes it full-width, and the whole grid moves around. Cards end up in different spots." Shots 02 and 03 show the start and end but not the change between them. To close the gap, attach a recording of opening GitHub and then Asana, in one theme.
  • A card or Google entry held open by its state. forcedOpen / googleForcedOpen now render the name as plain text instead of a toggle. No screenshot shows a card in the waiting-for-approval, needs-attention or not-verified state. To close the gap, attach a screenshot of one such card and of the Google entry in that state.

Notes

  • The GitHub card keeps its toggle, but when opened it only shows "Every provider in this install registers its own OAuth client, so there is nothing to configure here." The blind reader said "opening it felt pointless" and did not know "provider", "install" or "OAuth client". The rule this PR adds (showsMoreOpen = oauthPanel !== undefined) still counts this panel as more to show, so it leaves a toggle that leads to nothing on the PR's own example card.

[UX-REVIEWED] 3fb7316

Description read

[DESCRIPTION-READ] df5c35c416bd50161144848144639e75636542847d31b924c2a60bfce2fd138d

That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@iamwhatever
iamwhatever force-pushed the fix/connections-card-accordion branch from 4f4be1a to 7d5fb0f Compare November 13, 2026 02:18
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 3fb7316fa35b040fcb09e95692bf23c8d5d43b92 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 3fb7316

Verdict parsed from the review's SHA-scoped output markers for commit 3fb7316fa35b040fcb09e95692bf23c8d5d43b92.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 3fb7316fa35b040fcb09e95692bf23c8d5d43b92 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 3fb7316fa35b040fcb09e95692bf23c8d5d43b92 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 3fb7316

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 3fb7316fa35b040fcb09e95692bf23c8d5d43b92 false-positive: <reason, 20 to 500 characters>

@iamwhatever

iamwhatever commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Backend Tests (3.12, 8) fails on test/test_reply_format_once.py::TestEveryMessageWhereTheBlockCannotBeTakenOut::test_the_table_names_every_selectable_harness, a harness-table check this PR does not touch (frontend-only diff). An open fix for main is in #36315 (draft); this PR will rebase onto it once it lands.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

Frontend-only fix on the Connections page. The name toggle is now drawn only when the card isn't forced open and has an OAuth app part or a state whose actions hide while closed. This matches the card's render rule (the action row shows when open, not-connected or needs-configuration), so no visible content or action is lost. "Set up X" still uses expand.onToggle, and the OAuth panel is hidden rather than unmounted, so auto-closing a card keeps any unsaved form input. The open-card state now holds one entry; all three writers (click, ?provider=, highlight) are updated, and forced-open cards stay open outside it. New and rewritten tests cover the changed behaviour, and I found no other test that depends on a toggle the PR removes. The only failing CI check is an unrelated Python backend test; Frontend Tests were still pending.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 7d5fb0f27d · 82 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 13, 2026
@iamwhatever
iamwhatever force-pushed the fix/connections-card-accordion branch from 7d5fb0f to 6880142 Compare November 13, 2026 05:07
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased onto main carrying #36315 (the harness-table fix behind the inherited Backend Tests (3.12, 8) / Windows (8) red). Same diff; CI re-running.

@iamwhatever
iamwhatever force-pushed the fix/connections-card-accordion branch from 6880142 to 3fb7316 Compare November 13, 2026 21:18
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/pages/connections/OAuthAppPanel.tsx and website/src/pages/connections/OAuthAppPanel.test.tsx since this head went green (ff344c7 -> ac4062d); CI re-running.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 13, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) November 13, 2026 22:22

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

Approve at 3fb7316. I read the whole diff.

  • One card open at a time. toggleExpanded now keeps at most one entry open: opening one closes the others, and clicking it again closes it. The ?provider= and OAuth ?highlight= deep links open just their target. Cards that a state forces open (a consent in flight, needs attention, not verified) still stay open on their own, outside this set.
  • The name toggles only when it does something. A forced-open card and the forced-open Google entry show their name as plain text, with no chevron. A card with no OAuth app part that is "not connected" or "needs configuration" already shows its whole action row while closed, so it gets no toggle either. Every other card keeps its button with aria-expanded and aria-controls as before.

Web-only, no regex, no refusal. The description carries screenshots, and all 97 checks are green. Approving without auto because the author holds auto-merge.

@iamwhatever
iamwhatever merged commit e955473 into main Nov 13, 2026
99 checks passed
@iamwhatever
iamwhatever deleted the fix/connections-card-accordion branch November 13, 2026 22:25
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connections: chevron on cards that cannot open further, and open cards do not close each other

3 participants