2024-11-02 15:14:02 -06:00
import React , { useState } from "react" ;
2026-03-05 16:18:03 -07:00
import { fetchVideoDownloadDefaults , getDownloaders , postDownload , putDownload } from "../api" ;
2025-05-05 12:56:24 -06:00
import {
APIButton ,
DirectorySearch ,
InfoHeader ,
InfoPopup ,
mergeDeep ,
RequiredAsterisk ,
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
SimpleAccordion ,
Toggle ,
useLocalStorage ,
validURL ,
validURLs ,
2025-05-05 12:56:24 -06:00
} from "./Common" ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
import { Button , Group , Header , Icon , Message , MultiSelect , NumberInput , Select , Stack , TextInput , Textarea } from "./ui" ;
2025-12-07 11:54:20 -07:00
import { Link } from "react-router" ;
2023-04-05 14:48:13 -06:00
import { TagsSelector } from "../Tags" ;
2025-05-05 12:56:24 -06:00
import {
commaSeparatedValidator ,
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
useForm ,
2025-05-05 12:56:24 -06:00
} from "../hooks/useForm" ;
2024-11-02 15:14:02 -06:00
import {
channelFrequencyOptions ,
days30Option ,
2026-04-14 15:00:49 -06:00
defaultAudioFormatOption ,
2024-11-02 15:14:02 -06:00
defaultVideoFormatOption ,
defaultVideoResolutionOptions ,
2026-04-14 15:00:49 -06:00
downloadAudioFormatOptions ,
2024-11-02 15:14:02 -06:00
Downloaders ,
downloadFormatOptions ,
downloadOrderOptions ,
downloadResolutionOptions ,
extendedFrequencyOptions ,
frequencyOptions ,
weeklyOption
} from "./Vars" ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
/ *
ui: the last of Semantic UI, in name and in dead CSS
The library has been uninstalled for some time, but the codebase still read as
though it were there: identifiers named after it, rules written against its
class names, and about 180 comments explaining a rule in terms of a thing that
is no longer installed.
Renamed, keeping the vocabulary the app actually uses: semanticUIColorMap ->
navColorHexMap, semanticColorNames -> paletteColorNames, semanticNames ->
iconNameAliases, semanticSizes -> sizeAliases, and SemanticUIColors ->
NavColors in wrolpi/schema.py, which is what validates nav_color on the way in.
ColorToSemanticHexColor had no callers at all and is gone.
The baseline ratchet has done its job -- the list reached zero, so the JSON is
deleted and the guard keeps only the checks with teeth: no package, no import,
no `className="ui "`, no toast library. Its Theme.tsx check went with the
wrappers it was watching for. It also asserts its own walk found files, so a
clean result cannot mean it scanned nothing.
Deleted from App.css: every rule requiring `.ui`, `.inverted`, `.segment` or
`.modal`, none of which any component has set since the stylesheet stopped
loading, plus the form skeletons, ui-alerts and progress-text rules that
nothing renders. Two of them were doing harm rather than nothing: the drag
tints had a dark-theme variant under `.inverted` that stopped applying, leaving
15% of a fixed blue over a dark row, and now mix a token instead.
Two selectors naming markup that no longer exists were live bugs. The file
browser's filter had `.ui.input.file-browser-filter`, so it rendered at the
browser default width on a bar laid out to give it 34em -- now qualified by its
container, because `.wrolpi-action-input` sets `width: 100%` at the same
specificity and is loaded later. And SearchBox takes named props rather than a
rest spread, so the `id` DestinationForm hands it was dropped in silence and
the label it renders pointed at nothing; the download forms' Destination field
has had no associated label since the migration.
"Semantic roles" survives in four places, where it means what it says.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 19:15:57 -06:00
* Download . js was built around the old < Form > family ( Form . Input ,
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
* FormDropdown , TextArea ) via ` hooks/useForm.js ` ' s JSX helpers ( InputForm ,
* NumberInputForm , ToggleForm , UrlInput , UrlsTextarea ) . ` hooks/useForm.js ` is
* off - limits for this migration and its JSX helpers still render through
ui: the last of Semantic UI, in name and in dead CSS
The library has been uninstalled for some time, but the codebase still read as
though it were there: identifiers named after it, rules written against its
class names, and about 180 comments explaining a rule in terms of a thing that
is no longer installed.
Renamed, keeping the vocabulary the app actually uses: semanticUIColorMap ->
navColorHexMap, semanticColorNames -> paletteColorNames, semanticNames ->
iconNameAliases, semanticSizes -> sizeAliases, and SemanticUIColors ->
NavColors in wrolpi/schema.py, which is what validates nav_color on the way in.
ColorToSemanticHexColor had no callers at all and is gone.
The baseline ratchet has done its job -- the list reached zero, so the JSON is
deleted and the guard keeps only the checks with teeth: no package, no import,
no `className="ui "`, no toast library. Its Theme.tsx check went with the
wrappers it was watching for. It also asserts its own walk found files, so a
clean result cannot mean it scanned nothing.
Deleted from App.css: every rule requiring `.ui`, `.inverted`, `.segment` or
`.modal`, none of which any component has set since the stylesheet stopped
loading, plus the form skeletons, ui-alerts and progress-text rules that
nothing renders. Two of them were doing harm rather than nothing: the drag
tints had a dark-theme variant under `.inverted` that stopped applying, leaving
15% of a fixed blue over a dark row, and now mix a token instead.
Two selectors naming markup that no longer exists were live bugs. The file
browser's filter had `.ui.input.file-browser-filter`, so it rendered at the
browser default width on a bar laid out to give it 34em -- now qualified by its
container, because `.wrolpi-action-input` sets `width: 100%` at the same
specificity and is loaded later. And SearchBox takes named props rather than a
rest spread, so the `id` DestinationForm hands it was dropped in silence and
the label it renders pointed at nothing; the download forms' Destination field
has had no associated label since the migration.
"Semantic roles" survives in four places, where it means what it says.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 19:15:57 -06:00
* ` ./Theme ` . Rather than use those helpers , the field
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
* components below call ` useForm ` ' s plain data getters ( getInputProps ,
* getSelectionProps , getCustomProps ) directly and render our own markup with
* the token - driven ` ./ui ` library . See the migration report for what this
* leaves out of scope ( hooks / useForm . js itself is unmigrated ) .
* /
function FieldLabel ( { htmlFor , label , required , helpContent , helpPosition = 'top' } ) {
if ( ! label ) return null ;
return < label htmlFor = { htmlFor } style = { { display : 'block' , marginBottom : 4 } } >
< b > { label } { required && < RequiredAsterisk / > } < / b >
{ helpContent && < InfoPopup content = { helpContent } position = { helpPosition } / > }
< / l a b e l >
}
/ * * T e x t f i e l d b a c k e d b y ` f o r m . g e t I n p u t P r o p s ` . T e x t I n p u t p a s s e s a D O M e v e n t , w h i c h i s e x a c t l y
* what ` handleInputEvent ` ( inside useForm ) expects , so the props can be spread through . * /
function TextField ( {
form , name , path , type = 'text' , validator , required = false ,
placeholder = '' , label , helpContent , helpPosition , disabled = false ,
} ) {
const [ inputProps ] = form . getInputProps ( { name , path , validator , type , required } ) ;
return < div >
< FieldLabel htmlFor = { ` ${ name } _input ` } label = { label } required = { required }
helpContent = { helpContent } helpPosition = { helpPosition } / >
< TextInput
id = { ` ${ name } _input ` }
name = { name }
type = { inputProps . type }
placeholder = { placeholder }
value = { inputProps . value ? ? '' }
onChange = { inputProps . onChange }
disabled = { disabled || inputProps . disabled }
error = { inputProps . error }
data - path = { inputProps [ 'data-path' ] }
/ >
< / d i v >
}
/ * * N u m b e r f i e l d . M a n t i n e ' s N u m b e r I n p u t h a n d s b a c k t h e v a l u e i t s e l f , n o t a n e v e n t , s o i t i s
* wrapped into the event shape ` handleInputEvent ` expects . * /
function NumberField ( {
form , name , path , validator , required = false , placeholder = '' ,
label , helpContent , helpPosition , min = 1 , max = 9999999999 ,
} ) {
validator = validator || ( ( value ) => {
value = typeof value === 'number' ? value : parseFloat ( value ) ;
if ( value < 0 ) {
return 'Number must be positive' ;
}
} ) ;
const [ inputProps ] = form . getInputProps ( { name , path , validator , type : 'number' , required } ) ;
const dataPath = inputProps [ 'data-path' ] ;
return < div >
< FieldLabel htmlFor = { ` ${ name } _input ` } label = { label } required = { required }
helpContent = { helpContent } helpPosition = { helpPosition } / >
< NumberInput
id = { ` ${ name } _input ` }
placeholder = { placeholder }
min = { min }
max = { max }
value = { inputProps . value ? ? '' }
onChange = { ( value ) => inputProps . onChange ( { target : { value , type : 'number' , dataset : { path : dataPath } } } ) }
disabled = { inputProps . disabled }
error = { inputProps . error }
/ >
< / d i v >
}
ui: the last of Semantic UI, in name and in dead CSS
The library has been uninstalled for some time, but the codebase still read as
though it were there: identifiers named after it, rules written against its
class names, and about 180 comments explaining a rule in terms of a thing that
is no longer installed.
Renamed, keeping the vocabulary the app actually uses: semanticUIColorMap ->
navColorHexMap, semanticColorNames -> paletteColorNames, semanticNames ->
iconNameAliases, semanticSizes -> sizeAliases, and SemanticUIColors ->
NavColors in wrolpi/schema.py, which is what validates nav_color on the way in.
ColorToSemanticHexColor had no callers at all and is gone.
The baseline ratchet has done its job -- the list reached zero, so the JSON is
deleted and the guard keeps only the checks with teeth: no package, no import,
no `className="ui "`, no toast library. Its Theme.tsx check went with the
wrappers it was watching for. It also asserts its own walk found files, so a
clean result cannot mean it scanned nothing.
Deleted from App.css: every rule requiring `.ui`, `.inverted`, `.segment` or
`.modal`, none of which any component has set since the stylesheet stopped
loading, plus the form skeletons, ui-alerts and progress-text rules that
nothing renders. Two of them were doing harm rather than nothing: the drag
tints had a dark-theme variant under `.inverted` that stopped applying, leaving
15% of a fixed blue over a dark row, and now mix a token instead.
Two selectors naming markup that no longer exists were live bugs. The file
browser's filter had `.ui.input.file-browser-filter`, so it rendered at the
browser default width on a bar laid out to give it 34em -- now qualified by its
container, because `.wrolpi-action-input` sets `width: 100%` at the same
specificity and is loaded later. And SearchBox takes named props rather than a
rest spread, so the `id` DestinationForm hands it was dropped in silence and
the label it renders pointed at nothing; the download forms' Destination field
has had no associated label since the migration.
"Semantic roles" survives in four places, where it means what it says.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 19:15:57 -06:00
/ * * A s i n g l e - s e l e c t f i e l d . ` o p t i o n s ` a r e { k e y , t e x t , v a l u e } ; M a n t i n e ' s S e l e c t
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
* requires string data values , so values are stringified for display and mapped back on change . * /
function SelectField ( { form , name , path , label , options , required = false , placeholder , disabled = false , afterChange } ) {
const [ inputProps ] = form . getSelectionProps ( { name , path , required , afterChange } ) ;
const data = options . map ( o => ( { value : String ( o . value ) , label : o . text } ) ) ;
const stringValue = ( inputProps . value === null || inputProps . value === undefined ) ? null : String ( inputProps . value ) ;
const handleChange = ( val ) => {
if ( val === null || val === undefined ) {
inputProps . onChange ( null , { value : null } ) ;
return ;
}
const match = options . find ( o => String ( o . value ) === val ) ;
inputProps . onChange ( null , { value : match ? match . value : val } ) ;
} ;
return < div >
< FieldLabel htmlFor = { ` ${ name } _select ` } label = { label } required = { required } / >
< Select
id = { ` ${ name } _select ` }
data = { data }
value = { stringValue }
onChange = { handleChange }
placeholder = { placeholder }
disabled = { disabled || inputProps . disabled }
error = { inputProps . error }
/ >
< / d i v >
}
/** A multi-select field (Video Resolutions). */
function MultiSelectField ( { form , name , path , options , onChange : afterChange } ) {
const [ inputProps ] = form . getSelectionProps ( { name , path , type : 'array' , afterChange } ) ;
const data = options . map ( o => ( { value : String ( o . value ) , label : o . text } ) ) ;
const values = ( inputProps . value || [ ] ) . map ( String ) ;
const handleChange = ( vals ) => {
const mapped = vals . map ( v => {
const match = options . find ( o => String ( o . value ) === v ) ;
return match ? match . value : v ;
} ) ;
inputProps . onChange ( null , { value : mapped } ) ;
} ;
return < MultiSelect
data = { data }
value = { values }
onChange = { handleChange }
error = { inputProps . error }
/ >
}
2024-11-02 15:14:02 -06:00
export function DepthInputForm ( { form , required , name = 'depth' , path = 'settings.depth' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < NumberField
2024-11-02 15:14:02 -06:00
form = { form }
required = { required }
name = { name }
path = { path }
label = 'Depth'
max = { 4 }
helpContent = 'Search the URLs provided, and any URLs they contain up to this depth. Warning: This can be exponential!'
/ >
}
2021-12-20 16:08:13 -07:00
2024-11-02 15:14:02 -06:00
export function MaximumPagesInputForm ( { form , required , name = 'max_pages' , path = 'settings.max_pages' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < NumberField
2024-11-02 15:14:02 -06:00
form = { form }
required = { required }
name = { name }
path = { path }
label = 'Maximum Pages'
max = { 100000 }
helpContent = 'Stop searching for files if this many pages have been searched.'
/ >
}
2021-12-20 16:08:13 -07:00
2024-11-02 15:14:02 -06:00
export function DestinationForm ( {
form ,
2025-01-24 14:28:04 -07:00
infoContent ,
2024-11-02 15:14:02 -06:00
label = 'Destination' ,
2024-12-03 12:44:38 -07:00
name = 'destination' ,
2024-11-02 15:14:02 -06:00
path = 'destination' ,
required = false ,
} ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
const [ inputProps ] = form . getCustomProps ( { name , path , required } ) ;
2024-11-02 15:14:02 -06:00
const { disabled , value , onChange } = inputProps ;
2025-01-24 14:28:04 -07:00
const infoPopup = infoContent ? < InfoPopup content = { infoContent } / > : null ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < div >
< FieldLabel htmlFor = 'destination_search_form' label = { label } required = { required } / >
{ infoPopup }
2024-11-02 15:14:02 -06:00
< DirectorySearch
required = { required }
value = { value }
onSelect = { onChange }
disabled = { disabled }
2024-12-03 12:44:38 -07:00
id = 'destination_search_form'
2024-11-02 15:14:02 -06:00
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
2024-11-02 15:14:02 -06:00
}
2021-12-20 16:08:13 -07:00
2024-11-02 15:14:02 -06:00
export function DownloadTagsSelector ( { form , limit , path = 'tag_names' , name = 'tag_names' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
const [ inputProps ] = form . getCustomProps ( { name , path } ) ;
2024-11-02 15:14:02 -06:00
const { value , onChange } = inputProps ;
return < TagsSelector
disabled = { form . disabled }
selectedTagNames = { value }
limit = { limit }
onChange = { onChange }
closeAfterAdd = { ! ! limit }
/ > ;
}
2021-12-20 16:08:13 -07:00
2024-11-02 15:14:02 -06:00
export function DownloadFrequencySelector ( {
form ,
freqOptions = frequencyOptions ,
name = 'frequency' ,
path = 'frequency' ,
} ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < SelectField
form = { form }
name = { name }
path = { path }
2024-11-02 15:14:02 -06:00
required
label = 'Download Frequency'
placeholder = 'Frequency'
options = { freqOptions }
/ >
}
2021-12-20 16:08:13 -07:00
2024-11-02 15:14:02 -06:00
export function DownloaderSelector ( { form , name = 'sub_downloader' , path = 'sub_downloader' } ) {
const [ downloaders , setDownloaders ] = React . useState ( [ ] ) ;
2023-04-01 16:09:05 -06:00
2024-11-02 15:14:02 -06:00
const fetchDownloaders = async ( ) => {
let { downloaders : downloaders _ } = await getDownloaders ( ) ;
downloaders _ = downloaders _ . map ( ( i ) => {
return { key : i . name , text : i . pretty _name || i . name , value : i . name }
} )
setDownloaders ( downloaders _ ) ;
2023-04-02 16:30:01 -06:00
}
2024-11-02 15:14:02 -06:00
React . useEffect ( ( ) => {
fetchDownloaders ( ) ;
} , [ ] ) ;
2023-04-01 16:09:05 -06:00
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < SelectField
form = { form }
name = { name }
path = { path }
required
label = 'Downloader'
placeholder = 'Select a downloader'
options = { downloaders }
2024-11-02 15:14:02 -06:00
/ >
}
2023-04-01 16:09:05 -06:00
2024-11-02 15:14:02 -06:00
export function ExcludedUrls ( { form , name = 'excluded_urls' , path = 'settings.excluded_urls' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < TextField
2024-11-02 15:14:02 -06:00
form = { form }
type = 'text'
name = { name }
path = { path }
helpContent = "Comma-separated list of keywords that will be ignored if they are in any link's URL"
label = 'Excluded URLs'
placeholder = 'prize,gift'
validator = { commaSeparatedValidator }
/ >
}
2023-04-03 09:34:42 -06:00
2024-11-02 15:14:02 -06:00
export function TitleInclusionInput ( { form , path = 'settings.title_include' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < TextField
form = { form }
name = 'title_include'
path = { path }
label = 'Title Match Words'
helpContent = 'List of words, separated by commas, that titles must contain to be downloaded.'
placeholder = 'Shelter,Solar Power'
validator = { commaSeparatedValidator }
/ >
2024-11-02 15:14:02 -06:00
}
export function TitleExclusionInput ( { form , path = 'settings.title_exclude' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < TextField
form = { form }
name = 'title_exclude'
path = { path }
label = 'Title Exclusion Words'
helpContent = 'List of words, separated by commas, that may not appear in titles to be downloaded.'
placeholder = 'Giveaway,Prize'
validator = { commaSeparatedValidator }
/ >
2024-11-02 15:14:02 -06:00
}
2022-11-09 08:33:55 -07:00
2024-11-02 15:14:02 -06:00
export function DownloadFormButtons ( { onCancel , form } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < Group justify = 'space-between' mt = 'sm' >
< Button role = 'cancel' onClick = { onCancel } type = 'button' > Cancel < / B u t t o n >
< APIButton
role = 'primary'
disabled = { form . disabled || ! form . ready }
type = 'submit'
onClick = { form . onSubmit }
id = 'download_form_download_button'
> Download < / A P I B u t t o n >
< / G r o u p >
2024-11-02 15:14:02 -06:00
}
export function EditDownloadFormButtons ( { onDelete , onCancel , form } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < Group justify = 'space-between' mt = 'sm' >
< APIButton
role = 'danger'
confirmButton = 'Delete'
confirmContent = 'Delete this Download?'
confirmHeader = 'Delete'
onClick = { onDelete }
> Delete < / A P I B u t t o n >
< Group >
< Button role = 'cancel' onClick = { onCancel } > Cancel < / B u t t o n >
< APIButton
role = 'save'
disabled = { form . disabled || ! form . ready }
type = 'submit'
onClick = { form . onSubmit }
> Save < / A P I B u t t o n >
< / G r o u p >
< / G r o u p >
2024-11-02 15:14:02 -06:00
}
function VideoDownloadOrder ( { form , path = 'settings.download_order' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < SelectField
form = { form }
name = 'download_order'
path = { path }
label = 'Download Order'
options = { downloadOrderOptions }
2024-11-02 15:14:02 -06:00
/ >
}
function VideoDownloadCountLimit ( { form , name = 'video_count_limit' , path = 'settings.video_count_limit' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < NumberField
2024-11-02 15:14:02 -06:00
form = { form }
helpContent = 'Stop downloading videos from this channel/playlist when this many have been downloaded.'
helpPosition = 'top right'
name = { name }
path = { path }
label = 'Video Count Limit'
placeholder = '100'
/ >
}
2025-12-06 14:49:46 -07:00
export function VideoResolutionSelectorForm ( {
form ,
name = 'video_resolutions' ,
path = 'settings.video_resolutions' ,
onChange
} ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < div >
2025-01-24 14:28:04 -07:00
< InfoHeader
2024-11-02 15:14:02 -06:00
headerSize = 'h5'
headerContent = 'Video Resolutions'
popupContent = 'Videos will be downloaded in the first available resolution from the list you select.'
for _ = 'video_resolutions_input'
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< MultiSelectField
form = { form }
name = { name }
path = { path }
options = { downloadResolutionOptions }
onChange = { onChange }
2024-11-02 15:14:02 -06:00
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
2024-11-02 15:14:02 -06:00
}
2026-03-05 16:18:03 -07:00
export function VideoFormatSelectorForm ( { form , name = 'video_format' , path = 'settings.video_format' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < div >
2025-01-24 14:28:04 -07:00
< InfoHeader
2024-11-02 15:14:02 -06:00
headerSize = 'h5'
headerContent = 'Video Format'
popupContent = 'Videos will be downloaded in this format, or transcoded if not available.'
for _ = 'video_format_input'
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< SelectField form = { form } name = { name } path = { path } options = { downloadFormatOptions } / >
< / d i v >
2024-11-02 15:14:02 -06:00
}
2026-04-14 15:00:49 -06:00
export function AudioOnlyToggle ( { form , onChange } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
const [ inputProps ] = form . getCustomProps ( { name : 'audio_only' , path : 'settings.audio_only' } ) ;
return < Toggle
2026-04-14 15:00:49 -06:00
label = 'Audio only'
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
checked = { ! ! inputProps . value }
disabled = { form . disabled }
onChange = { ( value ) => {
inputProps . onChange ( value ) ;
if ( onChange ) onChange ( value ) ;
} }
info = 'Download only the audio track from videos.'
2026-04-14 15:00:49 -06:00
/ >
}
export function AudioFormatSelectorForm ( { form , name = 'audio_format' , path = 'settings.audio_format' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < div >
2026-04-14 15:00:49 -06:00
< InfoHeader
headerSize = 'h5'
headerContent = 'Audio Format'
popupContent = 'Audio will be downloaded and converted to this format.'
for _ = 'audio_format_input'
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< SelectField form = { form } name = { name } path = { path } options = { downloadAudioFormatOptions } / >
< / d i v >
2026-04-14 15:00:49 -06:00
}
2024-11-02 15:14:02 -06:00
function VideoDurationLimit ( { form , name , path , label , helpContent , placeholder , helpPosition } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < NumberField
2024-11-02 15:14:02 -06:00
form = { form }
helpContent = { helpContent }
helpPosition = { helpPosition }
placeholder = { placeholder }
name = { name }
path = { path }
label = { label }
/ >
}
export function VideoTagsForm ( { form } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < div >
2025-01-24 14:28:04 -07:00
< InfoHeader
2024-11-02 15:14:02 -06:00
headerSize = 'h4'
headerContent = 'Videos Tags'
popupContent = 'Tag all Videos with these Tags.'
/ >
< DownloadTagsSelector form = { form } / >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
2024-11-02 15:14:02 -06:00
}
export function ChannelTagNameForm ( { form } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < div >
2025-01-24 14:28:04 -07:00
< InfoHeader
2024-11-02 15:14:02 -06:00
headerSize = 'h4'
headerContent = 'Channel Tag'
popupContent = 'If the Channel is new, apply this Tag.'
/ >
< DownloadTagsSelector
form = { form }
limit = { 1 }
name = 'channel_tag_name'
path = 'settings.channel_tag_name'
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
2021-12-20 16:08:13 -07:00
}
2026-03-05 16:18:03 -07:00
function AdvancedVideoSettings ( { form , isVideoLevel = false , isConfigLoaded = true } ) {
if ( ! isConfigLoaded ) return null ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < SimpleAccordion title = 'Advanced Settings' >
< Stack gap = 'md' >
< Group grow align = 'flex-start' wrap = 'wrap' >
< AudioOnlyToggleLikeVideoSetting form = { form } name = 'writesubtitles' path = 'settings.writesubtitles'
label = 'Download subtitles' icon = 'closed captioning' / >
< AudioOnlyToggleLikeVideoSetting form = { form } name = 'writeautomaticsub' path = 'settings.writeautomaticsub'
label = 'Download automatic subtitles' icon = 'closed captioning' / >
< / G r o u p >
< Group grow align = 'flex-start' wrap = 'wrap' >
< AudioOnlyToggleLikeVideoSetting form = { form } name = 'writethumbnail' path = 'settings.writethumbnail'
label = 'Download thumbnail' icon = 'image' / >
< AudioOnlyToggleLikeVideoSetting form = { form } name = 'writeinfojson' path = 'settings.writeinfojson'
label = 'Download info JSON' icon = 'file code' / >
< / G r o u p >
{ isVideoLevel &&
< Group grow align = 'flex-start' wrap = 'wrap' >
< AudioOnlyToggleLikeVideoSetting form = { form } name = 'continue_dl' path = 'settings.continue_dl'
label = 'Continue partial downloads' icon = 'play' / >
< AudioOnlyToggleLikeVideoSetting form = { form } name = 'nooverwrites' path = 'settings.nooverwrites'
label = 'Do not overwrite existing files' icon = 'file video' / >
< / G r o u p > }
< Group grow align = 'flex-start' wrap = 'wrap' >
< NumberField
form = { form }
label = 'Sleep between requests (seconds)'
name = 'sleep_requests'
path = 'settings.sleep_requests'
placeholder = '0.75'
min = { 0 }
max = { 60 }
/ >
< TextField
form = { form }
label = 'User agent'
name = 'user_agent'
path = 'settings.user_agent'
placeholder = 'Mozilla/5.0...'
/ >
< / G r o u p >
< TextField
form = { form }
label = 'Extra yt-dlp arguments'
name = 'yt_dlp_extra_args'
path = 'settings.yt_dlp_extra_args'
placeholder = '--no-playlist --geo-bypass'
/ >
< / S t a c k >
< / S i m p l e A c c o r d i o n >
}
/** A labeled Toggle backed by `form.getCustomProps`. */
function AudioOnlyToggleLikeVideoSetting ( { form , name , path , label , icon } ) {
const [ inputProps ] = form . getCustomProps ( { name , path } ) ;
return < Toggle
label = { label }
icon = { icon }
checked = { ! ! inputProps . value }
disabled = { form . disabled }
onChange = { inputProps . onChange }
/ >
2026-03-05 16:18:03 -07:00
}
2026-06-11 17:54:22 -06:00
export function CompressSinglefileToggle ( { form } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
const [ inputProps ] = form . getCustomProps ( { name : 'compress_singlefile' , path : 'settings.compress_singlefile' } ) ;
return < div >
2026-06-11 17:54:22 -06:00
< InfoHeader
headerSize = 'h4'
headerContent = 'Compress'
popupContent = ' Create a compressed , self - extracting ( SingleFileZ ) archive . The HTML file is smaller , but not
human - readable . Readability files are never compressed . '
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Toggle checked = { ! ! inputProps . value } disabled = { form . disabled } onChange = { inputProps . onChange } / >
< / d i v >
2026-06-11 17:54:22 -06:00
}
2026-05-05 14:28:36 -06:00
function AdvancedDownloadSettings ( { form } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
const [ inputProps ] = form . getCustomProps ( {
name : 'skip_already_downloaded' ,
path : 'settings.skip_already_downloaded'
} ) ;
return < SimpleAccordion title = 'Advanced Settings' >
< Toggle
label = 'Skip URLs already downloaded'
checked = { ! ! inputProps . value }
disabled = { form . disabled }
onChange = { inputProps . onChange }
/ >
< / S i m p l e A c c o r d i o n >
2026-05-05 14:28:36 -06:00
}
2025-12-06 14:49:46 -07:00
export function VideosDownloadForm ( {
singleDownload = true ,
onCancel ,
onSuccess : propOnSuccess ,
download ,
submitter : propSubmitter ,
actions
} ) {
2024-12-03 12:44:38 -07:00
const [ showMessage , setShowMessage ] = React . useState ( false ) ;
2025-06-07 17:36:00 -06:00
const [ userChangedResolutions , setUserChangedResolutions ] = React . useState ( false ) ;
const [ config , setConfig ] = React . useState ( null ) ;
2026-03-05 16:18:03 -07:00
const [ isConfigLoaded , setIsConfigLoaded ] = React . useState ( false ) ;
2024-12-03 12:44:38 -07:00
2025-06-07 17:36:00 -06:00
// Keep video format in session to help user start downloads consistently.
2024-11-02 15:14:02 -06:00
const [ defaultVideoFormat , setDefaultVideoFormat ] = useLocalStorage ( 'video_format' , defaultVideoFormatOption ) ;
2025-06-07 17:36:00 -06:00
// Use config video resolutions if available, otherwise use default
const configResolutions = config && config . video _resolutions ? config . video _resolutions : defaultVideoResolutionOptions ;
2024-11-02 15:14:02 -06:00
const defaultFormData = {
urls : '' , // Textarea, one URL per line.
destination : '' ,
tag _names : [ ] ,
downloader : Downloaders . Video ,
settings : {
video _format : defaultVideoFormat ,
2025-06-07 17:36:00 -06:00
video _resolutions : configResolutions ,
2026-04-14 15:00:49 -06:00
audio _only : false ,
audio _format : defaultAudioFormatOption ,
2026-03-05 16:18:03 -07:00
writesubtitles : false ,
writeautomaticsub : false ,
writethumbnail : false ,
writeinfojson : false ,
yt _dlp _extra _args : '' ,
2026-05-31 12:43:56 -06:00
sleep _requests : null ,
2026-03-05 16:18:03 -07:00
user _agent : '' ,
continue _dl : false ,
nooverwrites : false ,
2024-11-02 15:14:02 -06:00
}
2022-05-20 15:15:31 -06:00
}
2025-06-07 17:36:00 -06:00
const submitter = propSubmitter || ( async ( formData ) => {
2024-11-02 15:14:02 -06:00
const downloadData = {
destination : formData . destination ,
downloader : formData . downloader ,
settings : formData . settings ,
tag _names : formData . tag _names ,
urls : formData . urls . split ( /r?\n/ ) ,
}
await postDownload ( downloadData ) ;
2025-06-07 17:36:00 -06:00
} ) ;
2022-05-20 15:15:31 -06:00
2024-11-02 15:14:02 -06:00
const onSuccess = ( ) => {
2024-12-03 12:44:38 -07:00
setShowMessage ( true ) ;
2025-06-07 17:36:00 -06:00
if ( propOnSuccess ) {
propOnSuccess ( ) ;
} else {
form . reset ( ) ;
}
2022-05-20 15:15:31 -06:00
}
2024-12-03 12:44:38 -07:00
const form = useForm ( {
submitter ,
2025-06-07 17:36:00 -06:00
defaultFormData : download ? mergeDeep ( defaultFormData , download ) : defaultFormData ,
2024-12-03 12:44:38 -07:00
onSuccess ,
} ) ;
2024-11-02 15:14:02 -06:00
2026-03-05 16:18:03 -07:00
// Fetch global defaults to pre-fill the form
2024-11-02 15:14:02 -06:00
React . useEffect ( ( ) => {
2026-03-05 16:18:03 -07:00
const fetchDefaults = async ( ) => {
2025-06-07 17:36:00 -06:00
try {
2026-03-05 16:18:03 -07:00
const defaults = await fetchVideoDownloadDefaults ( ) ;
setConfig ( defaults ) ;
if ( defaults && download ) {
// Edit mode: only fill settings not already in the download
for ( const [ key , value ] of Object . entries ( defaults ) ) {
if ( download . settings ? . [ key ] === undefined || download . settings ? . [ key ] === null ) {
form . setValue ( ` settings. ${ key } ` , value ) ;
}
}
} else if ( defaults ) {
// New download: pre-fill all settings from global defaults
const downloadHasResolutions = download ? . settings ? . video _resolutions ? . length > 0 ;
for ( const [ key , value ] of Object . entries ( defaults ) ) {
if ( key === 'video_resolutions' && ( userChangedResolutions || downloadHasResolutions ) ) {
continue ;
}
if ( key === 'video_format' ) {
continue ; // Handled by localStorage default
}
form . setValue ( ` settings. ${ key } ` , value ) ;
}
if ( ! userChangedResolutions && ! downloadHasResolutions && defaults . video _resolutions ) {
form . setValue ( 'settings.video_resolutions' , defaults . video _resolutions ) ;
}
2025-06-07 17:36:00 -06:00
}
} catch ( error ) {
2026-03-05 16:18:03 -07:00
console . error ( 'Failed to fetch video download defaults:' , error ) ;
2025-06-07 17:36:00 -06:00
}
2026-03-05 16:18:03 -07:00
setIsConfigLoaded ( true ) ;
2025-06-07 17:36:00 -06:00
} ;
2026-03-05 16:18:03 -07:00
fetchDefaults ( ) ;
2025-06-07 17:36:00 -06:00
} , [ ] ) ;
React . useEffect ( ( ) => {
const { video _format } = form . formData . settings ;
2024-11-02 15:14:02 -06:00
if ( video _format && video _format !== defaultVideoFormat ) {
setDefaultVideoFormat ( video _format ) ;
2022-05-20 15:15:31 -06:00
}
2024-11-02 15:14:02 -06:00
} , [ form . formData ] ) ;
2022-05-20 15:15:31 -06:00
2024-11-02 15:14:02 -06:00
const localOnCancel = ( e ) => {
if ( e ) e . preventDefault ( ) ;
if ( onCancel ) {
onCancel ( ) ;
2023-08-17 17:53:29 -06:00
}
}
2024-11-02 15:14:02 -06:00
// This form can handle a single Video download, or multiple video downloads.
const urlInput = singleDownload ?
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< UrlField required form = { form } path = 'urls' / >
: < UrlsField required form = { form } / > ;
return < form onSubmit = { ( e ) => e . preventDefault ( ) } >
< Header as = 'h3' icon = 'film' > Videos < / H e a d e r >
2024-11-02 15:14:02 -06:00
< p > Download each video at the URLs provided below . < / p >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Stack gap = 'md' >
{ urlInput }
< VideoTagsForm form = { form } / >
< DestinationForm
form = { form }
infoContent = "Videos download into their Channel's directory, by default. If this is provided, then videos in this Channel/Playlist will download to this directory instead."
/ >
< AudioOnlyToggle form = { form } / >
2026-04-14 15:00:49 -06:00
{ form . formData ? . settings ? . audio _only
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
? < AudioFormatSelectorForm form = { form } / >
: < Group align = 'flex-start' wrap = 'wrap' >
< div style = { { flex : 3 , minWidth : 240 } } >
2026-04-14 15:00:49 -06:00
< VideoResolutionSelectorForm
form = { form }
onChange = { ( ) => setUserChangedResolutions ( true ) }
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< div style = { { flex : 1 , minWidth : 140 } } >
2026-04-14 15:00:49 -06:00
< VideoFormatSelectorForm form = { form } / >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< / G r o u p >
2026-04-14 15:00:49 -06:00
}
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< ChannelTagNameForm form = { form } / >
< AdvancedVideoSettings form = { form } isVideoLevel = { true } isConfigLoaded = { isConfigLoaded } / >
2024-12-03 12:44:38 -07:00
{ showMessage && < SuccessfulDownloadSubmitMessage / > }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
{ actions ? actions ( { onCancel : localOnCancel , form } ) :
< DownloadFormButtons onCancel = { localOnCancel } form = { form } / > }
< / S t a c k >
< / f o r m >
2022-05-20 15:15:31 -06:00
}
2024-11-02 15:14:02 -06:00
export function VideoMinimumDurationForm ( { form } ) {
return < VideoDurationLimit
form = { form }
path = 'settings.minimum_duration'
label = 'Minimum Duration'
name = 'minimum_duration'
helpContent = 'Download only Videos this many seconds long, or greater.'
placeholder = '60'
/ >
}
2022-05-20 15:15:31 -06:00
2025-06-07 17:36:00 -06:00
export function EditVideosDownloadForm ( {
2025-12-06 14:49:46 -07:00
download ,
onCancel ,
onSuccess ,
onDelete ,
actions = EditDownloadFormButtons ,
} ) {
2025-06-07 17:36:00 -06:00
const submitter = async ( formData ) => {
// Create a copy of settings without channel_url and channel_id
const settings = { ... formData . settings } ;
// These settings are created when downloading the video, we can't submit them again.
delete settings . channel _url ;
delete settings . channel _id ;
const downloadData = {
2026-02-08 19:34:24 -07:00
collection _id : download . collection _id ,
2025-06-07 17:36:00 -06:00
destination : formData . destination ,
downloader : formData . downloader ,
settings : settings ,
tag _names : formData . tag _names ,
urls : formData . urls . split ( /r?\n/ ) ,
}
await putDownload ( download . id , downloadData ) ;
}
return < VideosDownloadForm
singleDownload = { true }
onCancel = { onCancel }
onSuccess = { onSuccess }
download = { download }
submitter = { submitter }
actions = { ( props ) => actions ( { ... props , onDelete } ) }
/ >
}
2024-11-02 15:14:02 -06:00
export function VideoMaximumDurationForm ( { form } ) {
return < VideoDurationLimit
form = { form }
path = 'settings.maximum_duration'
label = 'Maximum Duration'
name = 'maximum_duration'
helpContent = 'Do not download videos longer than this many seconds.'
placeholder = '3600'
/ >
}
2022-05-20 15:15:31 -06:00
2024-11-02 15:14:02 -06:00
export function ChannelDownloadForm ( {
download ,
onCancel ,
onSuccess ,
onDelete = async ( ) => {
} ,
submitter ,
actions = null ,
clearOnSuccess = true ,
channel _id = null ,
} ) {
2024-12-03 12:44:38 -07:00
const [ showMessage , setShowMessage ] = React . useState ( false ) ;
2025-06-07 17:36:00 -06:00
const [ config , setConfig ] = React . useState ( null ) ;
const [ isConfigLoaded , setIsConfigLoaded ] = React . useState ( false ) ;
const [ userChangedResolutions , setUserChangedResolutions ] = React . useState ( false ) ;
2024-11-02 15:14:02 -06:00
// May have received submitter from EditChannelDownloadForm.
submitter = submitter || ( async ( formData ) => {
const downloadData = {
destination : formData . destination ,
downloader : formData . downloader ,
frequency : formData . frequency ,
settings : formData . settings ,
sub _downloader : formData . sub _downloader ,
tag _names : formData . tag _names || [ ] ,
urls : [ formData . url , ] ,
2022-05-20 15:15:31 -06:00
}
2024-11-02 15:14:02 -06:00
await postDownload ( downloadData ) ;
} ) ;
2024-12-03 12:44:38 -07:00
const localOnSuccess = async ( ) => {
setShowMessage ( true ) ;
if ( onSuccess ) {
onSuccess ( ) ;
}
}
2025-06-07 17:36:00 -06:00
// Keep video format in session to help user start downloads consistently.
2024-11-02 15:14:02 -06:00
const [ defaultVideoFormat , setDefaultVideoFormat ] = useLocalStorage ( 'video_format' , defaultVideoFormatOption ) ;
2025-06-07 17:36:00 -06:00
// Use config video resolutions if available, otherwise use default
const configResolutions = config && config . video _resolutions ? config . video _resolutions : defaultVideoResolutionOptions ;
2024-11-02 15:14:02 -06:00
const emptyFormData = {
destination : '' ,
downloader : Downloaders . VideoChannel ,
frequency : days30Option . value ,
url : '' ,
settings : {
channel _id ,
channel _tag _name : [ ] ,
download _order : 'newest' ,
maximum _duration : null ,
minimum _duration : null ,
title _exclude : null ,
title _include : null ,
video _count _limit : null ,
video _format : defaultVideoFormat ,
2025-06-07 17:36:00 -06:00
video _resolutions : configResolutions ,
2026-04-14 15:00:49 -06:00
audio _only : false ,
audio _format : defaultAudioFormatOption ,
2026-03-05 16:18:03 -07:00
writesubtitles : false ,
writeautomaticsub : false ,
writethumbnail : false ,
writeinfojson : false ,
yt _dlp _extra _args : '' ,
2026-05-31 12:43:56 -06:00
sleep _requests : null ,
2026-03-05 16:18:03 -07:00
user _agent : '' ,
2024-11-02 15:14:02 -06:00
} ,
sub _downloader : Downloaders . Video ,
tag _names : [ ] ,
} ;
const form = useForm ( {
submitter ,
defaultFormData : mergeDeep ( emptyFormData , download ) ,
emptyFormData ,
2024-12-03 12:44:38 -07:00
onSuccess : localOnSuccess ,
2024-11-02 15:14:02 -06:00
clearOnSuccess ,
} ) ;
2026-03-05 16:18:03 -07:00
// Fetch global defaults to pre-fill the form
2024-11-02 15:14:02 -06:00
React . useEffect ( ( ) => {
2026-03-05 16:18:03 -07:00
const fetchDefaults = async ( ) => {
2025-06-07 17:36:00 -06:00
try {
2026-03-05 16:18:03 -07:00
const defaults = await fetchVideoDownloadDefaults ( ) ;
setConfig ( defaults ) ;
2025-06-07 17:36:00 -06:00
setIsConfigLoaded ( true ) ;
2026-03-05 16:18:03 -07:00
if ( defaults && download ) {
// Edit mode: only fill settings not already in the download
for ( const [ key , value ] of Object . entries ( defaults ) ) {
if ( key === 'continue_dl' || key === 'nooverwrites' ) continue ;
if ( download . settings ? . [ key ] === undefined || download . settings ? . [ key ] === null ) {
form . setValue ( ` settings. ${ key } ` , value ) ;
}
}
} else if ( defaults ) {
// New download: pre-fill all inheritable settings from global defaults
const downloadHasResolutions = download ? . settings ? . video _resolutions ? . length > 0 ;
for ( const [ key , value ] of Object . entries ( defaults ) ) {
if ( key === 'continue_dl' || key === 'nooverwrites' ) continue ;
if ( key === 'video_resolutions' && ( userChangedResolutions || downloadHasResolutions ) ) continue ;
if ( key === 'video_format' ) continue ;
form . setValue ( ` settings. ${ key } ` , value ) ;
}
if ( ! userChangedResolutions && ! downloadHasResolutions && defaults . video _resolutions ) {
form . setValue ( 'settings.video_resolutions' , defaults . video _resolutions ) ;
}
2025-06-07 17:36:00 -06:00
}
} catch ( error ) {
2026-03-05 16:18:03 -07:00
console . error ( 'Failed to fetch video download defaults:' , error ) ;
2025-06-07 17:36:00 -06:00
setIsConfigLoaded ( true ) ;
}
} ;
2026-03-05 16:18:03 -07:00
fetchDefaults ( ) ;
2025-06-07 17:36:00 -06:00
} , [ ] ) ;
React . useEffect ( ( ) => {
const { video _format } = form . formData . settings ;
2024-11-02 15:14:02 -06:00
if ( video _format && video _format !== defaultVideoFormat ) {
setDefaultVideoFormat ( video _format ) ;
}
} , [ form . formData ] ) ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
const onceMessage = < Message kind = 'info' title = 'Download Once' >
You have selected a frequency of Once , this is useful when you want to download
all videos in a Playlist , and when you do not want to download any videos added to the playlist
in the future .
2024-11-02 15:14:02 -06:00
< / M e s s a g e > ;
// Default to "new" download buttons.
actions = actions || DownloadFormButtons ;
const actionsElm = actions ( { onDelete , onCancel , form } ) ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < form onSubmit = { ( e ) => e . preventDefault ( ) } >
< Header as = 'h3' icon = 'film' > Channel / Playlist < / H e a d e r >
< Stack gap = 'md' >
< UrlField required form = { form } / >
< VideoTagsForm form = { form } / >
< Group align = 'flex-start' wrap = 'wrap' >
< div style = { { flex : 1 , minWidth : 200 } } >
2024-11-02 15:14:02 -06:00
< DownloadFrequencySelector form = { form } freqOptions = { channelFrequencyOptions } / >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< div style = { { flex : 3 , minWidth : 240 } } >
2024-11-02 15:14:02 -06:00
< DestinationForm
form = { form }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
infoContent = 'Destination is not required. Videos will download into the automatically created Channel directory.'
2024-11-02 15:14:02 -06:00
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< / G r o u p >
{ form . formData . frequency === 0 && onceMessage }
< Group grow align = 'flex-start' wrap = 'wrap' >
< TitleInclusionInput form = { form } / >
< TitleExclusionInput form = { form } / >
< / G r o u p >
< Group grow align = 'flex-start' wrap = 'wrap' >
< VideoDownloadOrder form = { form } / >
< VideoDownloadCountLimit form = { form } / >
< / G r o u p >
< AudioOnlyToggle form = { form } / >
2026-04-14 15:00:49 -06:00
{ form . formData ? . settings ? . audio _only
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
? < AudioFormatSelectorForm form = { form } / >
: < Group align = 'flex-start' wrap = 'wrap' >
< div style = { { flex : 3 , minWidth : 240 } } >
2026-04-14 15:00:49 -06:00
< VideoResolutionSelectorForm
form = { form }
onChange = { ( ) => setUserChangedResolutions ( true ) }
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< div style = { { flex : 1 , minWidth : 140 } } >
2026-04-14 15:00:49 -06:00
< VideoFormatSelectorForm form = { form } / >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< / G r o u p >
2026-04-14 15:00:49 -06:00
}
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Group grow align = 'flex-start' wrap = 'wrap' >
< VideoMinimumDurationForm form = { form } / >
< VideoMaximumDurationForm form = { form } / >
< / G r o u p >
< ChannelTagNameForm form = { form } / >
< AdvancedVideoSettings form = { form } isConfigLoaded = { isConfigLoaded } / >
2024-12-03 12:44:38 -07:00
{ showMessage && < SuccessfulDownloadSubmitMessage / > }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
{ actionsElm }
< / S t a c k >
< / f o r m >
2024-11-02 15:14:02 -06:00
}
2021-12-20 16:08:13 -07:00
2024-11-02 15:14:02 -06:00
export function EditChannelDownloadForm ( {
download ,
onCancel ,
onSuccess ,
onDelete ,
withTags = true ,
actions = EditDownloadFormButtons ,
} ) {
const submitter = async ( formData ) => {
const downloadData = {
2026-02-08 19:34:24 -07:00
collection _id : download . collection _id ,
2024-11-02 15:14:02 -06:00
destination : formData . destination ,
downloader : formData . downloader ,
frequency : formData . frequency ,
settings : formData . settings ,
2024-12-03 12:44:38 -07:00
tag _names : formData . tag _names || [ ] ,
2024-11-02 15:14:02 -06:00
urls : [ formData . url , ] ,
}
await putDownload ( download . id , downloadData ) ;
2022-10-11 08:12:32 -06:00
}
2024-11-02 15:14:02 -06:00
return < ChannelDownloadForm
download = { download }
submitter = { submitter }
onCancel = { onCancel }
onSuccess = { onSuccess }
onDelete = { onDelete }
withTags = { withTags }
actions = { actions }
clearOnSuccess = { false }
/ >
}
function SuccessfulDownloadSubmitMessage ( ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < Message kind = 'success' title = 'Download Submitted' >
< Link to = '/admin' > < Icon name = 'checkmark' / > View downloads < / L i n k >
< / M e s s a g e >
2024-11-02 15:14:02 -06:00
}
2025-06-07 17:36:00 -06:00
export function EditArchiveDownloadForm ( {
2025-12-06 14:49:46 -07:00
download ,
onCancel ,
onSuccess ,
onDelete ,
actions = EditDownloadFormButtons ,
} ) {
2025-06-07 17:36:00 -06:00
const submitter = async ( formData ) => {
const downloadData = {
2026-02-08 19:34:24 -07:00
collection _id : download . collection _id ,
2025-06-07 17:36:00 -06:00
downloader : formData . downloader ,
tag _names : formData . tag _names ,
urls : formData . urls . split ( /\r?\n/ ) ,
}
await putDownload ( download . id , downloadData ) ;
}
return < ArchiveDownloadForm
2026-02-18 15:16:10 -07:00
singleDownload = { true }
2025-06-07 17:36:00 -06:00
download = { download }
onCancel = { onCancel }
onSuccess = { onSuccess }
submitter = { submitter }
actions = { ( props ) => actions ( { ... props , onDelete } ) }
/ >
}
2026-03-05 16:18:03 -07:00
export function ArchiveDownloadForm ( {
singleDownload = false ,
download ,
onCancel ,
onSuccess : propOnSuccess ,
submitter : propSubmitter ,
actions
} ) {
2024-11-02 15:14:02 -06:00
const [ showMessage , setShowMessage ] = React . useState ( false ) ;
2026-06-11 17:54:22 -06:00
// Remember the user's compression choice between downloads.
const [ defaultCompressSinglefile , setDefaultCompressSinglefile ] = useLocalStorage ( 'compress_singlefile' , false ) ;
2025-06-07 17:36:00 -06:00
const submitter = propSubmitter || ( async ( formData ) => {
2024-11-02 15:14:02 -06:00
const downloadData = {
downloader : formData . downloader ,
tag _names : formData . tag _names ,
urls : formData . urls . split ( /\r?\n/ ) ,
2026-05-05 14:28:36 -06:00
settings : formData . settings ,
2024-11-02 15:14:02 -06:00
}
await postDownload ( downloadData ) ;
2025-06-07 17:36:00 -06:00
} ) ;
2024-11-02 15:14:02 -06:00
const emptyFormData = {
downloader : Downloaders . Archive ,
urls : '' ,
tag _names : [ ] ,
2026-05-05 14:28:36 -06:00
settings : {
skip _already _downloaded : false ,
2026-06-11 17:54:22 -06:00
compress _singlefile : defaultCompressSinglefile ,
2026-05-05 14:28:36 -06:00
} ,
2024-11-02 15:14:02 -06:00
} ;
2025-06-07 17:36:00 -06:00
const onSuccess = ( ) => {
setShowMessage ( true ) ;
if ( propOnSuccess ) {
propOnSuccess ( ) ;
}
}
2024-11-02 15:14:02 -06:00
const form = useForm ( {
submitter ,
defaultFormData : mergeDeep ( emptyFormData , download ) ,
emptyFormData ,
2025-06-07 17:36:00 -06:00
clearOnSuccess : ! propOnSuccess ,
onSuccess ,
2024-11-02 15:14:02 -06:00
} ) ;
2026-06-11 17:54:22 -06:00
// Persist the user's compression choice in local storage.
React . useEffect ( ( ) => {
const { compress _singlefile } = form . formData . settings ;
if ( compress _singlefile !== undefined && compress _singlefile !== defaultCompressSinglefile ) {
setDefaultCompressSinglefile ( compress _singlefile ) ;
}
} , [ form . formData , defaultCompressSinglefile ] ) ;
2025-06-07 17:36:00 -06:00
const localOnCancel = ( e ) => {
if ( e ) e . preventDefault ( ) ;
if ( onCancel ) {
onCancel ( ) ;
}
}
2026-02-18 15:16:10 -07:00
const urlInput = singleDownload ?
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< UrlField required form = { form } path = 'urls' / >
: < UrlsField required form = { form } / > ;
2026-02-18 15:16:10 -07:00
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < form onSubmit = { ( e ) => e . preventDefault ( ) } >
< Header as = 'h3' icon = 'file text' > Archives < / H e a d e r >
2024-11-02 15:14:02 -06:00
< p > Create a Singlefile Archive for each of the URLs provided below . < / p >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Stack gap = 'md' >
{ urlInput }
< DownloadTagsSelector form = { form } / >
< CompressSinglefileToggle form = { form } / >
< AdvancedDownloadSettings form = { form } / >
2024-12-03 12:44:38 -07:00
{ showMessage && < SuccessfulDownloadSubmitMessage / > }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
{ actions ? actions ( { onCancel : localOnCancel , form } ) :
< DownloadFormButtons onCancel = { localOnCancel } form = { form } / > }
< / S t a c k >
< / f o r m >
2024-11-02 15:14:02 -06:00
}
export function RSSDownloadForm ( { download , submitter , onDelete , onCancel , actions , clearOnSuccess = true } ) {
const [ showMessage , setShowMessage ] = React . useState ( false ) ;
2025-06-07 17:36:00 -06:00
const [ config , setConfig ] = React . useState ( null ) ;
const [ isConfigLoaded , setIsConfigLoaded ] = React . useState ( false ) ;
const [ userChangedResolutions , setUserChangedResolutions ] = React . useState ( false ) ;
2024-11-02 15:14:02 -06:00
const [ defaultVideoFormat , setDefaultVideoFormat ] = useLocalStorage ( 'video_format' , defaultVideoFormatOption ) ;
2026-06-11 17:54:22 -06:00
// Remember the user's compression choice between downloads.
const [ defaultCompressSinglefile , setDefaultCompressSinglefile ] = useLocalStorage ( 'compress_singlefile' , false ) ;
2024-11-02 15:14:02 -06:00
submitter = submitter || ( async ( formData ) => {
const downloadData = {
destination : formData . destination ,
downloader : formData . downloader ,
frequency : formData . frequency ,
settings : formData . settings ,
sub _downloader : formData . sub _downloader ,
2024-12-03 12:44:38 -07:00
tag _names : formData . tag _names || [ ] ,
2024-11-02 15:14:02 -06:00
urls : [ formData . url ] ,
}
await postDownload ( downloadData ) ;
} ) ;
2025-06-07 17:36:00 -06:00
// Use config video resolutions if available, otherwise use default
const configResolutions = config && config . video _resolutions ? config . video _resolutions : defaultVideoResolutionOptions ;
2024-11-02 15:14:02 -06:00
const emptyFormData = {
destination : null ,
downloader : Downloaders . RSS ,
frequency : weeklyOption . value ,
sub _downloader : null ,
settings : {
2026-06-11 17:54:22 -06:00
compress _singlefile : defaultCompressSinglefile ,
2024-11-02 15:14:02 -06:00
excluded _urls : null ,
title _exclude : null ,
title _include : null ,
2025-06-07 17:36:00 -06:00
video _resolutions : configResolutions ,
2024-11-02 15:14:02 -06:00
video _format : defaultVideoFormat ,
2026-04-14 15:00:49 -06:00
audio _only : false ,
audio _format : defaultAudioFormatOption ,
2026-03-05 16:18:03 -07:00
writesubtitles : false ,
writeautomaticsub : false ,
writethumbnail : false ,
writeinfojson : false ,
yt _dlp _extra _args : '' ,
2026-05-31 12:43:56 -06:00
sleep _requests : null ,
2026-03-05 16:18:03 -07:00
user _agent : '' ,
2024-11-02 15:14:02 -06:00
} ,
tag _names : [ ] ,
url : '' ,
} ;
2022-10-11 08:12:32 -06:00
2024-11-02 15:14:02 -06:00
const form = useForm ( {
submitter ,
defaultFormData : mergeDeep ( emptyFormData , download ) ,
emptyFormData ,
clearOnSuccess ,
onSuccess : async ( ) => setShowMessage ( true ) ,
} ) ;
2026-03-05 16:18:03 -07:00
// Fetch global defaults to pre-fill the form
2024-11-02 15:14:02 -06:00
React . useEffect ( ( ) => {
2026-03-05 16:18:03 -07:00
const fetchDefaults = async ( ) => {
2025-06-07 17:36:00 -06:00
try {
2026-03-05 16:18:03 -07:00
const defaults = await fetchVideoDownloadDefaults ( ) ;
setConfig ( defaults ) ;
2025-06-07 17:36:00 -06:00
setIsConfigLoaded ( true ) ;
2026-03-05 16:18:03 -07:00
if ( defaults && download ) {
for ( const [ key , value ] of Object . entries ( defaults ) ) {
if ( key === 'continue_dl' || key === 'nooverwrites' ) continue ;
if ( download . settings ? . [ key ] === undefined || download . settings ? . [ key ] === null ) {
form . setValue ( ` settings. ${ key } ` , value ) ;
}
}
} else if ( defaults ) {
const downloadHasResolutions = download ? . settings ? . video _resolutions ? . length > 0 ;
for ( const [ key , value ] of Object . entries ( defaults ) ) {
if ( key === 'continue_dl' || key === 'nooverwrites' ) continue ;
if ( key === 'video_resolutions' && ( userChangedResolutions || downloadHasResolutions ) ) continue ;
if ( key === 'video_format' ) continue ;
form . setValue ( ` settings. ${ key } ` , value ) ;
}
if ( ! userChangedResolutions && ! downloadHasResolutions && defaults . video _resolutions ) {
form . setValue ( 'settings.video_resolutions' , defaults . video _resolutions ) ;
}
2025-06-07 17:36:00 -06:00
}
} catch ( error ) {
2026-03-05 16:18:03 -07:00
console . error ( 'Failed to fetch video download defaults:' , error ) ;
2025-06-07 17:36:00 -06:00
setIsConfigLoaded ( true ) ;
}
} ;
2026-03-05 16:18:03 -07:00
fetchDefaults ( ) ;
2025-06-07 17:36:00 -06:00
} , [ ] ) ;
React . useEffect ( ( ) => {
const { video _format } = form . formData . settings ;
2024-11-02 15:14:02 -06:00
if ( video _format && video _format !== defaultVideoFormat ) {
setDefaultVideoFormat ( video _format ) ;
}
} , [ form . formData ] ) ;
2026-06-11 17:54:22 -06:00
// Persist the user's compression choice in local storage.
React . useEffect ( ( ) => {
const { compress _singlefile } = form . formData . settings ;
if ( compress _singlefile !== undefined && compress _singlefile !== defaultCompressSinglefile ) {
setDefaultCompressSinglefile ( compress _singlefile ) ;
}
} , [ form . formData , defaultCompressSinglefile ] ) ;
2024-11-02 15:14:02 -06:00
// Default to "new" download buttons.
actions = actions || DownloadFormButtons ;
const actionsElm = actions ( { onDelete , onCancel , form } ) ;
let downloaderRows ;
if ( form . formData . sub _downloader === Downloaders . Video ) {
downloaderRows = < >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< DestinationForm
form = { form }
infoContent = "Videos download into their Channel's directory, by default. If this is provided, then videos in this feed will download to this directory instead."
/ >
< Group grow align = 'flex-start' wrap = 'wrap' >
< TitleInclusionInput form = { form } / >
< TitleExclusionInput form = { form } / >
< / G r o u p >
< AudioOnlyToggle form = { form } / >
2026-04-14 15:00:49 -06:00
{ form . formData ? . settings ? . audio _only
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
? < AudioFormatSelectorForm form = { form } / >
: < Group align = 'flex-start' wrap = 'wrap' >
< div style = { { flex : 3 , minWidth : 240 } } >
2026-04-14 15:00:49 -06:00
< VideoResolutionSelectorForm
form = { form }
onChange = { ( ) => setUserChangedResolutions ( true ) }
/ >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< div style = { { flex : 1 , minWidth : 140 } } >
2026-04-14 15:00:49 -06:00
< VideoFormatSelectorForm form = { form } / >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< / G r o u p >
2026-04-14 15:00:49 -06:00
}
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Group grow align = 'flex-start' wrap = 'wrap' >
< VideoMinimumDurationForm form = { form } / >
< VideoMaximumDurationForm form = { form } / >
< / G r o u p >
< AdvancedVideoSettings form = { form } isConfigLoaded = { isConfigLoaded } / >
2024-11-02 15:14:02 -06:00
< / > ;
} else if ( form . formData . sub _downloader === Downloaders . Archive ) {
2026-06-11 17:54:22 -06:00
downloaderRows = < >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< ExcludedUrls form = { form } / >
< CompressSinglefileToggle form = { form } / >
2026-06-11 17:54:22 -06:00
< / > ;
2021-12-20 16:08:13 -07:00
}
2024-11-02 15:14:02 -06:00
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < form onSubmit = { ( e ) => e . preventDefault ( ) } >
< Header as = 'h3' icon = 'rss' > RSS Feed < / H e a d e r >
2024-11-02 15:14:02 -06:00
< p > Download each link provided by this RSS feed using the selected downloader . < / p >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Stack gap = 'md' >
< UrlField required form = { form } / >
< DownloadTagsSelector form = { form } / >
< Group grow align = 'flex-start' wrap = 'wrap' >
< DownloadFrequencySelector form = { form } freqOptions = { extendedFrequencyOptions } / >
< DownloaderSelector form = { form } / >
< / G r o u p >
2024-11-02 15:14:02 -06:00
{ downloaderRows }
2024-12-03 12:44:38 -07:00
{ showMessage && < SuccessfulDownloadSubmitMessage / > }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
{ actionsElm }
< / S t a c k >
< / f o r m >
2021-12-20 16:08:13 -07:00
}
2022-05-20 15:15:31 -06:00
2024-11-02 15:14:02 -06:00
export function EditRSSDownloadForm ( { download , onDelete , onCancel , actions = EditDownloadFormButtons } ) {
2023-08-30 20:19:32 -06:00
2024-11-02 15:14:02 -06:00
const submitter = async ( formData ) => {
const downloadData = {
2026-02-08 19:34:24 -07:00
collection _id : download . collection _id ,
2024-12-03 12:44:38 -07:00
destination : formData . destination ,
2024-11-02 15:14:02 -06:00
downloader : formData . downloader ,
frequency : formData . frequency ,
settings : formData . settings ,
sub _downloader : formData . sub _downloader ,
2024-12-03 12:44:38 -07:00
tag _names : formData . tag _names || [ ] ,
2024-11-02 15:14:02 -06:00
urls : [ formData . url , ] ,
}
await putDownload ( download . id , downloadData ) ;
2023-08-30 20:19:32 -06:00
}
2024-11-02 15:14:02 -06:00
return < RSSDownloadForm
submitter = { submitter }
onDelete = { onDelete }
onCancel = { onCancel }
download = { download }
actions = { actions }
clearOnSuccess = { false }
/ >
}
export function EditZimDownloadForm ( { download , onDelete , onCancel , actions = EditDownloadFormButtons } ) {
2023-08-30 20:19:32 -06:00
2024-11-02 15:14:02 -06:00
const submitter = async ( formData ) => {
const downloadData = {
2026-02-08 19:34:24 -07:00
collection _id : download . collection _id ,
2024-11-02 15:14:02 -06:00
downloader : formData . downloader ,
frequency : formData . frequency ,
settings : formData . settings ,
sub _downloader : formData . sub _downloader ,
tag _names : formData . tag _names ,
urls : [ formData . url , ] ,
2023-08-30 20:19:32 -06:00
}
2024-11-02 15:14:02 -06:00
await putDownload ( download . id , downloadData ) ;
2023-08-30 20:19:32 -06:00
}
2024-11-02 15:14:02 -06:00
const [ showMessage , setShowMessage ] = React . useState ( false ) ;
const emptyFormData = {
downloader : Downloaders . RSS ,
frequency : weeklyOption . value ,
sub _downloader : null ,
tag _names : [ ] ,
url : '' ,
} ;
2023-08-30 20:19:32 -06:00
2024-11-02 15:14:02 -06:00
const form = useForm ( {
submitter ,
defaultFormData : mergeDeep ( emptyFormData , download ) ,
emptyFormData ,
onSuccess : async ( ) => setShowMessage ( true ) ,
} ) ;
// Default to "new" download buttons.
actions = actions || DownloadFormButtons ;
const actionsElm = actions ( { onDelete , onCancel , form } ) ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < form onSubmit = { ( e ) => e . preventDefault ( ) } >
2024-11-02 15:14:02 -06:00
< Header as = 'h3' > Zim File < / H e a d e r >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Stack gap = 'md' >
< UrlField required form = { form } disabled = { true } / >
< DownloadFrequencySelector form = { form } freqOptions = { extendedFrequencyOptions } / >
2024-12-03 12:44:38 -07:00
{ showMessage && < SuccessfulDownloadSubmitMessage / > }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
{ actionsElm }
< / S t a c k >
< / f o r m >
2024-11-02 15:14:02 -06:00
}
export function FilesDownloadForm ( {
download ,
submitter ,
onCancel ,
actions = DownloadFormButtons ,
clearOnSuccess = true ,
} ) {
const [ showMessage , setShowMessage ] = React . useState ( false ) ;
submitter = submitter || ( async ( formData ) => {
const downloadData = {
downloader : Downloaders . File ,
tag _names : formData . tag _names ,
destination : formData . destination ,
urls : formData . urls . split ( /\r?\n/ ) ,
2026-05-05 14:28:36 -06:00
settings : formData . settings ,
2024-11-02 15:14:02 -06:00
}
await postDownload ( downloadData ) ;
} ) ;
const emptyFormData = {
destination : null ,
tag _names : [ ] ,
urls : '' ,
2026-05-05 14:28:36 -06:00
settings : {
skip _already _downloaded : false ,
} ,
2024-11-02 15:14:02 -06:00
} ;
const form = useForm ( {
submitter ,
defaultFormData : mergeDeep ( emptyFormData , download ) ,
emptyFormData ,
clearOnSuccess ,
onSuccess : async ( ) => setShowMessage ( true ) ,
} ) ;
const actionsElm = actions ( { onCancel , form } ) ;
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < form onSubmit = { ( e ) => e . preventDefault ( ) } >
< Header as = 'h3' icon = 'file' > Files < / H e a d e r >
2024-11-02 15:14:02 -06:00
< p > Download each file at the URLs provided below . < / p >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Stack gap = 'md' >
< UrlsField form = { form } / >
< DownloadTagsSelector form = { form } / >
< DestinationForm required form = { form } / >
< AdvancedDownloadSettings form = { form } / >
2024-12-03 12:44:38 -07:00
{ showMessage && < SuccessfulDownloadSubmitMessage / > }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
{ actionsElm }
< / S t a c k >
< / f o r m >
2024-11-02 15:14:02 -06:00
}
const suffixValidator = ( value ) => {
const error = commaSeparatedValidator ( value ) ;
if ( error ) {
return error ;
2023-08-30 20:19:32 -06:00
}
2024-11-02 15:14:02 -06:00
const suffixes = value . split ( ',' ) ;
for ( const suffix of suffixes ) {
if ( ! suffix . startsWith ( '.' ) ) {
return 'Suffix must start with .' ;
}
if ( suffix . length === 1 ) {
return 'Suffix must have characters after .' ;
}
}
}
export function SuffixFormInput ( { form , name = 'suffix' , path = 'settings.suffix' } ) {
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < TextField
2024-11-02 15:14:02 -06:00
form = { form }
label = 'File Suffixes'
helpContent = 'Comma-separated list of file suffixes that should be downloaded'
required = { true }
placeholder = '.pdf,.mp4'
name = { name }
path = { path }
validator = { suffixValidator }
/ >
}
export function ScrapeFilesDownloadForm ( {
download ,
submitter ,
clearOnSuccess ,
2024-12-03 12:44:38 -07:00
onDelete ,
2024-11-02 15:14:02 -06:00
onCancel ,
2024-12-03 12:44:38 -07:00
onSuccess ,
2024-11-02 15:14:02 -06:00
actions = DownloadFormButtons ,
2024-12-03 12:44:38 -07:00
singleDownload = false ,
2024-11-02 15:14:02 -06:00
} ) {
const [ showMessage , setShowMessage ] = React . useState ( false ) ;
submitter = submitter || ( async ( formData ) => {
const downloadData = {
downloader : Downloaders . ScrapeHtml ,
sub _downloader : Downloaders . File ,
2024-12-03 12:44:38 -07:00
tag _names : formData . tag _names || [ ] ,
2024-11-02 15:14:02 -06:00
destination : formData . destination ,
urls : formData . urls . split ( /\r?\n/ ) ,
settings : formData . settings ,
}
await postDownload ( downloadData ) ;
} ) ;
const emptyFormData = {
destination : null ,
tag _names : [ ] ,
urls : '' ,
settings : {
depth : 1 ,
max _pages : 1 ,
suffix : '' ,
}
} ;
2024-12-03 12:44:38 -07:00
const localOnSuccess = async ( ) => {
setShowMessage ( true ) ;
if ( onSuccess ) {
onSuccess ( ) ;
}
}
2024-11-02 15:14:02 -06:00
const form = useForm ( {
submitter ,
defaultFormData : mergeDeep ( emptyFormData , download ) ,
emptyFormData ,
clearOnSuccess ,
2024-12-03 12:44:38 -07:00
onSuccess : localOnSuccess ,
2024-11-02 15:14:02 -06:00
} ) ;
2024-12-03 12:44:38 -07:00
const urlInput = singleDownload ?
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< UrlField required form = { form } path = 'url' / >
: < UrlsField required form = { form } / > ;
2024-12-03 12:44:38 -07:00
// Default to "new" download buttons.
actions = actions || DownloadFormButtons ;
const actionsElm = actions ( { onDelete , onCancel , form } ) ;
2024-11-02 15:14:02 -06:00
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
return < form onSubmit = { ( e ) => e . preventDefault ( ) } >
< Header as = 'h3' icon = 'file alternate' > Scrape Files < / H e a d e r >
2024-11-02 15:14:02 -06:00
< p > Search each of the URLs for files matching the suffix ( . pdf , etc . ) . < / p >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< Stack gap = 'md' >
{ urlInput }
< Group align = 'flex-start' wrap = 'wrap' >
< div style = { { flex : 3 , minWidth : 240 } } >
2024-11-02 15:14:02 -06:00
< DestinationForm required = { true } form = { form } / >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< div style = { { flex : 2 , minWidth : 200 } } >
2024-11-02 15:14:02 -06:00
< SuffixFormInput required = { true } form = { form } / >
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
< / d i v >
< / G r o u p >
< Group grow align = 'flex-start' wrap = 'wrap' >
< DepthInputForm form = { form } required = { true } / >
< MaximumPagesInputForm form = { form } required = { true } / >
< / G r o u p >
2024-12-03 12:44:38 -07:00
{ showMessage && < SuccessfulDownloadSubmitMessage / > }
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
{ actionsElm }
< / S t a c k >
< / f o r m >
2023-08-30 20:19:32 -06:00
}
2024-12-03 12:44:38 -07:00
export function EditScrapeFilesDownloadForm ( { download , onDelete , onCancel , onSuccess } ) {
const submitter = async ( formData ) => {
const downloadData = {
2026-02-08 19:34:24 -07:00
collection _id : download . collection _id ,
2024-12-03 12:44:38 -07:00
downloader : Downloaders . ScrapeHtml ,
sub _downloader : Downloaders . File ,
tag _names : formData . tag _names || [ ] ,
destination : formData . destination ,
urls : [ formData . url ] ,
settings : formData . settings ,
}
2026-02-08 19:34:24 -07:00
await putDownload ( download . id , downloadData ) ;
2024-12-03 12:44:38 -07:00
} ;
return < ScrapeFilesDownloadForm
download = { download }
submitter = { submitter }
onDelete = { onDelete }
onCancel = { onCancel }
onSuccess = { onSuccess }
actions = { EditDownloadFormButtons }
singleDownload = { true }
/ >
}
ui: the last of Semantic UI, in name and in dead CSS
The library has been uninstalled for some time, but the codebase still read as
though it were there: identifiers named after it, rules written against its
class names, and about 180 comments explaining a rule in terms of a thing that
is no longer installed.
Renamed, keeping the vocabulary the app actually uses: semanticUIColorMap ->
navColorHexMap, semanticColorNames -> paletteColorNames, semanticNames ->
iconNameAliases, semanticSizes -> sizeAliases, and SemanticUIColors ->
NavColors in wrolpi/schema.py, which is what validates nav_color on the way in.
ColorToSemanticHexColor had no callers at all and is gone.
The baseline ratchet has done its job -- the list reached zero, so the JSON is
deleted and the guard keeps only the checks with teeth: no package, no import,
no `className="ui "`, no toast library. Its Theme.tsx check went with the
wrappers it was watching for. It also asserts its own walk found files, so a
clean result cannot mean it scanned nothing.
Deleted from App.css: every rule requiring `.ui`, `.inverted`, `.segment` or
`.modal`, none of which any component has set since the stylesheet stopped
loading, plus the form skeletons, ui-alerts and progress-text rules that
nothing renders. Two of them were doing harm rather than nothing: the drag
tints had a dark-theme variant under `.inverted` that stopped applying, leaving
15% of a fixed blue over a dark row, and now mix a token instead.
Two selectors naming markup that no longer exists were live bugs. The file
browser's filter had `.ui.input.file-browser-filter`, so it rendered at the
browser default width on a bar laid out to give it 34em -- now qualified by its
container, because `.wrolpi-action-input` sets `width: 100%` at the same
specificity and is loaded later. And SearchBox takes named props rather than a
rest spread, so the `id` DestinationForm hands it was dropped in silence and
the label it renders pointed at nothing; the download forms' Destination field
has had no associated label since the migration.
"Semantic roles" survives in four places, where it means what it says.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 19:15:57 -06:00
/** URL field for a single URL. */
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
function UrlField ( { form , required = true , name = 'url' , path = 'url' , disabled = false } ) {
const validator = ( i ) => validURL ( i ) ? null : 'Invalid URL' ;
return < TextField
form = { form }
type = 'url'
label = 'URL'
required = { required }
name = { name }
path = { path }
validator = { validator }
disabled = { disabled }
/ >
}
ui: the last of Semantic UI, in name and in dead CSS
The library has been uninstalled for some time, but the codebase still read as
though it were there: identifiers named after it, rules written against its
class names, and about 180 comments explaining a rule in terms of a thing that
is no longer installed.
Renamed, keeping the vocabulary the app actually uses: semanticUIColorMap ->
navColorHexMap, semanticColorNames -> paletteColorNames, semanticNames ->
iconNameAliases, semanticSizes -> sizeAliases, and SemanticUIColors ->
NavColors in wrolpi/schema.py, which is what validates nav_color on the way in.
ColorToSemanticHexColor had no callers at all and is gone.
The baseline ratchet has done its job -- the list reached zero, so the JSON is
deleted and the guard keeps only the checks with teeth: no package, no import,
no `className="ui "`, no toast library. Its Theme.tsx check went with the
wrappers it was watching for. It also asserts its own walk found files, so a
clean result cannot mean it scanned nothing.
Deleted from App.css: every rule requiring `.ui`, `.inverted`, `.segment` or
`.modal`, none of which any component has set since the stylesheet stopped
loading, plus the form skeletons, ui-alerts and progress-text rules that
nothing renders. Two of them were doing harm rather than nothing: the drag
tints had a dark-theme variant under `.inverted` that stopped applying, leaving
15% of a fixed blue over a dark row, and now mix a token instead.
Two selectors naming markup that no longer exists were live bugs. The file
browser's filter had `.ui.input.file-browser-filter`, so it rendered at the
browser default width on a bar laid out to give it 34em -- now qualified by its
container, because `.wrolpi-action-input` sets `width: 100%` at the same
specificity and is loaded later. And SearchBox takes named props rather than a
rest spread, so the `id` DestinationForm hands it was dropped in silence and
the label it renders pointed at nothing; the download forms' Destination field
has had no associated label since the migration.
"Semantic roles" survives in four places, where it means what it says.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 19:15:57 -06:00
/** Multiline URLs field: one URL per line. */
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
function UrlsField ( { name = 'urls' , required , form } ) {
required = required !== undefined ;
const validator = ( value ) => {
if ( ! validURLs ( value ) ) {
return 'Invalid URLs' ;
}
} ;
const [ inputProps , inputAttrs ] = form . getInputProps ( { name , validator , required } ) ;
const handleDrop = ( e ) => {
if ( e ) e . preventDefault ( ) ;
const droppedUrl = e . dataTransfer . getData ( 'text' ) ;
let urls = ( inputProps . value || '' ) . split ( '\n' ) ;
urls = [ ... urls , droppedUrl ] ;
urls = urls . filter ( i => ! ! i ) . join ( '\n' ) ;
inputAttrs . localSetValue ( ` ${ urls } \n ` ) ;
} ;
const handleKeyDown = ( event ) => {
if ( ( event . ctrlKey || event . metaKey ) && event . key === 'Enter' ) {
event . preventDefault ( ) ;
form . onSubmit ( ) ;
}
} ;
return < div >
< FieldLabel htmlFor = 'urls_textarea' label = 'URLs' required = { required } / >
< Textarea
id = 'urls_textarea'
placeholder = 'Enter one URL per line'
name = 'urls'
minRows = { 4 }
autosize
value = { inputProps . value ? ? '' }
onChange = { inputProps . onChange }
onDrop = { handleDrop }
onKeyDown = { handleKeyDown }
error = { inputProps . error }
data - path = { inputProps [ 'data-path' ] }
/ >
< / d i v >
}
2026-05-02 14:31:54 -06:00
export function DownloadMenu ( { onOpen , disabled , initialDownloader , initialUrls } ) {
// initialDownloader and initialUrls support the deep-link flow used by the
// WROLPi browser extension's "Configure Download" button: visiting
// `/?downloader=archive&download_url=...` pre-selects a form and pre-fills
// its URLs textarea via DashboardPage.Getters.
const [ downloader , setDownloader ] = useState ( initialDownloader || undefined ) ;
2022-05-20 15:15:31 -06:00
2022-08-06 05:22:07 +00:00
const localOnOpen = ( name ) => {
setDownloader ( name ) ;
2023-05-03 08:56:35 -06:00
if ( onOpen ) {
onOpen ( name ) ;
}
2022-08-06 05:22:07 +00:00
}
ui: thirty-five files off Semantic, leaving fifteen
Phase 2, part 4. Baseline 50 -> 15.
Migrated: all eight calculators, the rest of inventory and collections, the
Map/Zim/Docs cluster, Videos, Files, Search, Archive, DashboardPage,
DatesSelector, HelpModal, Events, Tags, Flasher's neighbours, admin Settings
and Status, Download, and App.
Also the three shared modules everything imports: api.js and customHooks.js
swap the Semantic toast library for the library's shim (same call shape), and
useForm.js renders the library's Message. useForm accepts both the old
`{content, header, positive|negative}` shape and the new `{kind, title}`,
because the pages building those objects migrate separately.
Two library gaps closed, both found by call sites needing them:
ActionInput is a forwardRef now. Its ref reaches the input rather than the
wrapper, because callers use it to focus or select the field -- a ref to the
surrounding div would do neither, which is why one call site had resorted to
hand-copying the component's markup.
Header takes a `color` token name. Three separate call sites had reached for
an inline style to colour a heading that carries meaning ("3 items to add"
against "2 to remove"), which is how a hex ends up in markup.
Two files needed repair after being interrupted mid-edit: MapViewer had a
Segment left in its error branch, and VideoPlayer had lost the useContext
import its own code still used. Neither jest nor tsc noticed; only
`npm run build` did, which is the whole reason that check exists.
Fifteen files remain: Archive, BulkTagModal, Channels, Docs, FileBrowser,
FilePreview, Flasher, Nav, Playlists, Theme.tsx, Upload, VideoPlayer, Zim,
ControllerPage, admin/Downloads. Theme.tsx is deliberately last -- the
unmigrated files still import its Semantic-backed wrappers, so it can only go
once they have.
2026-07-30 12:21:30 -06:00
let body = ( < Stack gap = 'xs' >
< Button color = 'blue' disabled = { disabled } onClick = { ( ) => localOnOpen ( 'video' ) } > Videos < / B u t t o n >
< Button color = 'green' disabled = { disabled } onClick = { ( ) => localOnOpen ( 'archive' ) } > Archives < / B u t t o n >
< Button color = 'blue' disabled = { disabled } onClick = { ( ) => localOnOpen ( 'video_channel' ) } > Channel / Playlist < / B u t t o n >
< Button disabled = { disabled } onClick = { ( ) => localOnOpen ( 'rss' ) } > RSS Feed < / B u t t o n >
< Button color = 'grey' disabled = { disabled } onClick = { ( ) => localOnOpen ( 'file' ) } > Files < / B u t t o n >
< Button role = 'danger' disabled = { disabled } onClick = { ( ) => localOnOpen ( 'scrape' ) } > Scrape < / B u t t o n >
< / S t a c k > ) ;
2022-05-20 15:15:31 -06:00
function clearSelected ( ) {
2022-08-06 05:22:07 +00:00
localOnOpen ( null ) ;
2022-05-20 15:15:31 -06:00
body = null ;
}
2026-05-02 14:31:54 -06:00
// Synthesize a partial `download` prop that seeds the form's URL field(s).
// Multi-URL forms read `urls` (newline-separated string); the single-URL
// ChannelDownloadForm reads `url`. Setting both is harmless — each form's
// emptyFormData defines which field actually exists.
const seed = ( initialUrls && initialUrls . length )
? { urls : initialUrls . join ( '\n' ) , url : initialUrls [ 0 ] }
: undefined ;
2022-05-20 15:15:31 -06:00
const downloaders = {
2026-05-02 14:31:54 -06:00
archive : < ArchiveDownloadForm onCancel = { clearSelected } download = { seed } / > ,
video : < VideosDownloadForm singleDownload = { false } onCancel = { clearSelected } download = { seed } / > ,
video _channel : < ChannelDownloadForm onCancel = { clearSelected } download = { seed } / > ,
rss : < RSSDownloadForm onCancel = { clearSelected } download = { seed } / > ,
file : < FilesDownloadForm onCancel = { clearSelected } download = { seed } / > ,
scrape : < ScrapeFilesDownloadForm onCancel = { clearSelected } download = { seed } / >
2022-05-20 15:15:31 -06:00
} ;
2024-11-02 15:14:02 -06:00
if ( downloader in downloaders ) {
const downloaderForm = downloaders [ downloader ] ;
body = < >
{ downloaderForm }
< / >
}
2022-05-20 15:15:31 -06:00
2022-08-06 05:22:07 +00:00
return < >
{ body }
< / >
2022-05-20 15:15:31 -06:00
}