Convert filter_bar.js to TypeScript (issue #17)

- Add ts/filter_bar.ts: typed port of the filter bar. Criterion / PillEntry /
  RangeField / DeselectableRadio interfaces replace the loose objects and the
  radio.wasChecked custom property; var → const/let throughout
- Window entry points (applyFilterBar/clearFilterBar/toggleStringFilterInput/
  showPresetNameInput/savePreset) declared in ts/globals.d.ts; readSearchSelect
  now called as window.readSearchSelect
- Drop the dead selectValue helper; factor the repeated path→mode mapping into
  presetMode()
- Point the FilterBar component Media and every e2e/test reference at the
  compiled dist/filter_bar.js

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 13:38:20 +02:00
parent 541fb550ab
commit cd17053860
11 changed files with 518 additions and 489 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ def _bar_page(filter_json: str = "") -> str:
<script src="/static/js/htmx.min.js"></script>
<script src="/static/js/range_slider.js" type="module"></script>
<script src="/static/js/dist/search_select.js" type="module"></script>
<script src="/static/js/filter_bar.js" type="module"></script>
<script src="/static/js/dist/filter_bar.js" type="module"></script>
</head>
<body>
{FilterBar(filter_json=filter_json, preset_list_url="/p/l", preset_save_url="/p/s")}
+1 -1
View File
@@ -32,7 +32,7 @@ def _bar_page(filter_json: str = "") -> str:
<script src="/static/js/htmx.min.js"></script>
<script src="/static/js/range_slider.js" type="module"></script>
<script src="/static/js/dist/search_select.js" type="module"></script>
<script src="/static/js/filter_bar.js" type="module"></script>
<script src="/static/js/dist/filter_bar.js" type="module"></script>
</head>
<body>
{PurchaseFilterBar(filter_json=filter_json, preset_list_url="/p/l", preset_save_url="/p/s")}
+1 -1
View File
@@ -32,7 +32,7 @@ def _bar_page(filter_json: str = "") -> str:
<script src="/static/js/range_slider.js" type="module"></script>
<script src="/static/js/dist/search_select.js" type="module"></script>
<script src="/static/js/date_range_picker.js" defer></script>
<script src="/static/js/filter_bar.js" type="module"></script>
<script src="/static/js/dist/filter_bar.js" type="module"></script>
</head>
<body>
{PurchaseFilterBar(filter_json=filter_json, preset_list_url="/p/l", preset_save_url="/p/s")}
+1 -1
View File
@@ -16,7 +16,7 @@ def _bar_page(filter_json: str = "") -> str:
<script src="/static/js/htmx.min.js"></script>
<script src="/static/js/range_slider.js" type="module"></script>
<script src="/static/js/dist/search_select.js" type="module"></script>
<script src="/static/js/filter_bar.js" type="module"></script>
<script src="/static/js/dist/filter_bar.js" type="module"></script>
</head>
<body>
{FilterBar(filter_json=filter_json, preset_list_url="/p/l", preset_save_url="/p/s")}
+1 -1
View File
@@ -19,7 +19,7 @@ def _bar_page(filter_json: str = "") -> str:
<script src="/static/js/htmx.min.js"></script>
<script src="/static/js/range_slider.js" type="module"></script>
<script src="/static/js/dist/search_select.js" type="module"></script>
<script src="/static/js/filter_bar.js" type="module"></script>
<script src="/static/js/dist/filter_bar.js" type="module"></script>
</head>
<body>
{PlatformFilterBar(filter_json=filter_json, preset_list_url="/p/l", preset_save_url="/p/s")}