Skip to content

Add option to disable shareable URLs#115

Merged
paolosimone merged 1 commit into
mainfrom
url-state-setting
Nov 9, 2025
Merged

Add option to disable shareable URLs#115
paolosimone merged 1 commit into
mainfrom
url-state-setting

Conversation

@paolosimone
Copy link
Copy Markdown
Owner

@paolosimone paolosimone commented Nov 9, 2025

Allow users to disable state storage in URL (opt-out), keeping the same behavior as before the feature was introduced.

@paolosimone paolosimone requested a review from Copilot November 9, 2025 10:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new enableURLState setting that allows users to control whether the viewer state is synced to the URL fragment (hash). This enables shareable URLs while giving users the option to disable this feature if desired.

  • Added enableURLState boolean setting to control URL fragment state synchronization
  • Modified useURLFragmentState to accept a parameter that controls whether state is synced to URL
  • Added UI controls and translations for the new setting in both English and Italian

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
extension/src/viewer/state/Settings.ts Adds enableURLState property to Settings type and defaults it to true
extension/src/viewer/state/ApplicationState/URLFragmentState.ts Modifies hook to accept syncStateToURL parameter and conditionally sync state to URL based on flag
extension/src/viewer/state/ApplicationState/ApplicationState.ts Passes settings.enableURLState to useURLFragmentState hook
extension/src/viewer/localization/translations/en.json Adds English translation for the new setting label and tooltip
extension/src/viewer/localization/translations/it.json Adds Italian translation for the new setting label and tooltip
extension/src/options/MainOptions.tsx Adds checkbox UI control for the new enableURLState setting
Comments suppressed due to low confidence (4)

extension/src/viewer/state/ApplicationState/URLFragmentState.ts:4

  • SettingsContext is imported but never used in this file. Consider removing it from the import statement.
import { ViewerMode } from "../ViewerMode";

extension/src/viewer/state/ApplicationState/URLFragmentState.ts:1

  • useContext is imported but never used in this file. Consider removing it from the import statement.
import { Dispatch, useEffect, useState } from "react";

extension/src/viewer/state/ApplicationState/URLFragmentState.ts:1

  • Unused import useContext.
import { Dispatch, useEffect, useState } from "react";

extension/src/viewer/state/ApplicationState/URLFragmentState.ts:4

  • Unused import SettingsContext.
import { ViewerMode } from "../ViewerMode";

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@paolosimone paolosimone linked an issue Nov 9, 2025 that may be closed by this pull request
@paolosimone paolosimone merged commit f33c80b into main Nov 9, 2025
@paolosimone paolosimone deleted the url-state-setting branch November 9, 2025 10:55
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.

Use fragments to include filters in the URI

2 participants