Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Deduplicate entries in History Menu #3831

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

ayoy
Copy link
Collaborator

@ayoy ayoy commented Feb 5, 2025

Task/Issue URL: https://app.asana.com/0/0/1209328755192084/f

Description:
This change updates History Menu to only display one item per URL per day,
which is in line with other mainstream browsers. This change remains behind historyView
feature flag and will only be made available when Full History View is released.
The grouping logic was extracted into HistoryGroupingProvider class where
it's made dependent on the feature flag state. Current behavior remains unchanged,
as evidenced by added unit tests.

Steps to test this PR:

  1. Run the app from Xcode and burn all data.
  2. Visit a url (ideally one that doesn't redirect anywhere else).
  3. Duplicate a tab a couple of times.
  4. Open Main Menu -> History and verify that your URL is present there a couple of times (equal to the number of visits to the URL).
  5. Select Main Menu -> Debug -> Feature Flag Overrides -> historyView to enable History View, and verify that the URL is only shown once in History View.
  6. Visit some URL (a.k.a. URL A).
  7. Visit another URL (a.k.a. URL B).
  8. Refresh URL A, refresh URL B, refresh URL A, refresh URL B, etc...
  9. Verify that History Menu shows alternating URLs A, B, A, B (with the most recently visited on top).
  10. Enable historyView feature flag and verify that History Menu only contains 1 item with URL A and 1 item with URL B (with the most recently visited on top).
  11. Go to History Menu -> Today -> Clear This History..., then confirm removing history and verify that all history from Today is gone (menu is empty).

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

Copy link
Contributor

github-actions bot commented Feb 5, 2025

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 556abbc

@ayoy ayoy marked this pull request as draft February 5, 2025 12:16
@ayoy ayoy marked this pull request as ready for review February 5, 2025 12:34
Copy link
Contributor

@aataraxiaa aataraxiaa 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 @ayoy! Tested and works great. +1 for tests and documentation!

@ayoy ayoy merged commit 2b5e47d into main Feb 5, 2025
35 checks passed
@ayoy ayoy deleted the dominik/history-grouping-deduplication branch February 5, 2025 13:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants