Skip to content

iOS: Localize NTP-after-idle settings strings + escape hatch tab switcher pixel#4787

Open
SabrinaTardio wants to merge 1 commit into
sabrina/ntp-after-idle-user-settingfrom
sabrina/ntp-idle-l10n-and-pixel
Open

iOS: Localize NTP-after-idle settings strings + escape hatch tab switcher pixel#4787
SabrinaTardio wants to merge 1 commit into
sabrina/ntp-after-idle-user-settingfrom
sabrina/ntp-idle-l10n-and-pixel

Conversation

@SabrinaTardio
Copy link
Copy Markdown
Contributor

@SabrinaTardio SabrinaTardio commented May 8, 2026

Task/Issue URL: https://app.asana.com/0/0/1214420688003519
Tech Design URL:
CC:

Description

Two small follow-ups to #4669, kept on a separate branch so translations can be requested without blocking the parent PR.

  1. Localize the three new copy strings that were previously gated behind `NotLocalizedString`:
    • `settings.afterInactivity.interval.label` — picker label Inactivity Timer
    • `settings.afterInactivity.idle.interval.always` — option None
    • `settings.afterInactivity.footer.always` — footer Choose what you see when you return to DuckDuckGo.
      Switched to `NSLocalizedString` and added matching entries to `en.lproj/Localizable.strings` so they're picked up by the translation pipeline.
  2. Add a pixel for the escape hatch tab switcher pill (`m_ntp_after_idle_escape_hatch_tab_switcher_tapped_after_idle`). The escape hatch is only shown after idle return, so a single after-idle pixel is sufficient — no user-initiated variant. Wired through `NTPAfterIdleInstrumentation.escapeHatchTabSwitcherTapped()` and fired from `MainViewController.newTabPageDidRequestTabSwitcher(_:)`. Pixel definition added under `PixelDefinitions/pixels/definitions/ntp_after_idle.json5`.

Testing Steps

  1. Build and run with the `showNTPAfterIdleReturn` subfeature enabled.
  2. Open Settings → General → confirm the Opening Screen / Inactivity Timer / None / footer copy renders correctly.
  3. Trigger the escape hatch (background the app long enough for the idle threshold, foreground it on a tab with content). Tap the round tab-switcher pill next to the Return to… card. Confirm `m_ntp_after_idle_escape_hatch_tab_switcher_tapped_after_idle` fires.

Impact and Risks

Low. Localization change is purely additive (no behavioral effect). The new pixel is in the existing daily-and-count instrumentation pipeline.

What could go wrong?

  • Translations land empty until the pipeline catches up — the strings have English source values via `NSLocalizedString`, so missing translations fall back to English.
  • The pixel could mis-fire if some other path calls `newTabPageDidRequestTabSwitcher(_:)`. I checked: only the escape hatch pill calls it.

Quality Considerations

  • Tests added/updated for the new instrumentation method (after-idle pixel + ineligibility no-op).

Notes to Reviewer

This stacks on top of #4669; merge order should be #4669 first, then this.


Internal references:

Definition of Done | Engineering Expectations | Tech Design Template


Note

Low Risk
Low risk: primarily localization key plumbing and a new analytics pixel; behavior change is limited to firing an additional event when opening the tab switcher from the escape hatch.

Overview
Adds a new NTP-after-idle analytics event for tapping the escape-hatch tab switcher pill (m_ntp_after_idle_escape_hatch_tab_switcher_tapped_after_idle), wiring it through NTPAfterIdleInstrumentation.escapeHatchTabSwitcherTapped() and firing it from MainViewController.newTabPageDidRequestTabSwitcher(_:) with updated pixel definitions and tests.

Updates after-inactivity settings copy to be fully localized by switching previously NotLocalizedString entries to NSLocalizedString, adding en.lproj string keys, and renaming the idle interval case from .always to .none with corresponding footer text logic and test updates.

Reviewed by Cursor Bugbot for commit 0d631a9. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Messages
📖

You seem to be updating localized strings. Make sure that you request translations and include translated strings before you ship your change. See iOS and macOS localization guidelines for more information.

Generated by 🚫 dangerJS against 0d631a9

Comment thread iOS/DuckDuckGoTests/NTPAfterIdleInstrumentationTests.swift
@SabrinaTardio SabrinaTardio force-pushed the sabrina/ntp-idle-l10n-and-pixel branch from f61b81f to 21e2760 Compare May 8, 2026 09:31
@SabrinaTardio SabrinaTardio force-pushed the sabrina/ntp-idle-l10n-and-pixel branch from 21e2760 to 0d631a9 Compare May 8, 2026 09:39
@SabrinaTardio SabrinaTardio added the start ios translation Starts iOS translation workflow via Smartling label May 8, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0d631a9. Configure here.

}

func newTabPageDidRequestTabSwitcher(_ controller: NewTabPageViewController) {
ntpAfterIdleInstrumentation.escapeHatchTabSwitcherTapped()
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.

Escape hatch pixel missing from unified input path

Medium Severity

The new escapeHatchTabSwitcherTapped() pixel is only fired from newTabPageDidRequestTabSwitcher, which handles taps on the NTP's escape hatch pill. However, the same escape hatch pill also appears in the AI chat / unified input context via configureUnifiedInputEscapeHatch, where the onTabSwitcherTapped closure at line 1629 calls showTabSwitcher() directly without firing ntpAfterIdleInstrumentation.escapeHatchTabSwitcherTapped(). This means the pixel undercounts when the user taps the escape hatch tab switcher pill while in the expanded omnibar/AI chat state after idle return.


Please tell me if this was useful or not with a 👍 or 👎.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0d631a9. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

🌍 Smartling Translation Job Created

Job ID: jwpgedtyko8t
Platform: iOS

🔗 View in Smartling Dashboard

🔧 View Workflow Run

Next:

  • Review translation job
  • Authorize translation by adding the authorize translation label

@github-actions github-actions Bot added needs translation authorization The Smartling translation job the PR is awaiting authorization. and removed start ios translation Starts iOS translation workflow via Smartling labels May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs translation authorization The Smartling translation job the PR is awaiting authorization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant