Skip to content

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 29, 2026

Benchmark PR from agentic-review-benchmarks#9

Summary by CodeRabbit

  • Removed Features

    • QR code scanning functionality, including the toolbar button and quick action shortcut, has been removed from the app.
  • Version Update

    • Updated to version 147.2.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Walkthrough

This pull request removes QR code functionality from the Firefox iOS codebase. The changes eliminate the QR code shortcut option, toolbar action, scanning capability, and associated routing, telemetry tracking, and tests across the application.

Changes

Cohort / File(s) Summary
Version Configuration
firefox-ios/Client/Configuration/version.xcconfig
Bumped APP_VERSION from 147.1 to 147.2.
Routing & Coordination
firefox-ios/Client/Application/QuickActions.swift, firefox-ios/Client/Coordinators/Router/Route.swift, firefox-ios/Client/Coordinators/Router/DeeplinkInput.swift, firefox-ios/Client/Coordinators/Router/RouteBuilder.swift, firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift
Removed QR code cases from ShortcutType enum, AppAction enum, Shortcut enum, and route builder switch statement. Removed handleQRCode() delegate method and associated route handling from BrowserCoordinator.
UI Actions & Display State
firefox-ios/Client/Frontend/Browser/BrowserViewController/Actions/GeneralBrowserAction.swift, firefox-ios/Client/Frontend/Browser/BrowserViewController/State/BrowserViewControllerState.swift, firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarActionConfiguration.swift
Removed showQRcodeReader case from GeneralBrowserActionType, qrCodeReader variant from DisplayType, and qrCode case from ToolbarActionConfiguration.ActionType. Updated reader mode handling to use long-press variant.
BrowserViewController QR Code Removal
firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift
Removed QRCodeViewControllerDelegate conformance and all related methods: handleQRCode(), didScanQRCodeWithURL(), didScanQRCodeWithTextContent(), and qrCodeScanningPermissionLevel override.
Telemetry & Metrics
firefox-ios/Client/Frontend/Browser/Toolbars/ToolbarTelemetry.swift, firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarMiddleware.swift, firefox-ios/Client/Telemetry/TelemetryWrapper.swift, firefox-ios/Client/Glean/probes/toolbar.yaml, firefox-ios/Client/Glean/probes/metrics.yaml
Removed qrCodeButtonTapped() method from ToolbarTelemetry and made gleanWrapper non-private. Removed qrCode case handling from ToolbarMiddleware. Modified telemetry logic in cancelEditMode() and recordReaderModeTelemetry(). Deleted qrCodeText and qrCodeURL cases from EventObject enum. Removed toolbar.qr_scan_button_tapped and qr_code.scanned metric definitions. Updated reading_list.add description in metrics.yaml.
Tests
firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/BrowserCoordinatorTests.swift, firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/ShortcutRouteTests.swift, firefox-ios/firefox-ios-tests/Tests/ClientTests/Toolbar/ToolbarMiddlewareTests.swift, firefox-ios/firefox-ios-tests/Tests/ClientTests/Mocks/MockBrowserViewController.swift
Removed testHandleHandleQRCode_returnsTrue(), testQRCodeShortcut(), testDidTapButton_tapOnQrCodeButton_dispatchesAddNewTab(), testDidTapButton_tapOnQrCodeButton_whenInEditMode_dispatchesCancelEditAndAddNewTab(). Removed qrCodeCount property and handleQRCode() override from MockBrowserViewController.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Whiskers twitching with delight,
QR codes hopped right out of sight!
The code is clean, the paths are clear,
A simpler app for all to cheer! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing QR code related code from the BVC (BrowserViewController), which aligns with the extensive removal of QR code handling across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
firefox-ios/Client/Frontend/Browser/BrowserViewController/State/BrowserViewControllerState.swift (1)

558-568: Remove the unused .readerMode display type case and dead code path.

This change unifies reader mode handling by mapping both tap (showReaderMode) and long-press (addToReadingListLongPressAction) actions to the .readerModeLongPressAction display type. However, this leaves dead code:

  1. The case .readerMode in the DisplayType enum (line 32) is never set by any reducer
  2. The corresponding switch case in BrowserViewController (line 2872-2875) is unreachable

Remove both the unused case readerMode from the DisplayType enum and the unreachable switch case from BrowserViewController.swift.

firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarMiddleware.swift (1)

520-529: Fix reader mode telemetry logic and parameter swap bug.

The recordReaderModeTelemetry logic has two issues:

  1. Incorrect mapping for .unavailable state: Currently maps to true, but should map to false since reader mode cannot be enabled when unavailable. Only .active should map to true.

  2. Critical parameter swap in ToolbarTelemetry.readerModeButtonTapped(): The function receives isPrivate and isEnabled but passes them to GleanMetrics.Toolbar.ReaderModeButtonTappedExtra with swapped parameters:

    • enabled: isPrivate (should be isEnabled)
    • isPrivate: isEnabled (should be isPrivate)

This corrupts all reader mode button tap telemetry data.

🧹 Nitpick comments (1)
firefox-ios/Client/Frontend/Browser/Toolbars/ToolbarTelemetry.swift (1)

8-13: Consider keeping gleanWrapper private.

The gleanWrapper property was changed from private to internal (default) visibility. Since dependency injection is already possible via the initializer parameter, exposing the property externally appears unnecessary and reduces encapsulation.

If this change was made for testing purposes (e.g., to verify the wrapper was set correctly), consider using private(set) instead to allow reading but prevent external modification, or keep it fully private if external access isn't required.

♻️ Suggested change to maintain encapsulation
 struct ToolbarTelemetry {
-    let gleanWrapper: GleanWrapper
+    private let gleanWrapper: GleanWrapper

Or if read access is needed for testing:

 struct ToolbarTelemetry {
-    let gleanWrapper: GleanWrapper
+    private(set) var gleanWrapper: GleanWrapper
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db5723b and de948b0.

📒 Files selected for processing (19)
  • firefox-ios/Client/Application/QuickActions.swift
  • firefox-ios/Client/Configuration/version.xcconfig
  • firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift
  • firefox-ios/Client/Coordinators/Router/DeeplinkInput.swift
  • firefox-ios/Client/Coordinators/Router/Route.swift
  • firefox-ios/Client/Coordinators/Router/RouteBuilder.swift
  • firefox-ios/Client/Frontend/Browser/BrowserViewController/Actions/GeneralBrowserAction.swift
  • firefox-ios/Client/Frontend/Browser/BrowserViewController/State/BrowserViewControllerState.swift
  • firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift
  • firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarActionConfiguration.swift
  • firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarMiddleware.swift
  • firefox-ios/Client/Frontend/Browser/Toolbars/ToolbarTelemetry.swift
  • firefox-ios/Client/Glean/probes/metrics.yaml
  • firefox-ios/Client/Glean/probes/toolbar.yaml
  • firefox-ios/Client/Telemetry/TelemetryWrapper.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/BrowserCoordinatorTests.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/ShortcutRouteTests.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Mocks/MockBrowserViewController.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Toolbar/ToolbarMiddlewareTests.swift
💤 Files with no reviewable changes (15)
  • firefox-ios/Client/Telemetry/TelemetryWrapper.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/ShortcutRouteTests.swift
  • firefox-ios/Client/Coordinators/Router/RouteBuilder.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Toolbar/ToolbarMiddlewareTests.swift
  • firefox-ios/Client/Coordinators/Router/Route.swift
  • firefox-ios/Client/Glean/probes/toolbar.yaml
  • firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift
  • firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Mocks/MockBrowserViewController.swift
  • firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarActionConfiguration.swift
  • firefox-ios/Client/Glean/probes/metrics.yaml
  • firefox-ios/Client/Application/QuickActions.swift
  • firefox-ios/firefox-ios-tests/Tests/ClientTests/Coordinators/BrowserCoordinatorTests.swift
  • firefox-ios/Client/Coordinators/Router/DeeplinkInput.swift
  • firefox-ios/Client/Frontend/Browser/BrowserViewController/Actions/GeneralBrowserAction.swift
🧰 Additional context used
🧬 Code graph analysis (1)
firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarMiddleware.swift (2)
firefox-ios/Client/TabManagement/Tab.swift (1)
  • currentURL (1022-1024)
BrowserKit/Sources/Common/Extensions/URLExtension.swift (1)
  • isWebPage (297-300)
🔇 Additional comments (2)
firefox-ios/Client/Configuration/version.xcconfig (1)

1-1: LGTM!

Version bump to 147.2 is appropriate for this feature removal PR.

firefox-ios/Client/Frontend/Browser/Toolbars/Redux/ToolbarMiddleware.swift (1)

482-488: LGTM!

Good fix to preserve reader mode URLs when canceling edit mode. Since isWebPage() only matches http/https/data schemes, reader mode URLs would previously be incorrectly set to nil. This change ensures the URL bar correctly retains the reader mode URL.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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.

3 participants