Add option to disable shareable URLs#115
Merged
Merged
Conversation
b556547 to
c929896
Compare
Contributor
There was a problem hiding this comment.
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
enableURLStateboolean setting to control URL fragment state synchronization - Modified
useURLFragmentStateto 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
SettingsContextis 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
useContextis 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow users to disable state storage in URL (opt-out), keeping the same behavior as before the feature was introduced.