Skip to content

feat: Add copy link button and remove all params from url bar - #1572

Merged
arielvino merged 15 commits into
mainfrom
Add-copy-link-button-and-remove-all-params-from-URL-bar
May 20, 2026
Merged

feat: Add copy link button and remove all params from url bar#1572
arielvino merged 15 commits into
mainfrom
Add-copy-link-button-and-remove-all-params-from-URL-bar

Conversation

@arielvino

Copy link
Copy Markdown
Collaborator

Description

Added a button that copy the url to the current page with all ui-state params to clipboard.
It use SearchState params when exists - and manually add params that not tracked in the shared state when needed.

The generated url does NOT contain the language code - which means the page will be loaded on the recipient's machine in the language that was defined there.
(For new users - the PR #1558 once approved will make the site auto detect local language)

The URL bar now show cleanly without any params on any page.
The gaps page still link with params to the singleLineMap - but those params are strriped from the URL after being proccessed.

Translation to all 4 languages was added (though the Russian and Arabic are here are AI generated, a speaker should verify those).

screenshots

image image image

arielvino and others added 6 commits May 15, 2026 16:47
Replaces the automatic URL↔state sync with an explicit Share button in
  the header that builds a shareable link on demand and copies it to the
  clipboard. The URL is never polluted with params during normal navigation.

  - Remove the useEffect that continuously wrote SearchContext state back
    into the address bar (the main source of the "mostly broken" URL sync)
  - Add ShareButton (extracted to its own file) with a link icon, tooltip
    showing the URL to be copied, and a ✓ confirmation on click
  - Build page-aware URLs: each route declares only the params it actually
    uses (e.g. /gaps gets timestamp+operator+line+route, /map gets only
    its datetime, homepage gets nothing)
  - Capture URL params synchronously via useMemo before stripping them,
    exposed through InitialUrlParamsContext so lazy-loaded pages can read
    them reliably even after the address bar has been cleaned up
  - Apply incoming URL params on top of existing session storage so shared
    links always restore the correct state regardless of prior session
  - Fix /gaps_patterns not restoring startDate/endDate and operatorId from
    shared links
  - Fix /map not restoring its timestamp from shared links
  - Fix /operator clearing lineNumber/routeKey on mount (removed the
    setSearch reset that wiped cross-page state)
  - Add share_link translation key (he/en/ar/ru)
…ring sanitization'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@arielvino
arielvino requested a review from AvivAbachi as a code owner May 19, 2026 13:30
@arielvino arielvino changed the title Add copy link button and remove all params from url bar feat: Add copy link button and remove all params from url bar May 19, 2026
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

@arielvino

Copy link
Copy Markdown
Collaborator Author

@claude Check why applitools tests from this group that don't have component name are always on branch HEAD.
image
image

@arielvino
arielvino requested a review from NoamGaash May 19, 2026 14:10

@NoamGaash NoamGaash left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@arielvino
arielvino merged commit 264d40b into main May 20, 2026
22 checks passed
@arielvino
arielvino deleted the Add-copy-link-button-and-remove-all-params-from-URL-bar branch May 20, 2026 06:02
@arielvino arielvino linked an issue May 22, 2026 that may be closed by this pull request
@arielvino arielvino linked an issue May 22, 2026 that may be closed by this pull request
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.

SearchState is not shareable Real time map page not use search params(in the URL)

2 participants