Skip to content

Conversation

@TrigamDev
Copy link
Contributor

@TrigamDev TrigamDev commented Oct 18, 2025

Summary

  • Adds a new URL field type, which replaces URL detection in text fields.
    • The value of the URL field is interpreted as a link, regardless of if it's valid or not, giving the user more control and preventing cases where valid URLs aren't detected.
    • The user is also able to choose a title for the link, which will be displayed in place of the URL value.

Closes #1140

image image

Changes Made

(Headers don't directly correlate with the file paths of the changed files, these are more or less arbitrary)

Core

  • Added a new field type, URL, which takes a URL title and URL value.
  • Added a new url_fields table to store the new URL fields, having fields for the URL title and URL value.
  • The built-in fields URL and SOURCE have been changed to be of the field type URL.
  • Entries have been modified to load in the URL fields associated with it, as is the case with text fields and datetime fields.
  • Bumps the database version to 104 (in context of feat: add hidden tags #1139 bumping it to 103).
  • Two migration steps have been added for database version 104:
    • First, both the URL and SOURCE fields are changed from being of type TEXT_LINE to being of type URL
    • Second, all text fields that have a type key which is itself of type URL (so the two changed above) will be moved over to the url_fields table.
  • Both URL and text fields, when empty, will have their value stored as None, and will account for having None values.

QT

  • Reverts the URL detection made in feat: clickable links in text fields #924
  • Adds a new UrlWidget that extends TextWidget which accepts a URL title and URL value and displays an embedded link.
  • Adds a new EditUrl modal, providing inputs for editing the title and value of a URL field.

Mixed

  • To account for URL fields being the first field type to have multiple parameters, field saving has been modified to allow an arbitrary number of arguments.
    • The save callback of PanelModals only returning a string, they can now return an arbitrary number of arguments of any type.
      • Not quite related to URL fields, but the save callback has had it's type hint modified to also allow for the return type to be a tuple of an arbitrary length with type None. This is because most (if not all) save callbacks had this return type, which kept causing warnings.
    • The get_content() method of PanelModals can now return an arbitrary number of arguments of any type instead of just string.
    • Adding and updating fields in the database, instead of taking a single argument for the value field, now takes kwargs, with each key corresponding to a field in the field's table, and each value corresponding to the value being written.
      • All previous field types have had their add_field_to_entry and update_entry_field calls to account for this change.
      • Updated the test_library and test_update_entry_with_multiple_identical_fields tests to account for this change.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@TrigamDev TrigamDev marked this pull request as ready for review October 18, 2025 21:54
@TrigamDev
Copy link
Contributor Author

I'll be using this branch as my primary version of TagStudio for now, so I'll make sure to update here if I come across any issues.

@TrigamDev
Copy link
Contributor Author

TrigamDev commented Oct 19, 2025

I'll be using this branch as my primary version of TagStudio for now, so I'll make sure to update here if I come across any issues.

Appears that when copying fields, it only copies the value field. I'll tweak it real quick to use **kwargs instead.

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.

[Feature Request]: URL field type

1 participant