From 3d51a04a19160abeb68093cfa508b2125548d0a2 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 17 Sep 2026 06:37:51 +0200 Subject: [PATCH] "Add watch" UI tweaks (#4446) --- .../blueprint/add_watch_ui/__init__.py | 8 ++- .../add_watch_ui/templates/add-watch-ui.html | 11 ++-- .../watchlist/templates/watch-overview.html | 20 +++---- .../static/styles/scss/parts/_add-watch.scss | 54 ++++++++---------- .../static/styles/scss/parts/_variables.scss | 5 +- .../styles/scss/parts/_watch_table.scss | 54 +++++++++++++++--- .../static/styles/scss/styles.scss | 25 -------- changedetectionio/static/styles/styles.css | 2 +- changedetectionio/templates/_helpers.html | 4 +- .../translations/cs/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/de/LC_MESSAGES/messages.po | 46 ++++++++------- .../en_GB/LC_MESSAGES/messages.po | 46 ++++++++------- .../en_US/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/es/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/fr/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/id/LC_MESSAGES/messages.mo | Bin 115232 -> 115080 bytes .../translations/id/LC_MESSAGES/messages.po | 48 +++++++++------- .../translations/it/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/ja/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/ko/LC_MESSAGES/messages.po | 48 +++++++++------- changedetectionio/translations/messages.pot | 48 +++++++++------- .../translations/pl/LC_MESSAGES/messages.mo | Bin 124276 -> 124114 bytes .../translations/pl/LC_MESSAGES/messages.po | 48 +++++++++------- .../pt_BR/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/ru/LC_MESSAGES/messages.po | 48 +++++++++------- .../translations/tr/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/uk/LC_MESSAGES/messages.po | 46 ++++++++------- .../translations/zh/LC_MESSAGES/messages.po | 46 ++++++++------- .../zh_Hant_TW/LC_MESSAGES/messages.mo | Bin 111220 -> 111066 bytes .../zh_Hant_TW/LC_MESSAGES/messages.po | 48 +++++++++------- 30 files changed, 550 insertions(+), 473 deletions(-) diff --git a/changedetectionio/blueprint/add_watch_ui/__init__.py b/changedetectionio/blueprint/add_watch_ui/__init__.py index b82532b89..b412090e4 100644 --- a/changedetectionio/blueprint/add_watch_ui/__init__.py +++ b/changedetectionio/blueprint/add_watch_ui/__init__.py @@ -1,8 +1,10 @@ +import os + from flask import Blueprint, render_template, request, jsonify, make_response, flash, redirect, url_for from flask_babel import gettext from loguru import logger -from changedetectionio import forms +from changedetectionio import forms, strtobool from changedetectionio.auth_decorator import login_optionally_required from . import browser_config from changedetectionio.store import ChangeDetectionStore @@ -34,6 +36,7 @@ def construct_blueprint(datastore: ChangeDetectionStore): return render_template( "add-watch-ui.html", + browser_backend_disabled=strtobool(os.getenv('ADD_WATCH_UI_BROWSER_BACKEND_DISABLED', 'False')), form=form, llm_configured=llm_configured, llm_intent_watch_placeholder=LLM_INTENT_WATCH_PLACEHOLDER, @@ -76,6 +79,9 @@ def construct_blueprint(datastore: ChangeDetectionStore): # Note this fetch never reaches difference_detection_processor.call_browser(), so it gets # no gating from there - it has to validate for itself. url = (request.form.get('url') or '').strip() + if not url.lower().startswith('http'): + url='https://' + url + ok, reason = is_fetch_url_allowed(url) if not ok: logger.warning(f"Add-watch snapshot: refused '{url}' - {reason}") diff --git a/changedetectionio/blueprint/add_watch_ui/templates/add-watch-ui.html b/changedetectionio/blueprint/add_watch_ui/templates/add-watch-ui.html index 45ebaa62c..5568e71e4 100644 --- a/changedetectionio/blueprint/add_watch_ui/templates/add-watch-ui.html +++ b/changedetectionio/blueprint/add_watch_ui/templates/add-watch-ui.html @@ -15,7 +15,7 @@
- {{ render_nolabel_field(form.url, placeholder="https://...", required=true, class="pure-input-1") }} + {{ render_nolabel_field(form.url, placeholder="www.website.com/page.html", required=true, class="pure-input-1") }}
@@ -51,14 +51,14 @@
- {{ render_simple_field(form.processor) }} + {{ render_simple_field(form.processor, label=_('What do you want to achieve?')) }}
- +{%- if not browser_backend_disabled -%}
{# Rendered by hand rather than with render_field(): the system-default entry is listed for explanation and has to render disabled, and WTForms can't carry a per-option disabled attribute through a RadioField's choices. #} - +
    {%- for browser in form.fetch_backend -%} {%- set unusable = browser.data in unusable_browsers -%} @@ -68,7 +68,7 @@ {%- endfor -%}
- +{%- endif -%}
{%- if llm_configured -%}
diff --git a/changedetectionio/blueprint/watchlist/templates/watch-overview.html b/changedetectionio/blueprint/watchlist/templates/watch-overview.html index 71d07c729..363bb2f6e 100644 --- a/changedetectionio/blueprint/watchlist/templates/watch-overview.html +++ b/changedetectionio/blueprint/watchlist/templates/watch-overview.html @@ -156,7 +156,7 @@ window.watchOverviewI18n = {

- {{ render_nolabel_field(form.url, placeholder="https://...", required=true, class="pure-input-1") }} + {{ render_nolabel_field(form.url, placeholder="www.website.com/page.html", required=true, class="pure-input-1") }}
{% if llm_configured %} @@ -195,13 +195,6 @@ window.watchOverviewI18n = { {% endfor %} {% endif %} - {# "Select all matching" banner — shown by watch-overview.js when the whole - visible page is selected but more matching rows exist on other pages. #} -
{%- if watches|length >= pagination.per_page -%}{{ pagination.info }}{%- endif -%} @@ -210,11 +203,7 @@ window.watchOverviewI18n = {
- - {%- if search_q -%}
{{ _('Searching') }} "{{search_q}}"
{%- endif -%} - - {%- set sort_order = sort_order or 'asc' -%} {%- set sort_attribute = sort_attribute or 'last_changed' -%} {%- set pagination_page = request.args.get('page', 0) -%} @@ -325,7 +314,12 @@ window.watchOverviewI18n = { data-confirm-message="{{ _('

Are you sure you want to delete the selected watches?

This action cannot be undone.

') }}" data-confirm-button="{{ _('Delete') }}"> {{ _('Delete') }}
- + {%- set table_classes = [ 'favicon-enabled' if 'favicons_enabled' not in ui_settings or ui_settings['favicons_enabled'] else 'favicon-not-enabled', ] -%} diff --git a/changedetectionio/static/styles/scss/parts/_add-watch.scss b/changedetectionio/static/styles/scss/parts/_add-watch.scss index 488965e19..9c2e3fb3f 100644 --- a/changedetectionio/static/styles/scss/parts/_add-watch.scss +++ b/changedetectionio/static/styles/scss/parts/_add-watch.scss @@ -158,47 +158,43 @@ body { display: flex; flex-direction: column; gap: 1.1rem; + color: #fff; @media (max-width: 900px) { flex: 1 1 auto; } - .add-watch-option-group { - label { - display: inline-block; + span.label { + padding-bottom: 0.5rem; + display: inline-block !important; + } + label { + margin: 0 !important;; /* override */ + } + li { + list-style: none; + font-size: .9rem; + display: grid; + grid-template-columns: auto 1fr; + align-items: center; + gap: .5rem; + + input[type="radio"] { + flex: 0 0 auto; } + + > label { + font-weight: normal; + } + } + li + li { /* gap between */ + margin-top: .75rem; } // Browser picker: fetcher descriptions are long (they carry the driver URL), so this is // a radio list whose labels wrap inside the narrow pane instead of a