Skip to content

Conversation

@sebastienfontaine
Copy link
Contributor

Summary

Add support for regex capture groups in URL fragment for the "Unique" tab feature.

Users can now use placeholders like $1, $2 in the URL fragment field when the "Unique" option is enabled, allowing more flexible duplicate tab detection based on extracted
URL patterns.

Changes

  • Add _processUrlFragment() helper function to process capture group placeholders
  • Update handleSetUnique() to use processed fragments for comparison
  • Pass complete rule object to enable access to url_matcher
  • Add comprehensive tests for new functionality

Example Usage

  • URL matcher: https://mysite.atlassian.net/browse/([A-Z]+-\d+)
  • URL fragment: https://mysite.atlassian.net/browse/$1
  • Unique: ✅ enabled

This will detect duplicate tabs for the same JIRA ticket (e.g., ABC-123) regardless of query parameters.

Breaking Changes

None - fully backward compatible with existing rules.

Fixes #457

@sebastienfontaine sebastienfontaine self-assigned this Sep 30, 2025
@sebastienfontaine sebastienfontaine merged commit 68481b0 into release/1.0.18 Sep 30, 2025
1 check passed
@sebastienfontaine sebastienfontaine deleted the feat/url-fragment-capture-groups branch September 30, 2025 22:13
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.

2 participants