Skip to content

Fix search focus and sidebar animation - #319

Open
Adrianogba wants to merge 9 commits into
Homebrew:mainfrom
Adrianogba:fix/search-focus-and-sidebar-animation
Open

Adrianogba wants to merge 9 commits into
Homebrew:mainfrom
Adrianogba:fix/search-focus-and-sidebar-animation

Conversation

@Adrianogba

Copy link
Copy Markdown
Contributor

What and why

There were some icons appearing on top right search bar for a moment on transitions and the animation when expanding was jumping from a certain moment and was not smooth as on shrinking, to fix these here is what was done:

  • Fixes toolbar and navigation regressions when switching between Installed, Upgrades and Discover
  • Replaces the transient SwiftUI search toolbar control with one stable AppKit search field shared by searchable screens.
  • Preserves search focus when moving to Discover.
  • Reworks the split-view hosting so console and feature updates do not rebuild the main content tree.

Replaces the system sidebar toggle with an explicit control and applies the shared sidebar spring animation, removing the jump when expanding the sidebar.

Validation

  • xcodebuild build: passed on macOS 27.2, Apple Silicon, Xcode 27.2, Swift 6.4.2.

  • scripts/test: passed on the same Mac.

  • I followed the conventions and workflow, checked for duplicate PRs and kept this change focused.

  • I added regression coverage for bug fixes or explained why automated coverage is impractical, and reported the relevant validation above.

Screenshots

Before After
Screen.Recording.2026-11-08.at.02.15.08.mov
Screen.Recording.2026-11-08.at.03.02.17.mov

AI assistance

  • AI was used to generate or assist with generating this PR.

Gemini Carbon assisted with implementation, code review and build/test execution.

@Adrianogba
Adrianogba marked this pull request as ready for review November 12, 2026 11:00
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added a shared toolbar search field for Installed, Upgrades and Discover. Search terms clear when switching sections, and focus is restored when appropriate.
    • Search results in Discover and Installed/Upgrades stay in sync with the shared field as you type.
    • Added an animated toolbar button to show or hide the sidebar, with matching labels and help text.
    • Added section-specific titles and subtitles.
  • Localisation
    • Added Korean, Swedish, Simplified Chinese and Traditional Chinese translations for the sidebar controls.
    • Added translations of the unexpected-quit dialog title in Spanish, Korean, Swedish, Simplified Chinese and Traditional Chinese.

The main window now controls split-view visibility and provides a shared toolbar search field for Installed, Upgrades and Discover. These views synchronise the query with their view models. The diff also changes top-host updates in AnimatedSplit, a UI test selector, Discover test expectations, workflow validation and localised strings.

Changes: Shared search and navigation

Layer / File(s) Summary
Window navigation and shared search control
Homebrew/Features/MainWindow/Views/MainWindowView.swift, Homebrew/Features/MainWindow/Views/ToolbarSearchField.swift, Homebrew/Localizable.xcstrings
MainWindowView controls split-view visibility and hosts search for supported tabs. ToolbarSearchField synchronises query text and focus. The catalogue adds sidebar labels and an unexpected app-quit dialog title. Other translation blocks are reordered, and a Korean password prompt translation is added.
Installed and Upgrades query binding
Sources/BrewFeatureInstalled/Views/InstalledUpgradesColumns.swift
InstalledUpgradesRoot passes a search-query binding to its container. The container synchronises the binding with the active view model and removes its local search-field modifiers.
Discover query binding and validation
Sources/BrewFeatureDiscover/Views/DiscoverColumns.swift, Sources/BrewFeatureDiscover/Views/DiscoverPackagesView.swift, Tests/BrewFeatureDiscoverTests/*
Discover passes the query binding to DiscoverPackagesView, which synchronises it with viewModel.query and changes list focus handling. Tests provide the binding and use locale-formatted install-count expectations.

Animated split host updates

Layer / File(s) Summary
Top hosted view update behaviour
Sources/BrewUIComponents/Views/AnimatedSplit.swift
AnimatedSplit no longer refreshes its top hosted view during updates.

Button accessibility selector

Layer / File(s) Summary
Button element selection
BrewUITests/Elements/BrewUIButton.swift
BrewUIButton now queries the button accessibility role.

Workflow validation

Layer / File(s) Summary
Signing identity and version checks
.github/workflows/build.yml, .github/workflows/release.yml
The workflows replace grep-based checks with Bash pattern matching while retaining the missing-identity error handling and numeric major.minor.patch version pattern.
Merge Risk: Minimal · up to ef6cc

The change replaces the transient search control with a stable toolbar search field and fixes sidebar animation. No concrete defect remains at this revision; the earlier focus-interruption concern is handled by the added search-focus flag. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two main changes in the PR: the search focus fix and the sidebar animation fix. Both match the raw summary and the PR objectives, so the title is accurate and specific.
Description check Passed The description explains the search toolbar and focus fixes, the split-view hosting rework, and the explicit sidebar control with the shared spring animation. These match the changeset. It also lists …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the search toolbar and focus fixes, the split-view hosting rework, and the explicit sidebar control with the shared spring animation. These match the changeset. It also lists validation steps and AI assistance.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Homebrew/BrewUI
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: f6d4081
  • Layers: Repository TS config (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 248ae32f-c782-45f8-b5d3-6d02465323b9
Commits

Reviewing files that changed from the base of the PR and between c169b8c and ef6ccd3.

Files selected for processing: 1

  • Homebrew/Localizable.xcstrings
Files skipped from review as they are similar to previous changes: 1

  • Homebrew/Localizable.xcstrings

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Nitpick comments: 1

Sources/BrewFeatureInstalled/Views/InstalledUpgradesColumns.swift: 1

198-203: Trivial · Maintainability & Code Quality · Quick win

Remove the unused activeSearchPrompt.

The window now reads the prompt from InstalledUpgradesRoot.searchPrompt(for:). This property duplicates those strings and has no caller in the supplied code. Delete it. The leftover SearchFocusArbiter and @FocusState wiring in this container (lines 62-63, 102-132) also never receives .searchField focus now that the field is in the window. Check whether it can go too.

Review info

Run configuration

  • Source mode: Auto
  • Repository: Homebrew/BrewUI
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 772676d
  • Layers: Repository TS config (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 60d1a1f9-feaa-4db8-8d3c-09b7b3c1168e
Commits

Reviewing files that changed from the base of the PR and between 772676d and 46749b3.

Files selected for processing: 10

  • BrewUITests/Elements/BrewUIButton.swift
  • Homebrew/Features/MainWindow/Views/MainWindowView.swift
  • Homebrew/Features/MainWindow/Views/ToolbarSearchField.swift
  • Sources/BrewFeatureDiscover/Views/DiscoverColumns.swift
  • Sources/BrewFeatureDiscover/Views/DiscoverPackagesView.swift
  • Sources/BrewFeatureInstalled/Views/InstalledUpgradesColumns.swift
  • Sources/BrewUIComponents/Views/AnimatedSplit.swift
  • Tests/BrewFeatureDiscoverTests/DiscoverListRowViewModelTests.swift
  • Tests/BrewFeatureDiscoverTests/DiscoverPackageDetailViewModelTests.swift
  • Tests/BrewFeatureDiscoverTests/PackageListBannerSlotTests.swift
Files with no reviewable changes: 1

  • Sources/BrewUIComponents/Views/AnimatedSplit.swift

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Homebrew/BrewUI
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 772676d
  • Layers: Repository TS config (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3021f578-16d4-4ca6-acf0-65eb18d43676
Commits

Reviewing files that changed from the base of the PR and between dec457c and c008e38.

Files selected for processing: 3

  • Homebrew/Features/MainWindow/Views/MainWindowView.swift
  • Homebrew/Localizable.xcstrings
  • Sources/BrewFeatureDiscover/Views/DiscoverPackagesView.swift
Files skipped from review as they are similar to previous changes: 1

  • Homebrew/Features/MainWindow/Views/MainWindowView.swift

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions Bot added the Stale label Dec 4, 2026
@Adrianogba
Adrianogba force-pushed the fix/search-focus-and-sidebar-animation branch from e560b3a to 3672935 Compare December 4, 2026 04:41
@github-actions github-actions Bot removed the Stale label Dec 4, 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.

1 participant