Skip to content

Add URL double-click action option to Settings #12322

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

juzu-o
Copy link
Contributor

@juzu-o juzu-o commented Jul 28, 2025

Description

This pull request adds an option in Application Settings to configure the double-click action for the URL field in the entry view. Instead of the previous "Open browser on double clicking URL field in entry view" checkbox, there is now a dropdown selector allowing users to choose the desired double-click action for the URL field:

  • Open in browser (default, preserves previous behavior)
  • Edit entry
  • Copy entry URL to clipboard (new)

This brings the URL field in line with the double-click behavior already available for username and password fields, allowing for a more consistent and customizable user experience.

Code changes include:

  • Replaced the Open browser on double clicking URL field in entry view checkbox in the Settings dialog with a dropdown menu to select the double-click action for the URL field.
  • Updated the settings UI and logic to support the new dropdown and persist the chosen option.
  • Refactored the double-click event handler for the URL field to perform the selected action.
  • Maintained backwards compatibility: the default is "Open in browser", so previous configurations are preserved unless the user changes the setting.
  • Updated relevant settings serialization, tests, and UI strings.

The feature was originally requested in #4717

AI Notice:
The majority of this code was written with the help of generative AI tools (GitHub Copilot / Claude Sonnet 4).


Screenshots

URL-double-click-action-settingsmenu

Testing strategy

  • Manual testing: verified that double-clicking the URL field performs the selected action (edit, open, copy).
  • Confirmed that existing double-click actions for username and password fields are unaffected.
  • Checked that the new setting persists after app restart.

Type of change

  • ✅ New feature (change that adds functionality)

Additional notes

@Copilot Copilot AI review requested due to automatic review settings July 28, 2025 13:31
Copy link

@Copilot 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 configurable double-click action option for the URL field in the entry view, replacing the previous binary checkbox with a dropdown selector that offers three actions: edit entry, open in browser, or copy to clipboard. This enhancement provides users with more flexibility and brings consistency with existing username and password field double-click behaviors.

Key changes:

  • Replaced boolean "Open browser on double clicking URL field" setting with a dropdown offering three actions
  • Added migration logic to preserve existing user preferences when upgrading
  • Updated the entry activation handler to support the new action types

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/core/Config.h Added new URLDoubleClickAction configuration key
src/core/Config.cpp Added configuration mapping and migration logic for the new setting
src/gui/ApplicationSettingsWidget.cpp Updated settings UI logic to use dropdown instead of checkbox
src/gui/ApplicationSettingsWidgetGeneral.ui Replaced checkbox with dropdown containing three action options
src/gui/DatabaseWidget.cpp Modified entry activation handler to support multiple URL double-click actions
tests/TestConfig.h Added test method declaration for migration testing
tests/TestConfig.cpp Implemented comprehensive migration tests for the new setting
Comments suppressed due to low confidence (1)

tests/TestConfig.cpp:52

  • [nitpick] Variable names 'oldConfig' and 'oldConfig2' are not descriptive. Consider using names like 'configWithOpenUrlTrue' and 'configWithOpenUrlFalse' to better indicate the test scenario.
    QSettings oldConfig(tempFile.fileName(), QSettings::IniFormat);

default:
switchToEntryEdit(entry);
break;
}
break;
}
Copy link
Preview

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

The break statement after the switch block is unreachable because all switch cases already contain break statements. This creates dead code.

Suggested change
}

Copilot uses AI. Check for mistakes.

@droidmonkey droidmonkey added user interface ux pr: ai-assisted Pull request contains significant contributions by generative AI labels Jul 28, 2025
Copilot

This comment was marked as outdated.

@juzu-o juzu-o force-pushed the add-url-double-click-action-option branch from 43b6cd2 to 0e2adfb Compare August 11, 2025 15:50
@juzu-o juzu-o requested a review from Copilot August 11, 2025 16:25
Copy link

@Copilot 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 configurable double-click action for URL fields in the entry view, replacing a simple checkbox with a dropdown that offers three options: edit entry, open in browser, or copy to clipboard. This enhancement provides consistency with existing username and password field double-click behaviors while maintaining backward compatibility.

Key Changes:

  • Replaced boolean "Open browser on double clicking URL field" checkbox with a dropdown selector offering three actions
  • Implemented migration logic to preserve existing user preferences when upgrading
  • Updated the double-click handler to execute the selected action based on the new configuration

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/core/Config.h Added new URLDoubleClickAction configuration key
src/core/Config.cpp Added configuration directive and migration logic for the new setting
src/gui/ApplicationSettingsWidgetGeneral.ui Replaced checkbox with dropdown and label in settings UI
src/gui/ApplicationSettingsWidget.cpp Updated settings load/save logic to use dropdown instead of checkbox
src/gui/DatabaseWidget.cpp Modified URL double-click handler to support multiple actions based on configuration
tests/TestConfig.h Added test method declaration for migration testing
tests/TestConfig.cpp Implemented test cases for configuration migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: ai-assisted Pull request contains significant contributions by generative AI user interface ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to copy URL to clipboard instead of opening it on double-click
3 participants