Skip to content

fix: open one connections card at a time, toggle only when it shows more - #36411

Closed
bolichen97 wants to merge 1 commit into
mainfrom
fix/36276-h92987c
Closed

bolichen97 wants to merge 1 commit into
mainfrom
fix/36276-h92987c

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On the Connections page, opening a card closes the one opened before it, and a card's name is only an expand toggle when opening the card shows something more.

Every card's name carried an expand chevron, even where opening it showed nothing new. A provider that signs in on its own (Notion, Linear, Atlassian, Stripe, Vercel, GitLab, TickTick) already shows its Connect while closed, so the chevron only rotated. A card held open by its state (waiting for approval, needs attention, not verified), and the Google entry while one of its products is, could not be closed by its toggle. Opened cards also stayed open side by side.

Why it matters

Anyone setting up a connection meets these toggles first. A chevron that does nothing, or a toggle that will not close, reads as a broken page. An open card spans two or three grid columns, so with several open the gallery reflows and the card the user was looking at moves.

Not a goal

  • Changing what an open card contains (the OAuth app part, Test, Disconnect, Reconnect).
  • Changing which states hold a card open.
  • Changing the Google product rows inside the Google entry.

What changed (motivation → approach → change)

The open state was a set of entries, and the card drew the name toggle whenever it was given an expand prop. So any card could be opened, opening a card never closed another, and a card held open still drew a toggle.

ConnectionsPage.tsx now keeps one open entry (string | null). Opening one closes the other, and the ?provider= and OAuth-highlight links open their entry the same way. While a product holds the Google entry open, its name is plain text. In ConnectionsPageCard.tsx the name is a toggle only when the card is toggleable: it has expand, is not held open, and has an OAuth app part or is connected. Any other card shows a plain name and looks the way a closed card did before.

docs/system-specs/modules/connections.md gets one paragraph stating the rule. ConnectionsPage.coverageTestUtils.tsx used to open every card. It now opens only the Google entry, because opening each card in turn closes the one before it and its waitFor never settled.

Backwards compatibility

Compatible: frontend only. No API, config or stored data changes, and every card that showed more when opened still opens.

Removes nothing: no route, key, record or public function is removed. A card that had nothing to show when opened simply has no toggle.

Tests

website/src/test/ConnectionsPage.coverage.test.tsx:

  • Notion (signs in on its own) shows a plain name with no toggle, and its Connect is visible.
  • Opening GitHub, then Asana, then the Google entry leaves only the last one open.
  • A broken connection opens by itself, with no name toggle that could not close it.
  • The Google entry opens by itself while a Google consent is in flight, with no toggle.

These four fail on the parent commit and pass here. All 17 Connections test files pass (343 tests).

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

Manual verification

Run on Ubuntu 24.04: real Chromium through Playwright against an isolated gateway on 127.0.0.1, with a temporary KIROCREW_HOME, after make frontend. From out/evidence/smoke-after.md:

name toggles per card: notion=plain github=chevron linear=plain atlassian=plain stripe=plain vercel=plain gitlab=plain asana=chevron google=chevron ticktick=plain
Notion: no chevron (plain name) | Connect visible: true
GitLab (no OAuth app part): no chevron (plain name)
after clicking GitHub: github chevron aria-expanded=true, OAuth app part shown
after clicking Asana: asana chevron aria-expanded=true, OAuth app part shown | github chevron aria-expanded=false, OAuth app part hidden
after clicking Google: google chevron aria-expanded=true | github chevron aria-expanded=false | asana chevron aria-expanded=false
after clicking Google again: google chevron aria-expanded=false

Before the fix, on the parent commit, Notion and GitLab had a chevron. Clicking Notion set aria-expanded=true and changed nothing on the card, and GitHub and GitLab stayed open side by side.

The held-open cases need a consent in flight or a broken server, which this host cannot produce without a provider account. The vitest cases above cover them.

Gates: black, subprocess encoding, isort, flake8, mypy, comment-history, brand, file-line cap, docs-lint, eslint, tsc, gen-ui-index --check and make frontend pass. In scripts/local-gate.py, every red also fails on a clean worktree of the parent commit, so this change did not cause any of them. The list is in the job's gates-final.txt.

Screenshots / video

Gallery after: plain names except GitHub, Asana and Google

Asana open, GitHub closed

Google entry open, and the before shots

Google open, GitHub and Asana closed

Before: every card has a chevron

Before: GitHub and GitLab open side by side

Before: Google opened next to the others

Related Issues

Issue #36276, closed by the last line of this description.

Sibling sweep

Swept: git grep -n "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: whether opening a card shows anything new depends on this page's own card model (OAuth app part, connected state, held-open states), and no lint can see that.

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

🤖 Generated with Claude Code

Closes #36276

How it was verified

Smoke test after the fix (issue #36276)

Same isolated home, gateway restarted on the rebuilt bundle (make frontend,
exit 0) at 127.0.0.1:42237. Real Chromium through Playwright (check.mjs).

Command

node check.mjs 42237 <token> $KC_OUT/evidence after

Output

name toggles per card: notion=plain github=chevron linear=plain atlassian=plain stripe=plain vercel=plain gitlab=plain asana=chevron google=chevron ticktick=plain
Notion: no chevron (plain name) | Connect visible: true
GitLab (no OAuth app part): no chevron (plain name)
after clicking GitHub: github chevron aria-expanded=true, OAuth app part shown
after clicking Asana: asana chevron aria-expanded=true, OAuth app part shown | github chevron aria-expanded=false, OAuth app part hidden
after clicking Google: google chevron aria-expanded=true | github chevron aria-expanded=false | asana chevron aria-expanded=false
after clicking Google again: google chevron aria-expanded=false

Reading

  • Bug 1 gone: Notion, Linear, Atlassian, Stripe, Vercel, GitLab and
    TickTick (they sign in on their own, with no OAuth app part) show a plain
    name and no chevron; Notion's Connect is still visible on the closed card.
    Only GitHub, Asana (OAuth app part) and the Google entry keep the toggle.
  • Bug 2 gone: opening GitHub shows its OAuth app part; opening Asana then
    closes GitHub (its OAuth app part goes hidden); opening Google closes Asana.
  • Happy path: each toggle still opens its card's OAuth app part, and
    clicking Google again closes it.
  • The held-open cases (a card or the Google entry waiting for approval, needing
    attention or not verified) need a consent in flight or a broken server,
    which this host cannot produce without a provider account. They are pinned by
    the vitest cases "opens a broken connection by itself, with no name toggle
    that could not close it" and "opens the Google entry by itself while a Google
    consent is in flight" (both failed before the fix, pass after).

Screenshots: after-1-gallery.png (plain names except GitHub, Asana, Google),
after-2-accordion.png (Asana open, GitHub closed),
after-3-google.png (Google open, GitHub and Asana closed).

On the Connections page every card's name carried an expand chevron,
even where opening the card showed nothing new: a provider that signs in
on its own (no OAuth app part) already shows its Connect while closed,
and a card held open by its state (waiting for approval, needs
attention, not verified) could not close. The Google entry had the same
held-open case. Opened cards also stayed open side by side, and since an
open card spans two or three grid columns, several of them pushed the
gallery around.

The name is now a toggle only when opening changes what the card shows:
the OAuth app part, or a connected card's Test and Disconnect. Opening
one card closes the one opened before it. Cards held open by their state
stay open and show a plain name.

The coverage helper that opened every card is narrowed to the Google
entry, since under one-open-at-a-time opening each card in turn closes
the previous one and its waitFor never settled.

Fixes #36276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This PR and #36305 both close #36276 and make the same change in ConnectionsPage.tsx, ConnectionsPageCard.tsx and the two ConnectionsPage coverage test files. Both open only one card at a time, and both make a card name a toggle only when opening the card shows more. Only this PR also updates docs/system-specs/modules/connections.md.

Please keep one of #36305 and #36411 and close the other, carrying over anything only this one has.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 13, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 13% chance that this change introduces a defect, above the 12% limit for approving on its own.

Frontend-only change on the Connections page. A single string | null open entry replaces the old set, so one card is open at a time. Every writer of the state was updated: toggleExpanded, the ?provider= and highlight effects, the Google entry, and the Set up button, which goes through onToggle. The card name is a toggle only when opening shows something new (an OAuth app part, or a connected card's Test and Disconnect) and the card isn't held open. That matches the open-only content in ConnectionCard: not-connected and needs-configuration actions render while closed. The Google entry shows a plain name while a product holds it open. Which states hold a card open is unchanged, and OAuth drafts survive because the panel is hidden, not unmounted. The new and changed tests cover each rule, and the switch from openAllCards to openGoogleEntry is consistent with how the tests use card(). CI failures are all API rate-limit or infrastructure failures, not code verdicts. Approve, noting that CI needs a re-run and the branch a rebase.

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 9d1dcbd997 · 124 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@iamwhatever

Copy link
Copy Markdown
Contributor

Closing as superseded: the same fix for #36276 (toggle a connections card only when it opens to more, and keep one card open at a time) landed in #36305, merged 2026-11-13, which also closed the issue. This branch now conflicts with main and adds nothing beyond it. Thank you for the work here. If something from this PR is still missing on main, please reopen with a note on what it is.

auto-merge was automatically disabled November 19, 2026 00:22

Pull request was closed

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Nov 19, 2026
@bolichen97
bolichen97 deleted the fix/36276-h92987c branch November 20, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

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