Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Edit Custom Search Engines #24856

Merged
merged 5 commits into from
Jul 30, 2024

Conversation

soner-yuksel
Copy link
Contributor

@soner-yuksel soner-yuksel commented Jul 25, 2024

Resolves brave/brave-browser#39552

This PR is adding the functionality of edit to custom search screen and engines.

In addition to delete now edit is added to the swipe functionality. The same screen is used including the same error checks for this action except the duplicate error check since the engine is edited. In addition the view controller functionality is divided into chunks to make edit easier for next iteration.

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Add custom search engine
  • Use the template search engine mentioned in the description
  • Try edit functionality and change url or title
  • Check if the changes are done
  • Test query with them

Screenshots:

RPReplay_Final1722714552.mov

@soner-yuksel soner-yuksel added CI/skip-android Do not run CI builds for Android CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 CI/skip-macos-arm64 Do not run CI builds for macOS arm64 labels Jul 25, 2024
@soner-yuksel soner-yuksel self-assigned this Jul 25, 2024
@soner-yuksel soner-yuksel force-pushed the ios/enhancement/custom-engine-edit branch 4 times, most recently from 1260a6d to 22c4cd4 Compare July 26, 2024 19:46
@soner-yuksel soner-yuksel marked this pull request as ready for review July 26, 2024 20:03
@soner-yuksel soner-yuksel requested a review from a team as a code owner July 26, 2024 20:03
@soner-yuksel soner-yuksel force-pushed the ios/enhancement/custom-engine-edit branch from 22c4cd4 to e3f7139 Compare July 26, 2024 20:04
Copy link
Contributor

[puLL-Merge] - brave/brave-core@24856

Description

This PR introduces significant changes to the search engine management functionality in the Brave iOS app. It refactors and enhances the custom search engine addition and editing features, improving the user interface and overall functionality.

Changes

Changes

  1. BrowserViewController.swift:

    • Updated references from SearchSettingsTableViewController to SearchSettingsViewController.
  2. SearchEngines.swift:

    • Added a new editSearchEngine method to allow editing of existing custom search engines.
  3. CustomEngineTableViewHeader.swift:

    • New file added to create a custom header for the search engine table view.
  4. CustomEngineTitleInputTableViewCell.swift:

    • New file added to create a custom cell for inputting search engine titles.
  5. CustomEngineURLInputTableViewCell.swift:

    • New file added to create a custom cell for inputting search engine URLs.
  6. CustomEngineViewController+OpenSearch.swift:

    • New file added to handle OpenSearch functionality for custom search engines.
  7. CustomEngineViewController.swift:

    • Renamed from SearchCustomEngineViewController.swift.
    • Significant refactoring and enhancement of the custom search engine management functionality.
    • Added support for editing existing search engines.
  8. SearchEnginePickerViewController.swift:

    • Renamed from SearchEnginePicker.swift.
  9. SearchSettingsViewController.swift:

    • Renamed from SearchSettingsTableViewController.swift.
    • Added swipe actions for editing and deleting custom search engines.
    • Updated to use the new CustomEngineViewController for adding and editing engines.
  10. SettingsViewController.swift:

    • Updated reference to SearchSettingsViewController.
  11. BraveStrings.swift:

    • Updated string references to reflect the new class names.

Possible Issues

  • The refactoring and renaming of classes may require updates in other parts of the codebase that are not shown in this diff.
  • Thorough testing should be performed to ensure that all search engine management functionality works as expected, especially the new editing feature.

Security Hotspots

No significant security issues are apparent in this change. However, care should be taken when handling user-inputted URLs and search engine data to prevent potential injection attacks or malformed URLs.

Copy link
Contributor

@iccub iccub left a comment

Choose a reason for hiding this comment

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

nice one

@soner-yuksel soner-yuksel merged commit 4835ebe into master Jul 30, 2024
21 checks passed
@soner-yuksel soner-yuksel deleted the ios/enhancement/custom-engine-edit branch July 30, 2024 14:58
@github-actions github-actions bot added this to the 1.70.x - Nightly milestone Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 puLL-Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit custom search engines
2 participants