Skip to content

feat(git): implement tabbed navigation for Git settings - #697

Merged
pikann merged 3 commits into
masterfrom
feature/enhance-project-git-setting-uxui
Nov 3, 2026
Merged

pikann merged 3 commits into
masterfrom
feature/enhance-project-git-setting-uxui

Conversation

@pikann

@pikann pikann commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The project Git settings page was one long flat page (connections, repositories, automation, usage guide), and the sidebar's edge had two competing gestures. This PR makes both easier to use.

Git settings

  • Split the page into tabs in setup order: Connections, Repositories, Automation, Using it (the last only appears once a repository is linked).
  • Connections and Repositories show a count badge.
  • Opens on Connections when the project has none, otherwise on Repositories.
  • Accessible tablist (role=tab/tabpanel, arrow-key navigation).
  • Panels stay mounted (hidden), so a half-typed repository or unsaved automation change survives switching tabs.
  • Tab labels reuse existing section titles, so no new translation keys.

Sidebar

  • The click-to-toggle rail and the drag-to-resize handle shared the same edge. While expanded, the edge now only resizes (double-click still resets width); collapse with the header toggle.
  • The rail is rendered only while collapsed, so clicking the edge brings the sidebar back.

Test plan

  • tsc -b, biome check
  • vitest run src/components (804 passing); GitSettings.test.tsx updated to open the Automation / Using it tabs
  • Manual check in the browser: tab switching, edge drag vs. click in expanded and collapsed states

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

Important

Converting the Git settings into tabs leaves the Playwright suite asserting content that now lives inside a hidden panel. The unit tests were updated to switch tabs first; the e2e specs and feature files were not, so at least six specs will fail. Please update them before merging.

Reviewed changes

  • Git settings become tabs — GitSettings.tsx renders Connections / Repositories / Automation / Usage behind a role="tablist"; inactive panels stay mounted with the hidden attribute, with a roving-tabindex ArrowLeft/ArrowRight handler that moves focus.
  • Default tab — opens connections when the project has none (once the connections query has settled), otherwise repositories.
  • Unit tests — GitSettings.test.tsx gains an openTab helper and switches tabs before asserting Automation/Usage content.
  • Sidebar rail — app-sidebar.tsx now mounts SidebarRail only while the sidebar is collapsed.

⚠️ Existing Playwright specs still assert the un-tabbed layout

The unit tests were taught to click a tab before asserting Automation/Usage content, but the e2e specs drive the same page with the assumption that every section is visible on load. Playwright's toBeVisible, click, and selectOption all require visibility/actionability, so assertions aimed at a hidden panel will fail. At minimum, the failing sites are git-settings.spec.ts:141 and :142-146, and git-automation.spec.ts:167, :243, :253, :266, :287, :302, :318; the git-*.feature files also still describe sections rather than tabs.

Technical details
# Playwright specs assert content that is now inside a hidden tab panel

## Affected sites
- `apps/e2e/tests/projects/git-settings.spec.ts:141` — `getByText("No repositories linked").toBeVisible()`. `stubGit` leaves connections unstubbed (`[]`), so the default tab is `connections` and the `repositories` panel containing this text is `hidden`.
- `apps/e2e/tests/projects/git-settings.spec.ts:142-146` — `getByLabel("Repositories").getByText("No Git provider is installed")` scoped to the hidden Repositories `<section>` (the same text is visible in the Connections panel, but this locator targets the hidden one).
- `apps/e2e/tests/projects/git-automation.spec.ts:167` — `getByText("Using it")` now resolves two elements: the visible `usage` tab button and the hidden `<summary>` inside `HowToUse` → strict-mode violation even before visibility is checked.
- `apps/e2e/tests/projects/git-automation.spec.ts:243`, `:253` — `getByText("Link a repository first.")` / the responder warning live only in the hidden `automation` panel.
- `apps/e2e/tests/projects/git-automation.spec.ts:266`, `:287`, `:302`, `:318` — `getByLabel("Default responder").selectOption(...)` and `getByText("Advanced").click()` target the hidden `automation` panel; Playwright actions require visibility.
- `apps/e2e/features/projects/git-*.feature` — scenarios read as sections ("the Automation section", "the \"Using it\" section"), not tabs.

## Required outcome
- The e2e suite must run green against the tabbed UI, and the feature files must describe what the UI now does.

## Suggested approach
- Mirror the unit test's helper: click `getByRole("tab", { name: … })` before asserting Automation/Usage content.
- Disambiguate `"Using it"` (scope to the `usage` panel or match the CopyChip example) since the label now also names a tab.
- The default-tab logic intentionally opens `connections` when a project has none; `git-settings.spec.ts` "No provider is installed" should therefore either switch to the Repositories tab or assert the Connections empty state instead.

## Open questions
- Are the tabs meant to replace the stacked sections entirely, or should Automation/Usage remain visible (which would keep the existing specs valid)?

ℹ️ Unrelated sidebar change bundled into this PR

app-sidebar.tsx:2020 changes when the rail renders, which has nothing to do with the Git settings title. The behavior itself looks coherent (sidebar-navigation.spec.ts:491-506 already collapses via the trigger before clicking the rail), so this is a scope note rather than a defect.

Technical details
# Unrelated sidebar change bundled into a Git-settings PR

## Affected sites
- `apps/web/src/components/app-shell/app-sidebar.tsx:2020` — `<SidebarRail />` now renders only when `sidebarState === "collapsed"` (was unconditional).

## Required outcome
- Confirm this is intentional and adjust the PR title/description (or split it out) so the sidebar change is captured in release notes and reviewable on its own.

## Open questions
- Should the rail change be split into its own PR?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found.

Reviewed changes

  • Playwright specs now switch tabs — git-automation.spec.ts gains an openAutomation helper (clicking getByRole("tab", { name: /^Automation/ })) and calls it in every Automation test; the linked-repository test asserts the Using it tab by role instead of ambiguous text.
  • git-settings.spec.ts opens the Repositories tab — the "No provider is installed" test clicks the tab first and scopes the empty-state locator to getByRole("tabpanel", { name: /^Repositories/ }).
  • Feature file wording follows the UI — git-automation.feature says "Automation tab" / "Using it tab" instead of section.
  • Selected-tab fallback fixed — current is now clamped to the tabs that exist (tabs.some((x) => x.id === tab) ? tab : fallback), so a remembered usage tab that disappears when the last repository is unlinked lands on a real tab rather than leaving no tab selected.
  • Fallback covered by a unit test — new GitSettings.test.tsx case drives repositories to empty via client.invalidateQueries() and asserts a tab stays selected.

The e2e suite and feature files were the prior review's only outstanding concern; both are now handled, and the change reads consistently with the tabbed UI. The bundled sidebar rail change remains a scope note (documented in the PR description), not a defect.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

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

✅ No new issues found.

Reviewed changes

  • Initial tab is now frozen in a ref — opened.current is captured on the first render with data (connections-first when the project has none, else repositories), so adding the first connection no longer moves the user off the tab they opened on; current is clamped to the tabs that exist.
  • Skeleton waits on the connections query — connections.isLoading joins providers/repos in the guard, so connectionCount is settled before the default tab is chosen.
  • Keyboard nav extended to Home/End — Home jumps to the first tab, End to the last, alongside the existing arrow wrap and roving tabIndex.
  • Tablist made scrollable — overflow-x-auto on the tablist and shrink-0 on the buttons keep badges from being squeezed on narrow widths.
  • Tests added — first connection stays on Connections, a half-typed repository survives an Automation round-trip, and Home/End/ArrowLeft focus movement; the e2e linked-repository assertions are now scoped to the visible Repositories tabpanel and disambiguate Using it by role.

Both prior Pullfrog threads are resolved and the change reads consistently with the tabbed UI. Build/tests could not be executed in this image (no node_modules), so this is a static review.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@pikann
pikann merged commit ba38b75 into master Nov 3, 2026
3 checks passed
@pikann
pikann deleted the feature/enhance-project-git-setting-uxui branch November 3, 2026 15:53
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.

1 participant