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 React , { useEffect , useRef , useState } from 'react' ;
2026-03-20 15:38:32 -06:00
import { Link , Outlet , useParams } from "react-router" ;
2026-02-23 17:29:09 -07:00
import { useHotkeys } from "react-hotkeys-hook" ;
2022-08-06 05:22:07 +00:00
import {
2023-07-27 15:53:47 -06:00
APIButton ,
2022-11-04 09:58:38 -06:00
CardLink ,
2023-03-29 13:46:39 -06:00
CardPoster ,
2022-11-04 09:58:38 -06:00
Duration ,
2023-03-29 13:46:39 -06:00
encodeMediaPath ,
2023-09-07 20:13:36 -06:00
ErrorMessage ,
2022-11-04 09:58:38 -06:00
FileIcon ,
2023-03-29 13:46:39 -06:00
findPosterPath ,
2023-11-02 16:56:05 -06:00
humanFileSize ,
2024-08-22 21:18:42 -06:00
humanNumber ,
2026-03-11 15:42:52 -06:00
HelpHeader ,
2025-04-17 17:02:39 -06:00
InfoHeader ,
2024-08-22 21:18:42 -06:00
isoDatetimeToAgoPopup ,
2022-01-31 16:52:22 -07:00
PageContainer ,
2023-07-27 15:53:47 -06:00
PreviewLink ,
2021-11-01 16:42:52 -06:00
scrollToTop ,
2023-11-02 16:56:05 -06:00
secondsToFullDuration ,
2022-01-29 22:25:35 -07:00
TabLinks ,
2022-11-04 09:58:38 -06:00
textEllipsis ,
2026-03-06 15:15:36 -07:00
useTitle ,
CookiesUnlockModal
2021-11-01 16:42:52 -06:00
} from "./Common"
import VideoPage from "./VideoPlayer" ;
2022-11-04 09:58:38 -06:00
import {
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
ActionInput ,
Button ,
Card ,
Header ,
Icon ,
Loading ,
Modal ,
NumberInput ,
Panel ,
Placeholder ,
Statistic ,
StatisticGroup ,
Table ,
Textarea ,
TextInput ,
Tooltip ,
} from "./ui" ;
2024-03-12 17:20:51 -06:00
import { useChannel , useSearchOrder , useSearchVideos , useVideo , useVideoStatistics } from "../hooks/customHooks" ;
Search: fast ABC mode by default, opt-in deep search
The file_group.textsearch tsvector indexes all four text columns;
d_text (captions, document text, zip contents) is ~90% of the data,
making ts_rank searches take seconds on large libraries. Add a
textsearch_abc generated column (title/author/description only, ~8x
smaller) and default all searches to it, with deep=true opting into the
full column.
Database:
- Migration adds the generated column and a GIN index (rewrites the
table; a few minutes on large libraries).
Backend:
- FilesSearchRequest, VideoSearchRequest, ArchiveSearchRequest, and
DocSearchRequest accept `deep`; each search function picks the column.
- /api/search_file_estimates returns both counts in one index-bound
query (COUNT FILTER on the abc subset): `file_groups` (fast) and
`file_groups_deep`.
UI (one coherent story across the count surfaces):
- The typing dropdown always suggests the deep count (what is findable).
- The tab badge shows the active mode's count so it matches the result
list.
- The gap is reconciled by a hint offering deep search: count-aware on
the global search ("No results in fast search. N results available in
deep search." / "N more results available..."), generic on the module
pages (no deep estimate there). The hint resets pagination.
- "Search Depth" toggle in the search filter modals, persisted as
?deep=true.
Tests that relied on d_text matches now pass deep=True, with fast-mode
assertions alongside. Also skip flaky test_download_channel on
CircleCI.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:09:08 -06:00
import { DeepSearchHint , FileRowTagIcon , FilesView , SearchControlBar } from "./Files" ;
2026-04-09 16:18:26 -06:00
import { BulkTagModal } from "./BulkTagModal" ;
2026-05-03 17:28:06 -06:00
import { TaggedDeleteConfirmModal } from "./TaggedDeleteConfirmModal" ;
2025-12-06 14:49:46 -07:00
import {
2026-05-03 18:50:22 -06:00
deleteFileGroups ,
2026-02-20 14:37:58 -07:00
deleteCookies ,
fetchSuggestedUserAgent ,
2025-12-06 14:49:46 -07:00
fetchVideoDownloaderConfig ,
2026-02-20 14:37:58 -07:00
getCookiesStatus ,
lockCookies ,
2025-12-06 14:49:46 -07:00
postVideoFileFormat ,
2026-02-19 16:15:18 -07:00
previewBatchReorganization ,
2026-02-20 14:37:58 -07:00
updateVideoDownloaderConfig ,
uploadCookies ,
2025-12-06 14:49:46 -07:00
} from "../api" ;
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 { QueryContext } from "../contexts/contexts" ;
2023-01-04 09:14:33 -07:00
import _ from "lodash" ;
2026-03-11 15:42:52 -06:00
import { defaultFileOrder , defaultSearchOrder } from "./Vars" ;
2024-11-02 15:14:02 -06:00
import { InputForm , ToggleForm , useForm } from "../hooks/useForm" ;
2026-03-05 16:18:03 -07:00
import { VideoFormatSelectorForm , VideoResolutionSelectorForm } from "./Download" ;
2026-01-23 19:51:02 -07:00
import { BatchReorganizeModal } from "./collections/BatchReorganizeModal" ;
2022-08-06 05:22:07 +00:00
export function VideoWrapper ( ) {
2026-03-20 15:38:32 -06:00
const { fileGroupId } = useParams ( ) ;
const { videoFile , prevFile , nextFile , fetchVideo } = useVideo ( fileGroupId ) ;
2022-10-28 08:12:25 -06:00
2026-03-20 15:38:32 -06:00
// Scroll to the top when fileGroupId changes.
useEffect ( scrollToTop , [ fileGroupId ] ) ;
2022-08-06 05:22:07 +00:00
2023-03-24 08:58:18 -06:00
return < VideoPage videoFile = { videoFile } prevFile = { prevFile } nextFile = { nextFile } fetchVideo = { fetchVideo }
autoplay = { true } / >
2021-11-01 16:42:52 -06:00
}
2026-03-20 15:38:32 -06:00
export function VideosPage ( ) {
2022-10-25 15:57:44 -06:00
2022-08-06 05:22:07 +00:00
const { channelId } = useParams ( ) ;
2024-03-06 17:41:04 -07:00
const { searchParams } = React . useContext ( QueryContext ) ;
2022-09-23 16:43:45 -06:00
const [ selectedVideos , setSelectedVideos ] = useState ( [ ] ) ;
2026-04-09 16:18:26 -06:00
const [ bulkTagOpen , setBulkTagOpen ] = useState ( false ) ;
2026-05-03 17:28:06 -06:00
const [ taggedFileGroups , setTaggedFileGroups ] = useState ( null ) ;
2026-02-23 17:29:09 -07:00
const searchInputRef = React . useRef ( ) ;
useHotkeys ( 'f' , ( e ) => {
e . preventDefault ( ) ;
if ( searchInputRef . current ) {
searchInputRef . current . focus ( ) ;
}
} , { enableOnFormTags : false } ) ;
2021-11-01 16:42:52 -06:00
2024-04-14 13:06:03 -06:00
let searchOrder = defaultFileOrder ;
2022-08-06 05:22:07 +00:00
if ( searchParams . get ( 'order' ) ) {
// Use whatever order the user specified.
searchOrder = searchParams . get ( 'order' ) ;
} else if ( searchParams . get ( 'q' ) ) {
// User used a search_str
searchOrder = defaultSearchOrder ;
2021-11-01 16:42:52 -06:00
}
2024-07-22 16:36:57 -06:00
const { searchStr , setSearchStr , videos , activePage , setPage , totalPages , fetchVideos , loading } =
2023-03-24 08:58:18 -06:00
useSearchVideos ( null , channelId , searchOrder ) ;
2021-11-01 16:42:52 -06:00
2022-08-06 05:22:07 +00:00
const { channel } = useChannel ( channelId ) ;
2021-11-01 16:42:52 -06:00
2022-12-01 09:54:37 -07:00
let title = 'Videos' ;
if ( channel && channel . name ) {
title = ` ${ channel . name } Videos ` ;
}
useTitle ( title ) ;
2022-10-24 15:17:48 -06:00
let videoOrders = [
2023-10-24 10:20:06 -06:00
{ value : 'published_datetime' , text : 'Published Date' , short : 'P.Date' } ,
{ value : 'length' , text : 'Length' } ,
2023-04-09 14:13:36 -06:00
{ value : 'size' , text : 'Size' } ,
2025-06-07 17:36:00 -06:00
{ value : 'size_to_duration' , text : 'Size to Duration' , short : 'S/Duration' } ,
2023-04-09 14:13:36 -06:00
{ value : 'view_count' , text : 'Views' } ,
2023-10-24 10:20:06 -06:00
{ value : 'viewed' , text : 'Recently Viewed' , short : 'R.Viewed' } ,
2024-03-12 11:06:30 -06:00
{ value : 'download_datetime' , text : 'Download Date' , short : 'D.Date' } ,
2023-04-09 14:13:36 -06:00
]
2022-10-24 15:17:48 -06:00
if ( searchStr ) {
2023-04-09 14:13:36 -06:00
videoOrders = [ { value : 'rank' , text : 'Search' } , ... videoOrders ] ;
2022-10-24 15:17:48 -06:00
}
2022-08-06 05:22:07 +00:00
let header ;
if ( channel && channel . name ) {
const editLink = ` /videos/channel/ ${ channelId } /edit ` ;
header = < >
< Header as = 'h1' >
{ channel . name }
< Link to = { editLink } >
< Icon name = 'edit' style = { { marginLeft : '0.5em' } } / >
< / L i n k >
< / H e a d e r >
< / > ;
} else if ( channelId ) {
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
header = < div style = { { marginBottom : '1em' } } > < Placeholder lines = { 1 } / > < / d i v > ;
2021-11-01 16:42:52 -06:00
}
2022-09-23 16:43:45 -06:00
const onSelect = ( path , checked ) => {
2023-05-29 18:04:03 -06:00
const newSelectedVideos = checked && path ? [ ... selectedVideos , path ] : selectedVideos . filter ( i => i !== path ) ;
console . debug ( ` Selected Videos: ${ newSelectedVideos } ` ) ;
setSelectedVideos ( newSelectedVideos ) ;
2022-09-23 16:43:45 -06:00
}
2026-05-03 17:28:06 -06:00
const onDelete = async ( force = false ) => {
2026-03-20 15:38:32 -06:00
const fileGroupIds = videos . filter ( i => selectedVideos . indexOf ( i [ 'primary_path' ] ) >= 0 ) . map ( i => i [ 'id' ] ) ;
2026-05-03 18:50:22 -06:00
const result = await deleteFileGroups ( fileGroupIds , force ) ;
2026-05-03 17:28:06 -06:00
if ( result && result . tagged ) {
setTaggedFileGroups ( result . file _groups ) ;
return ;
}
2022-09-23 16:43:45 -06:00
await fetchVideos ( ) ;
setSelectedVideos ( [ ] ) ;
}
2022-10-24 17:15:15 -06:00
const invertSelection = async ( ) => {
const newSelectedVideos = videos . map ( video => video [ 'key' ] ) . filter ( i => selectedVideos . indexOf ( i ) < 0 ) ;
setSelectedVideos ( newSelectedVideos ) ;
}
const clearSelection = async ( e ) => {
if ( e ) e . preventDefault ( ) ;
setSelectedVideos ( [ ] ) ;
}
2026-04-09 16:18:26 -06:00
const onBulkTagComplete = async ( ) => {
await fetchVideos ( ) ;
setSelectedVideos ( [ ] ) ;
}
2022-09-23 16:43:45 -06:00
const selectElm = < div style = { { marginTop : '0.5em' } } >
2026-04-09 16:18:26 -06:00
< Button
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
role = 'primary'
2026-04-09 16:18:26 -06:00
disabled = { _ . isEmpty ( selectedVideos ) }
onClick = { ( ) => setBulkTagOpen ( true ) }
> Tag < / B u t t o n >
2023-07-27 15:53:47 -06:00
< APIButton
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
role = 'danger'
2023-01-04 09:14:33 -07:00
disabled = { _ . isEmpty ( selectedVideos ) }
2022-09-23 16:43:45 -06:00
confirmButton = 'Delete'
2023-07-27 15:53:47 -06:00
confirmContent = 'Are you sure you want to delete these video files? This cannot be undone.'
2026-05-03 17:28:06 -06:00
onClick = { ( ) => onDelete ( false ) }
2023-07-27 15:53:47 -06:00
> Delete < / A P I B u t t o n >
2022-10-24 17:15:15 -06:00
< Button
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
role = 'cancel'
2022-10-24 17:15:15 -06:00
onClick = { ( ) => invertSelection ( ) }
2023-01-04 09:14:33 -07:00
disabled = { _ . isEmpty ( videos ) }
2022-10-24 17:15:15 -06:00
>
Invert
< / B u t t o n >
< Button
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
role = 'cancel'
2022-10-24 17:15:15 -06:00
onClick = { ( ) => clearSelection ( ) }
2023-01-04 09:14:33 -07:00
disabled = { _ . isEmpty ( videos ) || _ . isEmpty ( selectedVideos ) }
2022-10-24 17:15:15 -06:00
>
Clear
< / B u t t o n >
2026-04-09 16:18:26 -06:00
< BulkTagModal
open = { bulkTagOpen }
onClose = { ( ) => setBulkTagOpen ( false ) }
paths = { selectedVideos }
onComplete = { onBulkTagComplete }
/ >
2022-09-23 16:43:45 -06:00
< / d i v > ;
Consolidate search options into a single Filter modal (#497)
* Consolidate search options into a single Filter modal
Reworks the file-search UI on the Dashboard, Videos, Archives, and Docs
pages. The crowded row of controls (sort, tags, limit, file-type filter,
date selector) is replaced with a single "Filter" button that opens one
comprehensive modal.
- Add SearchFilterModal + SearchFilterButton (violet + count badge when
active). Sections (Sort, File Type, Tags, Results Per Page, Published
Date) are shown per-page via props; layout uses a Semantic Grid.
- Selections are drafted locally and applied in a single updateQuery only
on close/Done, so the search isn't re-run on every field change.
- Results Per Page and Sort use buttons (fewer clicks, no clipped dropdown).
- Extract shared SearchControlBar (view toggle + input + Filter) for the
three results pages; move the global-search view toggle onto the tab row.
- Rework the Dashboard search line into one adaptive flex row; clear button
only shows when there's an active search.
- Remove now-dead FilesView limit/tag returns and SearchLimitDropdown.
* Address review: reset limit on Clear All; use replace over replaceAll
- handleClearAll now resets Results Per Page to the default page size
(DEFAULT_SEARCH_LIMIT = 24) so "Clear All" actually clears every setting.
- Replace start-anchored replaceAll(/^-/g) with replace(/^-/) for the sort key.
- Add a test covering the Clear All limit reset.
* Remove now-unused Media import from Files.js
The FilesSearchView refactor dropped the last <Media> usage in this file,
leaving an unused import (a build warning). Remove it.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 19:49:15 -06:00
const { body , paginator , viewButton } = FilesView (
2024-07-22 16:36:57 -06:00
{
files : videos ,
activePage : activePage ,
totalPages : totalPages ,
selectElem : selectElm ,
selectedKeys : selectedVideos ,
onSelect : onSelect ,
setPage : setPage ,
headlines : ! ! searchStr ,
loading : loading ,
} ,
2023-04-09 14:13:36 -06:00
) ;
2022-01-03 15:13:02 -07:00
return < >
2022-08-06 05:22:07 +00:00
{ header }
Consolidate search options into a single Filter modal (#497)
* Consolidate search options into a single Filter modal
Reworks the file-search UI on the Dashboard, Videos, Archives, and Docs
pages. The crowded row of controls (sort, tags, limit, file-type filter,
date selector) is replaced with a single "Filter" button that opens one
comprehensive modal.
- Add SearchFilterModal + SearchFilterButton (violet + count badge when
active). Sections (Sort, File Type, Tags, Results Per Page, Published
Date) are shown per-page via props; layout uses a Semantic Grid.
- Selections are drafted locally and applied in a single updateQuery only
on close/Done, so the search isn't re-run on every field change.
- Results Per Page and Sort use buttons (fewer clicks, no clipped dropdown).
- Extract shared SearchControlBar (view toggle + input + Filter) for the
three results pages; move the global-search view toggle onto the tab row.
- Rework the Dashboard search line into one adaptive flex row; clear button
only shows when there's an active search.
- Remove now-dead FilesView limit/tag returns and SearchLimitDropdown.
* Address review: reset limit on Clear All; use replace over replaceAll
- handleClearAll now resets Results Per Page to the default page size
(DEFAULT_SEARCH_LIMIT = 24) so "Clear All" actually clears every setting.
- Replace start-anchored replaceAll(/^-/g) with replace(/^-/) for the sort key.
- Add a test covering the Clear All limit reset.
* Remove now-unused Media import from Files.js
The FilesSearchView refactor dropped the last <Media> usage in this file,
leaving an unused import (a build warning). Remove it.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 19:49:15 -06:00
< SearchControlBar
searchStr = { searchStr }
setSearchStr = { setSearchStr }
placeholder = 'Search Videos...'
inputRef = { searchInputRef }
viewButton = { viewButton }
sorts = { videoOrders }
2026-06-27 09:48:21 -06:00
showCensored = { true }
Search: fast ABC mode by default, opt-in deep search
The file_group.textsearch tsvector indexes all four text columns;
d_text (captions, document text, zip contents) is ~90% of the data,
making ts_rank searches take seconds on large libraries. Add a
textsearch_abc generated column (title/author/description only, ~8x
smaller) and default all searches to it, with deep=true opting into the
full column.
Database:
- Migration adds the generated column and a GIN index (rewrites the
table; a few minutes on large libraries).
Backend:
- FilesSearchRequest, VideoSearchRequest, ArchiveSearchRequest, and
DocSearchRequest accept `deep`; each search function picks the column.
- /api/search_file_estimates returns both counts in one index-bound
query (COUNT FILTER on the abc subset): `file_groups` (fast) and
`file_groups_deep`.
UI (one coherent story across the count surfaces):
- The typing dropdown always suggests the deep count (what is findable).
- The tab badge shows the active mode's count so it matches the result
list.
- The gap is reconciled by a hint offering deep search: count-aware on
the global search ("No results in fast search. N results available in
deep search." / "N more results available..."), generic on the module
pages (no deep estimate there). The hint resets pagination.
- "Search Depth" toggle in the search filter modals, persisted as
?deep=true.
Tests that relied on d_text matches now pass deep=True, with fast-mode
assertions alongside. Also skip flaky test_download_channel on
CircleCI.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:09:08 -06:00
showDeep = { true }
Consolidate search options into a single Filter modal (#497)
* Consolidate search options into a single Filter modal
Reworks the file-search UI on the Dashboard, Videos, Archives, and Docs
pages. The crowded row of controls (sort, tags, limit, file-type filter,
date selector) is replaced with a single "Filter" button that opens one
comprehensive modal.
- Add SearchFilterModal + SearchFilterButton (violet + count badge when
active). Sections (Sort, File Type, Tags, Results Per Page, Published
Date) are shown per-page via props; layout uses a Semantic Grid.
- Selections are drafted locally and applied in a single updateQuery only
on close/Done, so the search isn't re-run on every field change.
- Results Per Page and Sort use buttons (fewer clicks, no clipped dropdown).
- Extract shared SearchControlBar (view toggle + input + Filter) for the
three results pages; move the global-search view toggle onto the tab row.
- Rework the Dashboard search line into one adaptive flex row; clear button
only shows when there's an active search.
- Remove now-dead FilesView limit/tag returns and SearchLimitDropdown.
* Address review: reset limit on Clear All; use replace over replaceAll
- handleClearAll now resets Results Per Page to the default page size
(DEFAULT_SEARCH_LIMIT = 24) so "Clear All" actually clears every setting.
- Replace start-anchored replaceAll(/^-/g) with replace(/^-/) for the sort key.
- Add a test covering the Clear All limit reset.
* Remove now-unused Media import from Files.js
The FilesSearchView refactor dropped the last <Media> usage in this file,
leaving an unused import (a build warning). Remove it.
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 19:49:15 -06:00
/ >
2023-04-09 14:13:36 -06:00
{ body }
Search: fast ABC mode by default, opt-in deep search
The file_group.textsearch tsvector indexes all four text columns;
d_text (captions, document text, zip contents) is ~90% of the data,
making ts_rank searches take seconds on large libraries. Add a
textsearch_abc generated column (title/author/description only, ~8x
smaller) and default all searches to it, with deep=true opting into the
full column.
Database:
- Migration adds the generated column and a GIN index (rewrites the
table; a few minutes on large libraries).
Backend:
- FilesSearchRequest, VideoSearchRequest, ArchiveSearchRequest, and
DocSearchRequest accept `deep`; each search function picks the column.
- /api/search_file_estimates returns both counts in one index-bound
query (COUNT FILTER on the abc subset): `file_groups` (fast) and
`file_groups_deep`.
UI (one coherent story across the count surfaces):
- The typing dropdown always suggests the deep count (what is findable).
- The tab badge shows the active mode's count so it matches the result
list.
- The gap is reconciled by a hint offering deep search: count-aware on
the global search ("No results in fast search. N results available in
deep search." / "N more results available..."), generic on the module
pages (no deep estimate there). The hint resets pagination.
- "Search Depth" toggle in the search filter modals, persisted as
?deep=true.
Tests that relied on d_text matches now pass deep=True, with fast-mode
assertions alongside. Also skip flaky test_download_channel on
CircleCI.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 10:09:08 -06:00
< DeepSearchHint searchStr = { searchStr } files = { videos } / >
2023-04-09 14:13:36 -06:00
{ paginator }
2026-05-03 17:28:06 -06:00
< TaggedDeleteConfirmModal
open = { taggedFileGroups !== null }
taggedFileGroups = { taggedFileGroups }
onCancel = { ( ) => setTaggedFileGroups ( null ) }
onConfirm = { async ( ) => {
setTaggedFileGroups ( null ) ;
await onDelete ( true ) ;
} }
/ >
2022-01-03 15:13:02 -07:00
< / >
2021-11-01 16:42:52 -06:00
}
2024-11-29 17:01:16 -07:00
function VideoFileNameForm ( { form } ) {
const [ message , setMessage ] = React . useState ( null ) ;
2026-01-23 19:51:02 -07:00
const debouncedOnChange = React . useCallback (
_ . debounce ( async ( value ) => {
const response = await postVideoFileFormat ( value ) ;
const { error , preview } = await response . json ( ) ;
if ( error ) {
setMessage ( { content : error , header : 'Invalid File Name' , negative : true } ) ;
} else {
setMessage ( { content : preview , header : 'File Name Preview' , positive : true } ) ;
}
} , 300 ) ,
[ ]
) ;
// Cleanup debounce on unmount
React . useEffect ( ( ) => {
return ( ) => debouncedOnChange . cancel ( ) ;
} , [ debouncedOnChange ] ) ;
const onChange = debouncedOnChange ;
2024-11-29 17:01:16 -07:00
2025-12-22 17:56:35 -07:00
const label = < InfoHeader
headerSize = 'h5'
headerContent = 'Video File Format'
popupContent = { < >
< p > Common yt - dlp variables : < / p >
< ul >
< li > < code > % ( title ) s < / c o d e > - V i d e o t i t l e < / l i >
< li > < code > % ( uploader ) s < / c o d e > - C h a n n e l / u p l o a d e r n a m e < / l i >
< li > < code > % ( upload _date ) s < / c o d e > - U p l o a d d a t e ( Y Y Y Y M M D D ) < / l i >
2025-12-23 18:49:33 -07:00
< li > < code > % ( upload _year ) s < / c o d e > - U p l o a d y e a r ( Y Y Y Y ) < / l i >
< li > < code > % ( upload _month ) s < / c o d e > - U p l o a d m o n t h ( 0 1 - 1 2 ) < / l i >
2025-12-22 17:56:35 -07:00
< li > < code > % ( id ) s < / c o d e > - V i d e o I D < / l i >
< li > < code > % ( channel ) s < / c o d e > - C h a n n e l n a m e < / l i >
< li > < code > % ( duration ) s < / c o d e > - D u r a t i o n i n s e c o n d s < / l i >
< li > < code > % ( playlist _index ) s < / c o d e > - P l a y l i s t i n d e x < / l i >
2026-01-23 19:51:02 -07:00
< li > < code > % ( ext ) s < / c o d e > - F i l e e x t e n s i o n ( r e q u i r e d , m u s t b e a t e n d ) < / l i >
2025-12-22 17:56:35 -07:00
< / u l >
< p > See yt - dlp docs for all variables . Subdirectories supported . < / p >
< / > }
/ > ;
2024-11-29 17:01:16 -07:00
return < InputForm
form = { form }
name = 'file_name_format'
path = 'yt_dlp_options.file_name_format'
2025-12-22 17:56:35 -07:00
label = { label }
2024-11-29 17:01:16 -07:00
onChange = { onChange }
message = { message }
/ >
}
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 settingsGridStyle = {
display : 'grid' ,
gridTemplateColumns : 'repeat(auto-fit, minmax(240px, 1fr))' ,
gap : '1em' ,
marginBottom : '1em' ,
} ;
2026-03-20 15:38:32 -06:00
export function VideosSettingsPage ( ) {
2024-11-02 15:14:02 -06:00
useTitle ( 'Videos Settings' ) ;
2026-01-23 19:51:02 -07:00
const [ batchModalOpen , setBatchModalOpen ] = useState ( false ) ;
const [ channelsNeedingReorg , setChannelsNeedingReorg ] = useState ( 0 ) ;
const [ fetchingReorgCount , setFetchingReorgCount ] = useState ( true ) ;
// Check how many channels need reorganization on mount
useEffect ( ( ) => {
setFetchingReorgCount ( true ) ;
previewBatchReorganization ( 'channel' )
. then ( data => {
setChannelsNeedingReorg ( data . total _collections || 0 ) ;
} )
. catch ( ( ) => {
setChannelsNeedingReorg ( 0 ) ;
} )
. finally ( ( ) => {
setFetchingReorgCount ( false ) ;
} ) ;
} , [ ] ) ;
2024-11-02 15:14:02 -06:00
const emptyFormData = {
video _resolutions : [ '1080p' , '720p' , '480p' , 'maximum' ] ,
yt _dlp _options : {
2026-03-05 16:18:03 -07:00
continue _dl : true ,
2024-11-02 15:14:02 -06:00
file _name _format : '%(uploader)s_%(upload_date)s_%(id)s_%(title)s.%(ext)s' ,
2026-03-05 16:18:03 -07:00
merge _output _format : 'mp4' ,
2024-11-02 15:14:02 -06:00
nooverwrites : true ,
writeautomaticsub : true ,
2026-03-05 16:18:03 -07:00
writeinfojson : true ,
2024-11-02 15:14:02 -06:00
writesubtitles : true ,
writethumbnail : true ,
} ,
2025-04-17 17:02:39 -06:00
yt _dlp _extra _args : '' ,
2026-02-19 16:15:18 -07:00
download _missing _video _comments : false ,
2026-02-20 14:37:58 -07:00
user _agent : '' ,
sleep _requests : 0.75 ,
2024-11-02 15:14:02 -06:00
} ;
2025-04-17 17:02:39 -06:00
const configSubmitter = async ( ) => {
return await updateVideoDownloaderConfig ( configForm . formData ) ;
} ;
2024-11-02 15:14:02 -06:00
2025-04-17 17:02:39 -06:00
const configForm = useForm ( {
fetcher : fetchVideoDownloaderConfig ,
submitter : configSubmitter ,
2024-11-02 15:14:02 -06:00
emptyFormData ,
} ) ;
2026-02-20 14:37:58 -07:00
const [ suggestedUserAgent , setSuggestedUserAgent ] = useState ( '' ) ;
2025-04-17 17:02:39 -06:00
React . useEffect ( ( ) => {
2026-02-20 14:37:58 -07:00
const fetchSuggested = async ( ) => {
const ua = await fetchSuggestedUserAgent ( ) ;
setSuggestedUserAgent ( ua ) ;
} ;
fetchSuggested ( ) ;
2025-04-17 17:02:39 -06:00
} , [ ] ) ;
2026-02-19 16:15:18 -07:00
const downloadMissingVideoCommentsLabel = < InfoHeader
headerSize = 'h5'
headerContent = 'Download Missing Video Comments'
popupContent = 'When enabled, WROLPi will automatically download comments for videos that are missing them.'
/ > ;
2025-04-17 17:02:39 -06:00
2026-01-23 19:51:02 -07:00
return < >
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
< Panel >
2026-01-23 19:51:02 -07:00
< Header as = 'h3' > Video Downloader Config < / H e a d e r >
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
< form onSubmit = { e => e . preventDefault ( ) } >
< div style = { settingsGridStyle } >
< VideoResolutionSelectorForm
form = { configForm }
name = 'video_resolutions'
path = 'video_resolutions'
/ >
< VideoFormatSelectorForm
form = { configForm }
name = 'merge_output_format'
path = 'yt_dlp_options.merge_output_format'
/ >
< VideoFileNameForm form = { configForm } / >
< / d i v >
< div style = { settingsGridStyle } >
< ToggleForm
form = { configForm }
label = 'Do not overwrite existing files'
name = 'nooverwrites'
path = 'yt_dlp_options.nooverwrites'
icon = 'file video'
/ >
< ToggleForm
form = { configForm }
label = 'Download automatic subtitles'
name = 'writeautomaticsub'
path = 'yt_dlp_options.writeautomaticsub'
icon = 'closed captioning'
/ >
< / d i v >
< div style = { settingsGridStyle } >
< ToggleForm
form = { configForm }
label = 'Download subtitles'
name = 'writesubtitles'
path = 'yt_dlp_options.writesubtitles'
icon = 'closed captioning outline'
/ >
< ToggleForm
form = { configForm }
label = 'Download thumbnail'
name = 'writethumbnail'
path = 'yt_dlp_options.writethumbnail'
icon = 'image'
/ >
< / d i v >
< div style = { settingsGridStyle } >
< ToggleForm
form = { configForm }
label = 'Download info JSON'
name = 'writeinfojson'
path = 'yt_dlp_options.writeinfojson'
icon = 'file code'
/ >
< ToggleForm
form = { configForm }
label = 'Continue partial downloads'
name = 'continue_dl'
path = 'yt_dlp_options.continue_dl'
icon = 'play'
/ >
< / d i v >
< div style = { settingsGridStyle } >
< ToggleForm
form = { configForm }
label = { downloadMissingVideoCommentsLabel }
name = 'download_missing_video_comments'
path = 'download_missing_video_comments'
icon = 'comments'
/ >
< / d i v >
< div style = { settingsGridStyle } >
< InputForm
form = { configForm }
name = 'yt_dlp_extra_args'
path = 'yt_dlp_extra_args'
label = 'Extra yt-dlp Arguments'
placeholder = '--prefer-free-formats'
icon = 'terminal'
/ >
< div >
< InfoHeader
headerSize = 'h5'
headerContent = 'Sleep Between Requests'
popupContent = 'Seconds to sleep between yt-dlp API requests. Helps avoid rate limiting and bot detection. Set to 0 to disable. Does not affect video download speed.'
/ >
< NumberInput
step = { 0.25 }
min = { 0 }
max = { 10 }
value = { configForm . formData . sleep _requests ? ? 0.75 }
onChange = { ( value ) => configForm . setValue ( 'sleep_requests' , parseFloat ( value ) || 0 ) }
placeholder = '0.75'
rightSection = { < span style = { { fontSize : 12 , color : 'var(--muted)' } } > sec < / s p a n > }
rightSectionWidth = { 36 }
/ >
< / d i v >
< / d i v >
< div style = { settingsGridStyle } >
< div style = { { gridColumn : '1 / -1' } } >
< InfoHeader
headerSize = 'h5'
headerContent = 'User Agent'
popupContent = "Custom user-agent string for yt-dlp. Should match the browser used to export cookies. Click "Use Current Browser" to auto-fill with your browser's user-agent."
/ >
< ActionInput
value = { configForm . formData . user _agent || '' }
onChange = { ( e ) => configForm . setValue ( 'user_agent' , e . currentTarget . value ) }
placeholder = 'Leave empty to use yt-dlp default'
action = { < Button role = 'cancel'
onClick = { ( ) => configForm . setValue ( 'user_agent' , suggestedUserAgent ) } >
Use Current Browser
< / B u t t o n > }
/ >
< / d i v >
< / d i v >
< div style = { { textAlign : 'right' } } >
< APIButton
role = 'primary'
disabled = { configForm . disabled || ! configForm . ready }
type = 'submit'
style = { { marginTop : '0.5em' } }
onClick = { configForm . onSubmit }
id = 'video_settings_save_button'
> Save < / A P I B u t t o n >
< / d i v >
< / f o r m >
< / P a n e l >
< Panel >
2026-01-23 19:51:02 -07:00
< Header as = 'h4' > File Organization < / H e a d e r >
< p >
{ fetchingReorgCount
? 'Checking for channels that need reorganization...'
: < >
< strong > { channelsNeedingReorg } < / s t r o n g > c h a n n e l { c h a n n e l s N e e d i n g R e o r g ! = = 1 ? ' s ' : ' ' }
{ channelsNeedingReorg > 0
? ' have files that do not match the current file name format.'
: '. All channels are organized correctly.' }
2026-02-19 16:15:18 -07:00
< / >
2026-01-23 19:51:02 -07:00
}
< / p >
< Button
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
role = 'retry'
icon = 'folder open outline'
2026-01-23 19:51:02 -07:00
onClick = { ( ) => setBatchModalOpen ( true ) }
id = 'reorganize_all_channels_button'
disabled = { fetchingReorgCount || channelsNeedingReorg === 0 }
loading = { fetchingReorgCount }
>
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
Reorganize All Channels
2026-01-23 19:51:02 -07:00
< / B u t t o n >
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
< / P a n e l >
2026-01-23 19:51:02 -07:00
2026-02-20 14:37:58 -07:00
< CookiesSettingsSection / >
2026-01-23 19:51:02 -07:00
< BatchReorganizeModal
open = { batchModalOpen }
onClose = { ( ) => setBatchModalOpen ( false ) }
kind = 'channel'
onComplete = { ( ) => {
setBatchModalOpen ( false ) ;
setChannelsNeedingReorg ( 0 ) ;
} }
/ >
< / >
2024-11-02 15:14:02 -06:00
}
2026-02-20 14:37:58 -07:00
function CookiesSettingsSection ( ) {
const [ status , setStatus ] = useState ( { cookies _exist : false , cookies _unlocked : false } ) ;
const [ loading , setLoading ] = useState ( true ) ;
const [ uploadModalOpen , setUploadModalOpen ] = useState ( false ) ;
const [ unlockModalOpen , setUnlockModalOpen ] = useState ( false ) ;
const [ cookiesContent , setCookiesContent ] = useState ( '' ) ;
const [ password , setPassword ] = useState ( '' ) ;
const [ submitting , setSubmitting ] = useState ( false ) ;
2026-02-23 17:29:09 -07:00
const cookiesContentRef = useRef ( null ) ;
useEffect ( ( ) => {
if ( uploadModalOpen ) {
const timer = setTimeout ( ( ) => {
if ( cookiesContentRef . current ) {
cookiesContentRef . current . focus ( ) ;
}
} , 100 ) ;
return ( ) => clearTimeout ( timer ) ;
}
} , [ uploadModalOpen ] ) ;
2026-02-20 14:37:58 -07:00
const fetchStatus = async ( ) => {
setLoading ( true ) ;
const result = await getCookiesStatus ( ) ;
if ( result ) {
setStatus ( result ) ;
}
setLoading ( false ) ;
} ;
useEffect ( ( ) => {
fetchStatus ( ) ;
} , [ ] ) ;
const handleUpload = async ( ) => {
if ( password . length < 8 ) {
return ;
}
setSubmitting ( true ) ;
const result = await uploadCookies ( cookiesContent , password ) ;
setSubmitting ( false ) ;
if ( result . success ) {
setUploadModalOpen ( false ) ;
setCookiesContent ( '' ) ;
setPassword ( '' ) ;
fetchStatus ( ) ;
}
} ;
const handleLock = async ( ) => {
setSubmitting ( true ) ;
await lockCookies ( ) ;
setSubmitting ( false ) ;
fetchStatus ( ) ;
} ;
const handleDelete = async ( ) => {
setSubmitting ( true ) ;
await deleteCookies ( ) ;
setSubmitting ( false ) ;
fetchStatus ( ) ;
} ;
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
// Status is encoded by color like any other status label; no filled "success/warning"
// words map directly to a token, so the wrapper picks the token color explicitly.
2026-02-20 14:37:58 -07:00
const getStatusLabel = ( ) => {
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
if ( loading ) return < span style = { { color : 'var(--muted)' } } > Loading ... < / s p a n > ;
if ( ! status . cookies _exist ) return < span style = { { color : 'var(--muted)' } } > No cookies stored < / s p a n > ;
if ( status . cookies _unlocked ) return < span style = { { color : 'var(--green)' } } > Unlocked < / s p a n > ;
return < span style = { { color : 'var(--amber)' } } > Locked < / s p a n > ;
2026-02-20 14:37:58 -07:00
} ;
2025-04-17 17:02:39 -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 < Panel >
2026-03-11 15:42:52 -06:00
< HelpHeader
headerSize = 'h4'
headerContent = 'Encrypted Cookies'
helpPath = '/modules/videos/cookies/'
/ >
2026-02-20 14:37:58 -07:00
< p > Use this feature at your own risk ! You may be suspended or blocked if abused !
< / p >
< div style = { { marginBottom : '1em' } } >
< strong > Status : < / s t r o n g > { g e t S t a t u s L a b e l ( ) }
< / d i v >
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
< div style = { { display : 'flex' , gap : '0.5em' , flexWrap : 'wrap' } } >
2026-02-20 14:37:58 -07:00
{ ! status . cookies _exist && (
< Button
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
role = 'primary'
icon = 'upload'
2026-02-20 14:37:58 -07:00
onClick = { ( ) => setUploadModalOpen ( true ) }
disabled = { loading }
>
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
Upload Cookies
2026-02-20 14:37:58 -07:00
< / B u t t o n >
) }
{ status . cookies _exist && ! status . cookies _unlocked && (
< Button
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
role = 'save'
icon = 'unlock'
2026-02-20 14:37:58 -07:00
onClick = { ( ) => setUnlockModalOpen ( true ) }
disabled = { loading }
>
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
Unlock Cookies
2026-02-20 14:37:58 -07:00
< / B u t t o n >
) }
{ status . cookies _exist && status . cookies _unlocked && (
< Button
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
role = 'retry'
icon = 'lock'
2026-02-20 14:37:58 -07:00
onClick = { handleLock }
loading = { submitting }
disabled = { loading || submitting }
>
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
Lock Cookies
2026-02-20 14:37:58 -07:00
< / B u t t o n >
) }
{ status . cookies _exist && (
< >
< Button
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
role = 'primary'
icon = 'refresh'
2026-02-20 14:37:58 -07:00
onClick = { ( ) => setUploadModalOpen ( true ) }
disabled = { loading }
>
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
Replace
2026-02-20 14:37:58 -07:00
< / B u t t o n >
< APIButton
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
role = 'danger'
icon = 'trash'
2026-02-20 14:37:58 -07:00
onClick = { handleDelete }
confirmButton = 'Delete'
confirmContent = 'Are you sure you want to delete the stored cookies? This cannot be undone.'
disabled = { loading || submitting }
>
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
Delete
2026-02-20 14:37:58 -07:00
< / A P I B u t t o n >
< / >
) }
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 >
2026-02-20 14:37:58 -07:00
{ /* Upload Modal */ }
< Modal
open = { uploadModalOpen }
onClose = { ( ) => setUploadModalOpen ( false ) }
size = 'small'
>
< Modal . Header > Upload Cookies < / M o d a l . H e a d e r >
< Modal . Content >
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
< form onSubmit = { e => e . preventDefault ( ) } >
< Textarea
ref = { cookiesContentRef }
label = 'Cookies Content'
placeholder = 'Paste your cookies.txt content here (Netscape/Mozilla format)'
value = { cookiesContent }
onChange = { ( e ) => setCookiesContent ( e . currentTarget . value ) }
minRows = { 10 }
2026-02-20 14:37:58 -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
< div style = { { marginTop : '1em' } } >
< TextInput
label = 'Encryption Password'
type = 'password'
placeholder = 'Minimum 8 characters'
value = { password }
onChange = { ( e ) => setPassword ( e . currentTarget . value ) }
error = { password . length > 0 && password . length < 8
? 'Password must be at least 8 characters' : null }
/ >
< / d i v >
< p style = { { color : 'var(--muted)' , fontSize : '0.9em' } } >
2026-02-20 14:37:58 -07:00
Remember this password - you ' ll need it to unlock cookies after each restart .
< / 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
< / f o r m >
2026-02-20 14:37:58 -07:00
< / M o d a l . C o n t e n t >
< Modal . Actions >
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
< Button role = 'cancel' onClick = { ( ) => setUploadModalOpen ( false ) } > Cancel < / B u t t o n >
2026-02-20 14:37:58 -07:00
< Button
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
role = 'save'
icon = 'lock'
2026-02-20 14:37:58 -07:00
onClick = { handleUpload }
loading = { submitting }
disabled = { ! cookiesContent || password . length < 8 || submitting }
>
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
Encrypt & Save
2026-02-20 14:37:58 -07:00
< / B u t t o n >
< / M o d a l . A c t i o n s >
< / M o d a l >
2026-03-06 15:15:36 -07:00
< CookiesUnlockModal
2026-02-20 14:37:58 -07:00
open = { unlockModalOpen }
onClose = { ( ) => setUnlockModalOpen ( false ) }
2026-03-06 15:15:36 -07:00
onSuccess = { fetchStatus }
/ >
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
< / P a n e l > ;
2025-04-17 17:02:39 -06:00
}
2026-03-20 15:38:32 -06:00
export function VideosStatistics ( ) {
2022-10-25 15:57:44 -06:00
useTitle ( 'Video Statistics' ) ;
2022-08-06 05:22:07 +00:00
const { statistics } = useVideoStatistics ( ) ;
2021-12-23 09:38:12 -07:00
2023-09-07 20:13:36 -06:00
if ( statistics === null ) {
// Request is pending.
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 < Loading / >
2023-09-07 20:13:36 -06:00
} else if ( statistics === undefined ) {
return < ErrorMessage > Unable to fetch Video Statistics < / E r r o r M e s s a g e >
2021-12-23 09:38:12 -07:00
}
2023-09-07 20:13:36 -06:00
const { videos , historical , channels } = statistics ;
2022-08-06 05:22:07 +00:00
const videoNames = [
2022-10-19 09:18:53 -06:00
{ key : 'videos' , label : 'Videos' } ,
2022-08-06 05:22:07 +00:00
{ key : 'sum_size' , label : 'Total Size' } ,
{ key : 'max_size' , label : 'Largest Video' } ,
{ key : 'week' , label : 'Downloads Past Week' } ,
{ key : 'month' , label : 'Downloads Past Month' } ,
{ key : 'year' , label : 'Downloads Past Year' } ,
{ key : 'sum_duration' , label : 'Total Duration' } ,
2024-08-15 19:32:01 -06:00
{ key : 'censored_videos' , label : 'Censored Videos' } ,
2024-04-14 13:15:00 -06:00
] ;
const commentsNames = [
2024-04-14 13:06:03 -06:00
{ key : 'have_comments' , label : 'Have Comments' } ,
2024-06-25 22:12:13 -06:00
{ key : 'missing_comments' , label : 'Missing Comments' } ,
2024-04-14 13:06:03 -06:00
{ key : 'failed_comments' , label : 'Failed Comments' } ,
2022-08-06 05:22:07 +00:00
] ;
const historicalNames = [
{ key : 'average_count' , label : 'Average Monthly Downloads' } ,
{ key : 'average_size' , label : 'Average Monthly Usage' } ,
] ;
const channelNames = [
{ key : 'channels' , label : 'Channels' } ,
2024-08-15 19:32:01 -06:00
{ key : 'tagged_channels' , label : 'Tagged Channels' } ,
2022-08-06 05:22:07 +00:00
] ;
2021-11-01 16:42:52 -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
const buildPanel = ( title , names , stats ) => {
return < Panel >
< Header as = 'h1' style = { { textAlign : 'center' } } > { title } < / H e a d e r >
< StatisticGroup >
2022-08-06 05:22:07 +00:00
{ names . map (
( { key , label } ) =>
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
< Statistic key = { key } value = { stats [ key ] } label = { label } style = { { margin : '2em' } } / >
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
< / S t a t i s t i c G r o u p >
< / P a n e l >
2021-11-01 16:42:52 -06:00
}
2023-02-17 16:09:24 -07:00
return < >
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
{ buildPanel ( 'Videos' , videoNames , videos ) }
{ buildPanel ( 'Video Comments' , commentsNames , videos ) }
{ buildPanel ( 'Historical Video' , historicalNames , historical ) }
{ buildPanel ( 'Channels' , channelNames , channels ) }
2023-02-17 16:09:24 -07:00
< / >
2022-01-29 22:25:35 -07:00
}
2026-03-20 15:38:32 -06:00
export function VideosTabLayout ( ) {
2022-01-29 22:25:35 -07:00
const links = [
2022-08-06 05:22:07 +00:00
{ text : 'Videos' , to : '/videos' , key : 'videos' , end : true } ,
2022-02-02 14:02:51 -07:00
{ text : 'Channels' , to : '/videos/channel' , key : 'channel' } ,
2024-11-02 15:14:02 -06:00
{ text : 'Settings' , to : '/videos/settings' , key : 'settings' } ,
2022-08-06 05:22:07 +00:00
{ text : 'Statistics' , to : '/videos/statistics' , key : 'statistics' } ,
2022-01-29 22:25:35 -07:00
] ;
2023-02-17 16:09:24 -07:00
return < PageContainer >
< TabLinks links = { links } / >
2026-03-20 15:38:32 -06:00
< Outlet / >
2023-02-17 16:09:24 -07:00
< / P a g e C o n t a i n e r >
2021-11-01 16:42:52 -06:00
}
2022-11-04 09:58:38 -06:00
export function VideoCard ( { file } ) {
2023-03-29 13:46:39 -06:00
const { video } = file ;
2026-03-17 18:35:57 -06:00
const { sort } = useSearchOrder ( ) ;
const sortField = sort ? sort . replace ( /^-/ , '' ) : null ;
2022-11-04 09:58:38 -06:00
2023-07-27 15:53:47 -06:00
// Default to video FilePreview for lone video files.
2026-03-20 15:38:32 -06:00
let video _url = ` /videos/ ${ file . id } ` ;
2023-07-27 15:53:47 -06:00
2022-11-04 09:58:38 -06:00
// A video may not have a channel.
const channel = video . channel ? video . channel : null ;
let channel _url = null ;
if ( channel ) {
channel _url = ` /videos/channel/ ${ channel . id } /video ` ;
}
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 media = < div style = { { position : 'relative' } } >
< CardPoster to = { video _url } file = { file } / >
< Duration totalSeconds = { file . length } / >
< / d i v > ;
2022-11-04 09:58:38 -06:00
2024-08-20 13:13:21 -06:00
const title = file . title || file . name || video . stem || video . 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
let titleElm = < Tooltip label = { title } >
< span className = 'card-title-ellipsis' > { title } < / s p a n >
< / T o o l t i p > ;
2023-07-27 15:53:47 -06:00
if ( video _url ) {
// Link to Channel-Video page or Video page.
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
titleElm = < Link to = { video _url } className = "no-link-underscore card-link" > { titleElm } < / L i n k > ;
2023-07-27 15:53:47 -06:00
} else {
// Video is just a lone video file.
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
titleElm = < PreviewLink file = { file } >
{ titleElm }
2023-07-27 15:53:47 -06:00
< / P r e v i e w L i n k > ;
}
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 detailLine ;
if ( sortField === 'length' ) {
detailLine = secondsToFullDuration ( file . length || 0 ) ;
} else if ( sortField === 'size' ) {
detailLine = humanFileSize ( file . size ) ;
} else if ( sortField === 'view_count' ) {
detailLine = ` ${ humanNumber ( video . view _count || 0 ) } views ` ;
} else if ( sortField === 'viewed' ) {
detailLine = isoDatetimeToAgoPopup ( file . viewed , false ) ;
} else if ( sortField === 'download_datetime' ) {
detailLine = isoDatetimeToAgoPopup ( file . download _datetime , false ) ;
} else {
detailLine = isoDatetimeToAgoPopup ( file . published _datetime , false ) ;
}
const meta = < >
{ channel && < div >
< Link to = { channel _url } className = "no-link-underscore card-link" >
< b > { channel . name } < / b >
< / L i n k >
< / d i v > }
< div > { detailLine } < / d i v >
< / > ;
return < Card media = { media } title = { titleElm } meta = { meta } / >
2022-11-04 09:58:38 -06:00
}
export function VideoRowCells ( { file } ) {
const { video } = file ;
2023-11-02 16:56:05 -06:00
let { sort } = useSearchOrder ( ) ;
sort = sort ? sort . replace ( /^-+/ , '' ) : null ;
2022-11-04 09:58:38 -06:00
2026-03-20 15:38:32 -06:00
let video _url = ` /videos/ ${ file . id } ` ;
2023-03-29 13:46:39 -06:00
const poster _path = findPosterPath ( file ) ;
const poster _url = poster _path ? ` /media/ ${ encodeMediaPath ( poster _path ) } ` : null ;
2022-11-04 09:58:38 -06:00
let poster ;
if ( poster _url ) {
poster = < CardLink to = { video _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
< img alt = '' src = { poster _url } style = { { width : '50px' , height : 'auto' } } / >
2022-11-04 09:58:38 -06:00
< / C a r d L i n k >
} else {
poster = < FileIcon file = { file } size = 'large' / > ;
}
2024-11-02 15:14:02 -06:00
let dataCell = file . published _datetime ? isoDatetimeToAgoPopup ( file . published _datetime ) : '' ;
2023-11-02 16:56:05 -06:00
if ( sort === 'length' ) {
dataCell = secondsToFullDuration ( file . length || 0 ) ;
} else if ( sort === 'size' ) {
dataCell = humanFileSize ( file . size ) ;
} else if ( sort === 'view_count' ) {
dataCell = humanNumber ( video . view _count || 0 ) ;
} else if ( sort === 'viewed' ) {
2024-11-02 15:14:02 -06:00
dataCell = isoDatetimeToAgoPopup ( file . viewed ) ;
2023-11-02 16:56:05 -06:00
}
2022-11-04 09:58:38 -06:00
// Fragment for SelectableRow
return < React . Fragment >
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
< Table . Cell >
< div style = { { textAlign : 'center' } } >
2022-11-04 09:58:38 -06:00
{ poster }
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 >
< / T a b l e . C e l l >
< Table . Cell >
2022-11-04 09:58:38 -06:00
< CardLink to = { video _url } >
2023-03-24 08:58:18 -06:00
< FileRowTagIcon file = { file } / >
2023-04-09 14:52:44 -06:00
{ textEllipsis ( file . title || video . stem || video . video _path ) }
2022-11-04 09:58:38 -06:00
< / C a r d L i n k >
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
< / T a b l e . C e l l >
< Table . Cell > { dataCell } < / T a b l e . C e l l >
2022-11-04 09:58:38 -06:00
< / R e a c t . F r a g m e n t >
}