Skip to content

Conversation

dus7
Copy link
Contributor

@dus7 dus7 commented Oct 15, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1206226850447395/task/1211559392963008?focus=true
Tech Design URL:
CC:

Description

Show microphone button in input field on empty state so the height is consistent regardless of private voice search setting. Only for bottom bar setting.

Testing Steps

  1. Enable new Search Input, Private Voice Search and set bar location to bottom.
  2. Focus on NTP, voice button should be visible inside text view.
  3. Type anything, the voice button should disappear and clear button should become visible.
  4. Open a website, focus on the field. Verify microphone button is on the bottom row next to the search button.
  5. Clear the text. Verify microphone button is only visible inside the text view.
  6. Rotate to landscape. Microphone should be floating above keyboard.

Impact and Risks

Medium: Could disrupt specific features or user flows

What could go wrong?

Quality Considerations

Notes to Reviewer


Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Displays a voice button inside the input when bottom bar is empty and manages button visibility via SwitchBarHandler with new publishers and UI wiring, plus tests.

  • UI/Behavior:
    • NavigationActionBarViewModel.shouldShowMicButton: mic shown without text only for top bar; for bottom bar mic moves inside input; simplified logic.
    • SwitchBarTextEntryView: uses handler-driven buttonState; adds voice button tap -> microphoneButtonTapped(); adjusts text inset for any button.
    • SwitchBarButtonsView: adds voiceOnly state, voice button UI, accessibility, and showsAnyButton handling.
  • State Management:
    • SwitchBarHandling/SwitchBarHandler:
      • New buttonState, isTopBarPosition, currentButtonStatePublisher, and updateBarPosition(isTop:).
      • updateButtonState determines .clearOnly (has text), .voiceOnly (empty + voice enabled + bottom bar), or .noButtons.
      • Publishes button state changes and updates on text/position changes.
    • OmniBarEditingStateViewController: updates bar position on orientation/position changes to drive button state; installs action bar in text entry view for bottom position.
  • Tests:
    • SwitchBarHandlerTests: add cases validating voice button visibility across top/bottom, with/without text, and when disabled.

Written by Cursor Bugbot for commit 5baf32f. This will update automatically on new commits. Configure here.

@dus7 dus7 requested review from Bunn and Copilot and removed request for Copilot October 15, 2025 13:07
cursor[bot]

This comment was marked as outdated.

@Copilot Copilot AI review requested due to automatic review settings October 15, 2025 13:48
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements consistent microphone button placement in the search input field when using the bottom bar configuration. The main purpose is to show the microphone button inside the input field when it's empty and voice search is enabled, maintaining consistent height regardless of the voice search setting.

Key changes:

  • Added centralized button state management with three states: .noButtons, .clearOnly, and .voiceOnly
  • Modified UI components to handle the new voice button state and positioning logic
  • Updated navigation bar logic to show microphone appropriately based on bar position and user interaction

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SwitchBarHandlerTests.swift Added comprehensive unit tests for voice button visibility across different bar positions and text states
SwitchBarTextEntryView.swift Updated to use centralized button state from handler and added voice button tap handling
SwitchBarButtonsView.swift Extended button state enum and UI to support voice button with proper accessibility
SwitchBarHandler.swift Added button state management, bar position tracking, and logic for determining when to show voice button
OmniBarEditingStateViewController.swift Added bar position updates to handler when orientation or position changes
NavigationActionBarViewModel.swift Refined microphone button logic to consider bar position and user interaction

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dus7 dus7 merged commit 8d70273 into main Oct 16, 2025
23 checks passed
@dus7 dus7 deleted the mariusz/single-line-voice branch October 16, 2025 09:52
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.

2 participants