Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
fedb702
BugFix Strings comment typos (#33189)
jeis4wpi Apr 21, 2026
118d663
Add [Quick Answers] FXIOS-15475 Privacy Button (#33198)
FilippoZazzeroni Apr 21, 2026
c5450ef
[MTE-5289] - skip iPad undo tests (#33230)
dragosb01 Apr 21, 2026
514658e
Bugfix MTE-5291 Workaround for reCAPTCHA from Mozilla account login (…
clarmso Apr 21, 2026
799c1a4
Refactor FXIOS-154667 [AI KIll Switch] Update caps on blocked status …
Cramsden Apr 21, 2026
2dbae35
Refactor FXIOS-15362 [Technical Debt] [Redux] Apply copyWithUpdates t…
Keuha Apr 21, 2026
87dcc16
Refactor FXIOS-15232 [FeatureFlags] Remove position feature flag, and…
adudenamedruby Apr 21, 2026
e9a730d
Add FXIOS-15485 [Newsfeed Categories] Per-tab newsfeed category picke…
Foxbolts Apr 21, 2026
2b2bf36
Bugfix FXIOS-15440 [Tab manager] Intermittent blank page when opening…
lmarceau Apr 21, 2026
279eb62
Add MTE-5285 Automatically Update Kingfisher dependency (#33158)
isabelrios Apr 21, 2026
057f416
Bugfix MTE-5050 L10nScreenshots does not compile (#33223)
clarmso Apr 21, 2026
b586601
Refactor FXiOS-15459 [AI KIll Switch] clean up theming and ui (#33184)
Cramsden Apr 21, 2026
12d10f5
Refactor FXIOS-15190 [FeatureFlags] migrate adsClient (#33240)
adudenamedruby Apr 21, 2026
c9e799a
Refactor FXIOS-15493 [FeatureFlags] migrate aiKillSwitch (#33243)
adudenamedruby Apr 21, 2026
1d047f4
Refactor FXIOS-15494 [FeatureFlags] migrate appearanceMenu (#33246)
adudenamedruby Apr 21, 2026
1677f27
Refactor FXIOS-15495 [FeatureFlags] migrate appIconSelection (#33249)
adudenamedruby Apr 21, 2026
25956f0
Refactor FXIOS-15497 [FeatureFlags] migrate badCertDomainErrorPage (#…
adudenamedruby Apr 21, 2026
37e476d
Refactor FXIOS-15498 [FeatureFlags] migrate bookmarksSearchFeature (#…
adudenamedruby Apr 21, 2026
8b89831
Refactor FXIOS-15499 [FeatureFlags] migrate deeplinkOptimizationFeatu…
adudenamedruby Apr 21, 2026
38214ef
Refactor FXIOS-15358 [Technical Debt] [Redux] Use @CopyWithUpdates ma…
Kartikayy007 Apr 21, 2026
e626f2b
Remove FXIOS-14751 [iPad Tab Tray Design] Consistent design with new…
yoanarios Apr 21, 2026
676baa5
Refactor FXIOS-15500 [FeatureFlags] migrate downloadLiveActivities (#…
adudenamedruby Apr 21, 2026
c0e14a8
Bugfix FXIOS-15339 [Tab management] Tab closed crashes when media pre…
lmarceau Apr 22, 2026
74daadb
Bugfix FXIOS-15230 [Translations Phase 2] Long-press active translate…
razvanlitianu Apr 22, 2026
ba01fe7
Bugfix MTE-5050 Missing definition in extension XCUIElement for L10n …
clarmso Apr 22, 2026
9d0b67b
Add FXIOS-15550 [News Transition] Chip button shadows (#33328)
Foxbolts Apr 22, 2026
5ed3e0f
Refactor FXIOS-15544 [AI Controls] Remove duplicate setting of toggle…
Cramsden Apr 22, 2026
16573e0
Refactor FXIOS-15501 [FeatureFlags] migrate firefoxJpGuideDefaultSite…
adudenamedruby Apr 22, 2026
be6451e
Add [Quick Answers] FXIOS-14861 Homepage quick answers button (#33231)
FilippoZazzeroni Apr 22, 2026
fa46823
Add [Quick Answers] FXIOS-15244 Content View part 2 (#33234)
FilippoZazzeroni Apr 22, 2026
c8b218f
Refactor FXIOS-15502 [FeatureFlags] migrate firefoxSuggestFeature (#3…
adudenamedruby Apr 22, 2026
a58de49
Refactor FXIOS-15503 [FeatureFlags] migrate hntSponsoredShortcuts (#3…
adudenamedruby Apr 22, 2026
6db443a
Bugfix FXIOS-14599 [Tab Tray] Tab dismissal animation stutters on lan…
hot666666 Apr 22, 2026
2fe2d3c
Bugfix FXIOS-15491 [Unit Test] failing SpeechAnalyzerTests (#33310)
cyndichin Apr 22, 2026
24bd760
Refactor FXIOS-15504 [FeatureFlags] migrate homepageBookmarksSectionD…
adudenamedruby Apr 22, 2026
493ce9d
Refactor FXIOS-15505 [FeatureFlags] migrate homepageJumpBackinSection…
adudenamedruby Apr 22, 2026
baadbd5
Refactor FXIOS-15506 [FeatureFlags] migrate homepageSearchBar (#33355)
adudenamedruby Apr 22, 2026
8e83bc3
Fix shortcut row count not updating after dismissing settings sheet (…
sushanttiwari-14 Apr 22, 2026
a454a5b
Refactor FXIOS-15357 [Technical Debt] [Redux] Use @CopyWithUpdates ma…
Kartikayy007 Apr 22, 2026
c9d1392
Refactor FXIOS-15359 [Technical Debt] [Redux] Use @CopyWithUpdates ma…
satomasahiro2005 Apr 22, 2026
e358209
Bugfix FXIOS‑15323 [Bookmarks] Adjust bookmarks panel search bar inse…
hot666666 Apr 22, 2026
0bbe482
Refactor FXIOS-15348 [Technical Debt] [Redux] Use @CopyWithUpdates ma…
Kartikayy007 Apr 22, 2026
4cc1a8a
Refactor FXIOS-15507 [FeatureFlags] migrate homepageStoryCategories (…
adudenamedruby Apr 22, 2026
f18ab04
Refactor FXIOS-15508 [FeatureFlags] migrate needsReloadRefactor (#33359)
adudenamedruby Apr 22, 2026
b8a537f
Bugfix FXIOS-15571 [Homepage] Homepage section header action button w…
Foxbolts Apr 23, 2026
230942e
(Local AS flow) Nightly auto-update (151.0.20260418050219) (#33185)
github-actions[bot] Apr 23, 2026
020ef81
FXIOS-15349 refactor: [Technical Debt] [Redux] Use @CopyWithUpdates m…
Kartikayy007 Apr 23, 2026
0e04dea
Bugfix FXIOS-15386 [Translations Phase 2] Auto-translate prompt not v…
razvanlitianu Apr 23, 2026
1cc7150
BugFix FXIOS-15575 [Translations Phase 2] Revert bold title for 'Tran…
razvanlitianu Apr 23, 2026
8bfd2c1
Add FXIOS-15559 [Translations Phase 2] Enable translations phase 1 by…
razvanlitianu Apr 23, 2026
3ea040f
Add [World Cup] FXIOS-15457 Strings (#33245)
FilippoZazzeroni Apr 23, 2026
eac6124
FXIOS-15352 refactor: [Technical Debt] [Redux] Use @CopyWithUpdates m…
Kartikayy007 Apr 23, 2026
b912e7d
Add [World Cup] FXIOS-15581 world cup feature flag (#33380)
FilippoZazzeroni Apr 23, 2026
a2e7570
Bugfix FXIOS-11802 ⁃ [Autofill and Passwords] Saved Address bar in la…
dicarobinho Apr 23, 2026
566eb90
Add FXIOS-15146 [Quick Answers] creating llm client in results servic…
cyndichin Apr 23, 2026
09bbe67
Add FXIOS [Contiles] Add test to ensure extra field is fine (#33361)
lmarceau Apr 23, 2026
825ba76
Refactor FXIOS-15509 [FeatureFlags] migrate shouldUseBrandRefreshConf…
adudenamedruby Apr 23, 2026
c204477
Refactor FXIOS-15510 [FeatureFlags] migrate shouldUseJapanConfigurati…
adudenamedruby Apr 23, 2026
b96126d
Refactor FXIOS-14751 [iPad Tab Tray Design] Consistent design with ne…
yoanarios Apr 23, 2026
8dcb3dd
Add FXIOS-5867 - Enable https auto upgrade (#33235)
issammani Apr 23, 2026
1fc2b1b
Bugfix FXIOS-15580 Fix flaky test_didSelectTargetLanguage_dispatchAct…
razvanlitianu Apr 23, 2026
e1d08aa
Remove FXIOS-15007 [TabManager] BackupCloseTab is never niled when th…
yoanarios Apr 23, 2026
c5fcb1d
Refactor FXIOS-15513/15514/15515 [FeatureFlags] migrate nativeErrorPa…
adudenamedruby Apr 23, 2026
b6c6072
[FXIOS-15569] Fix bug where matching engine names were both checked i…
mattreaganmozilla Apr 23, 2026
2d13996
Bugfix FXIOS-15375 [WebKit] Link previews should not (auto)play media…
lmarceau Apr 23, 2026
cf5990b
Bugfix FXIOS-15413 [Dangerfile] Bundle CodeUsageDetector notification…
lmarceau Apr 23, 2026
6d5951b
Refactor FXIOS-15517/15518/15519 [FeatureFlags] migrate sentFromFiref…
adudenamedruby Apr 23, 2026
b3a34c1
FXIOS-15354 refactor: [Technical Debt] [Redux] Use @CopyWithUpdates m…
Kartikayy007 Apr 23, 2026
b8900f7
Small clipboard test fix (#33411)
dragosb01 Apr 24, 2026
56865f3
Add [World Cup] FXIOS-15596 Homepage settings to enable/disable world…
FilippoZazzeroni Apr 24, 2026
be4f273
[MTE-5269]-add more bookmark tests (#33410)
dragosb01 Apr 24, 2026
e0d7743
BugFix FXIOS-15470 [Translations Phase 2] Fix toggle firing in edit m…
razvanlitianu Apr 24, 2026
e3a8df8
Refactor FXIOS-15197 [Quick Answers] search result to include sources…
cyndichin Apr 24, 2026
c62c7f5
Bugfix FXIOS-15556 [A11y] Revert FXIOS-14570 Update darkreader (#33418)
janbrasna Apr 24, 2026
e5979d3
FXIOS-15361 refactor: [Technical Debt] [Redux] Use @CopyWithUpdates m…
Kartikayy007 Apr 24, 2026
8027d27
Refactor FXIOS-15520-23 [FeatureFlags] migrate splashScreen, startAtH…
adudenamedruby Apr 24, 2026
b3bccd9
Refactor FXIOS-15524-29 [FeatureFlags] migrate summarizer features (#…
adudenamedruby Apr 24, 2026
972cb00
Localize FXIOS [Strings] Import l10n from 2026-04-23 for v151 (#33382)
github-actions[bot] Apr 24, 2026
ec82d42
Refactor FXIOS-15530-34 [FeatureFlags] migrate tab, toolbar, and tab …
adudenamedruby Apr 24, 2026
5d92e6e
Refactor FXIOS [Nimbus] Update initial experiments JSON for Nimbus (#…
github-actions[bot] Apr 24, 2026
951e9e7
Refactor FXIOS-15544 [AI Controls] Cancel task on deint and fix featu…
Cramsden Apr 24, 2026
da49e8a
Automatic version bump CLOSED TREE NO BUG a=release
releng-treescript[bot] Apr 24, 2026
9b7fdc2
FXIOS-15353 refactor: [Technical Debt] [Redux] Use @CopyWithUpdates m…
Kartikayy007 Apr 24, 2026
69ccdcf
Refactor FXIOS-15079 [Tab manager] Readability of didSelectedTabChang…
lmarceau Apr 24, 2026
a8e97ed
Refactor FXIOS-15535-40 [FeatureFlags] migrate tos, tou, translations…
adudenamedruby Apr 24, 2026
5019c5d
Refactor FXIOS-15541/42 [FeatureFlags] migrate videoIntroOnboarding, …
adudenamedruby Apr 24, 2026
2fde5a5
[no-ticket] Add fxios bootstrap to Claude skill (#33406)
clarmso Apr 24, 2026
a9b48c0
Refactor FXIOS [Icons] Update Firefox icons from Acorn repo (#33449)
github-actions[bot] Apr 26, 2026
8044adb
Reapply Web Viewer customizations on latest upstream (v148)
ctbeiser Mar 1, 2026
771275f
Liquid glass URL bar, tap-to-share, hide shield icon, suppress tooltips
ctbeiser Mar 1, 2026
6d85a55
Fix app name: replace PRODUCT_NAME Firefox Focus with Web Viewer
ctbeiser Mar 1, 2026
0d3b000
Update Xcode schemes to reflect Web Viewer product name
ctbeiser Mar 1, 2026
23a6cee
Use SwiftLint baseline in Focus build
ctbeiser Apr 21, 2026
5e405cf
Update accent styling and package pins
ctbeiser Apr 21, 2026
5927582
Add Archive.is button to Focus URL bar
ctbeiser Apr 21, 2026
9c58864
Add website dark mode to Focus
ctbeiser Apr 21, 2026
6598608
Speed up Focus build scripts
ctbeiser Apr 21, 2026
2d1ed4d
Handle Web Viewer PDF attachments
ctbeiser Apr 26, 2026
545a360
Merge fork main into rebase branch
ctbeiser Apr 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions .claude/skills/bootstrap/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: bootstrap
description: Setup both Firefox and Focus for iOS after fetching from git.
allowed-tools: Bash(brew *) Bash(which *)
---

First, check if `fxios` is installed:

```
which fxios
```

If it is not installed, run:

```
brew tap mozilla-mobile/fxios
brew install fxios
```

If it is installed, upgrade to the latest version:

```
brew upgrade fxios
```

Then run these steps in sequence from the root of the firefox-ios repository:

1. `fxios --version`
2. `fxios bootstrap --all`

Stop and report if any step fails.
101 changes: 101 additions & 0 deletions .github/workflows/check-kingfisher-dependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Create a PR to update Kingfisher to the newest version available
on:
schedule:
- cron: '0 8 * * 1'
workflow_dispatch:
inputs:
branchName:
description: 'Branch used as target for automation'
required: true
default: 'main'
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.10.16]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./test-fixtures/requirements.txt

- name: Update Kingfisher version in Package.swift and all Package.resolved files
run: |
python ./test-fixtures/update-kingfisher-version.py

- name: Get new Kingfisher version to be used in the PR info
run: |
if [ -f test-fixtures/newest_kingfisher_tag.txt ]; then
echo "kingfisher_version=$(cat test-fixtures/newest_kingfisher_tag.txt | tr -d '[:space:]')" >> $GITHUB_ENV
fi

- name: Remove temp file created to store the tag info
run: |
[ ! -e test-fixtures/newest_kingfisher_tag.txt ] || rm test-fixtures/newest_kingfisher_tag.txt

- name: Script to check if branch exists to not commit again
run: |-
branch=$(curl -X GET -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/mozilla-mobile/firefox-ios/branches?per_page=100 | jq -r '.[].name | select(contains("update-spm-new-kingfisher-tag-${{ env.kingfisher_version }}"))')
echo $branch
if [ -z "$branch" ]; then echo "BRANCH_CREATED=false" >> $GITHUB_ENV; else echo "BRANCH_CREATED=true" >> $GITHUB_ENV; fi

- name: Determine PR Version Number
id: versioning
run: |
output=$(bash test-fixtures/ci/get-next-pr-version)
echo "$output"
next_version=$(echo "$output" | tail -n 1)
echo "Next Firefox iOS version is: v${next_version}"
echo "next_app_version=${next_version}" >> $GITHUB_ENV

- name: Stage updated files
if: env.BRANCH_CREATED == 'false' && env.kingfisher_version != ''
run: |-
git diff
git diff --quiet || (git add \
BrowserKit/Package.swift \
BrowserKit/Package.resolved \
firefox-ios/Client.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved \
SampleComponentLibraryApp/SampleComponentLibraryApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved \
focus-ios/Blockzilla.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
if: env.BRANCH_CREATED == 'false' && env.kingfisher_version != ''
with:
commit-message: Auto update SPM with latest Kingfisher release ${{ env.kingfisher_version }}
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: GitHub <noreply@github.com>
title: Bump FXIOS [Dependency] Auto update SPM for v${{ env.next_app_version }} with latest Kingfisher ${{ env.kingfisher_version }}
branch: update-spm-new-kingfisher-tag-${{ env.kingfisher_version }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set job log URL
if: always()
run: echo "JOB_LOG_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV

- name: Send Slack notification if action fails
if: '!cancelled()'
id: slack
uses: slackapi/slack-github-action@v2.0.0
env:
ACTION_NAME: Kingfisher dependency update
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-generic.json"
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
3 changes: 2 additions & 1 deletion .github/workflows/firefox-ios-autofill-playwrite-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ jobs:
id: slack
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill-test.json"
payload-file-path: "./test-fixtures/ci/slack-notification-payload-generic.json"
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
ACTION_NAME: credential provider playwrite tests
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ jobs:
id: slack
uses: slackapi/slack-github-action@v2.0.0
env:
ACTION_NAME: credential provider script
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill.json"
payload-file-path: "./test-fixtures/ci/slack-notification-payload-generic.json"
payload-templated: true
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ jobs:
id: slack
uses: slackapi/slack-github-action@v2.0.0
env:
ACTION_NAME: remote settings fetch
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-remote-settings-fetch.json"
payload-file-path: "./test-fixtures/ci/slack-notification-payload-generic.json"
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,30 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
onlyGenerateCoverageForSpecifiedTargets = "YES"
shouldAutocreateTestPlan = "YES">
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "QuickAnswers"
BuildableName = "QuickAnswers"
BlueprintName = "QuickAnswers"
ReferencedContainer = "container:">
</BuildableReference>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "QuickAnswersTests"
BuildableName = "QuickAnswersTests"
BlueprintName = "QuickAnswersTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand Down
2 changes: 1 addition & 1 deletion BrowserKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ let package = Package(
]),
.target(
name: "QuickAnswersKit",
dependencies: ["Common", "Shared", "MLPAKit", "LLMKit"],
dependencies: ["Common", "Shared", "MLPAKit", "LLMKit", "SiteImageView"],
swiftSettings: [
.unsafeFlags(["-enable-testing"])
]
Expand Down
8 changes: 8 additions & 0 deletions BrowserKit/Sources/ComponentLibrary/Buttons/ChipButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public final class ChipButton: UIButton, ThemeApplicable {
configuration?.cornerStyle = .capsule
configuration?.background.backgroundColorTransformer = nil
configuration?.titleLineBreakMode = .byTruncatingTail
layer.masksToBounds = false

addTarget(self, action: #selector(tapped), for: .touchUpInside)
}
Expand Down Expand Up @@ -56,6 +57,11 @@ public final class ChipButton: UIButton, ThemeApplicable {
)
}

override public func layoutSubviews() {
super.layoutSubviews()
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: bounds.height / 2).cgPath
}

override public func updateConfiguration() {
guard var updatedConfiguration = configuration else { return }

Expand Down Expand Up @@ -83,6 +89,7 @@ public final class ChipButton: UIButton, ThemeApplicable {
}

configuration = updatedConfiguration
layer.shadowOpacity = isEnabled ? FxShadow.shadow200.opacity : 0

if !isEnabled {
accessibilityTraits = [.button, .notEnabled]
Expand Down Expand Up @@ -116,6 +123,7 @@ public final class ChipButton: UIButton, ThemeApplicable {
selectedForegroundColor = theme.colors.textInverted
disabledBackgroundColor = theme.colors.layer2
disabledForegroundColor = theme.colors.textDisabled
applyShadow(FxShadow.shadow200, theme: theme)
setNeedsUpdateConfiguration()
}

Expand Down
26 changes: 25 additions & 1 deletion BrowserKit/Sources/ComponentLibrary/ChipPickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import Common
import UIKit

/// A horizontally scrolling picker that renders selectable options as chip buttons.
public final class ChipPickerView: UIView, ThemeApplicable {
public final class ChipPickerView: UIView, ThemeApplicable, UIScrollViewDelegate {
public struct UX {
public static let itemSpacing: CGFloat = 10
}

private lazy var scrollView: UIScrollView = .build { scrollView in
scrollView.showsHorizontalScrollIndicator = false
scrollView.clipsToBounds = false
}

private lazy var stackView: UIStackView = .build { stackView in
Expand All @@ -26,9 +27,11 @@ public final class ChipPickerView: UIView, ThemeApplicable {
private var items = [ChipPickerItem]()
private var selectedID: String?
private var onSelection: (@MainActor (String) -> Void)?
private var onScroll: ((CGFloat) -> Void)?

override public init(frame: CGRect) {
super.init(frame: frame)
clipsToBounds = false
setupLayout()
}

Expand All @@ -39,26 +42,41 @@ public final class ChipPickerView: UIView, ThemeApplicable {
public func configure(
items: [ChipPickerItem],
selectedID: String?,
contentOffsetX: CGFloat = 0,
onScroll: ((CGFloat) -> Void)? = nil,
onSelection: (@MainActor (String) -> Void)? = nil
) {
self.items = items
self.selectedID = selectedID
self.onSelection = onSelection
self.onScroll = onScroll
rebuildButtons()
updateContentOffsetX(contentOffsetX)
}

public func applyTheme(theme: Theme) {
currentTheme = theme
chipButtons.forEach { $0.applyTheme(theme: theme) }
}

public func updateSelectedID(_ selectedID: String?) {
self.selectedID = selectedID
rebuildButtons()
scrollView.layoutIfNeeded()
}

public func updateContentOffsetX(_ contentOffsetX: CGFloat) {
scrollView.setContentOffset(CGPoint(x: contentOffsetX, y: 0), animated: false)
}

private var chipButtons: [ChipButton] {
stackView.arrangedSubviews.compactMap { $0 as? ChipButton }
}

private func setupLayout() {
addSubview(scrollView)
scrollView.addSubview(stackView)
scrollView.delegate = self

NSLayoutConstraint.activate([
scrollView.topAnchor.constraint(equalTo: topAnchor),
Expand Down Expand Up @@ -104,4 +122,10 @@ public final class ChipPickerView: UIView, ThemeApplicable {
rebuildButtons()
onSelection?(id)
}

// MARK: = UIScrollViewDelegate

public func scrollViewDidScroll(_ scrollView: UIScrollView) {
onScroll?(scrollView.contentOffset.x)
}
}
10 changes: 8 additions & 2 deletions BrowserKit/Sources/LLMKit/LiteLLMCreator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
import Shared
import MLPAKit

public struct LiteLLMCreator {
public static func createAppAttestLiteLLM(using prefs: Prefs) -> LiteLLMClient? {
public protocol LiteLLMCreating {
func createAppAttestLiteLLM(using prefs: Prefs) -> LiteLLMClientProtocol?
}

public struct LiteLLMCreator: LiteLLMCreating {
public init() { }

public func createAppAttestLiteLLM(using prefs: Prefs) -> LiteLLMClientProtocol? {
let mlpaEnvironmentKey = prefs.stringForKey(PrefsKeys.MLPASettings.mlpaEndpointEnvironment) ?? ""
let mlpaEnvironment = MLPAEnvironment(rawValue: mlpaEnvironmentKey) ?? .prod
guard let endPoint = MLPAConstants.completionsEndpoint(with: mlpaEnvironment),
Expand Down
3 changes: 3 additions & 0 deletions BrowserKit/Sources/MLPAKit/MLPAJWTPayload.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public enum MLPAConstants {
static let assertionObjParam = "assertion_obj_b64"

static let serviceTypeHeader = "service-type"

// TODO: FXIOS-15123 - need to create an enum service type here
// eventually to also account for quick-answers
static let serviceTypeValue = "s2s"
static let useAppAttestHeader = "use-app-attest"

Expand Down
Loading
Loading