Adding videos page hotkeys to help play and navigate videos. Adding f hotkey for all local search fields (channel/domain/etc). Focusing when opening cookie modals.

This commit is contained in:
Roland 2026-02-23 17:29:09 -07:00
parent 21c96d9501
commit ad0d93714a
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
8 changed files with 166 additions and 14 deletions

View file

@ -1,4 +1,5 @@
import React, {useContext, useState} from "react";
import {useHotkeys} from "react-hotkeys-hook";
import {
CardContent,
CardDescription,
@ -453,6 +454,14 @@ export function DomainsPage() {
const [domains] = useDomains();
const [searchStr, setSearchStr] = useOneQuery('domain');
const searchInputRef = React.useRef();
useHotkeys('f', (e) => {
e.preventDefault();
if (searchInputRef.current) {
searchInputRef.current.focus();
}
}, {enableOnFormTags: false});
// Header section matching ChannelsPage pattern
const header = <div style={{marginBottom: '1em'}}>
@ -467,6 +476,7 @@ export function DomainsPage() {
onClear={() => setSearchStr('')}
onChange={setSearchStr}
onSubmit={null}
inputRef={searchInputRef}
/>
</Grid.Column>
<Grid.Column textAlign='right'>
@ -1045,6 +1055,14 @@ function ArchiveSettingsPage() {
function ArchivesPage() {
const [selectedArchives, setSelectedArchives] = useState([]);
const searchInputRef = React.useRef();
useHotkeys('f', (e) => {
e.preventDefault();
if (searchInputRef.current) {
searchInputRef.current.focus();
}
}, {enableOnFormTags: false});
const {domain, domains} = useSearchDomain();
@ -1150,6 +1168,7 @@ function ArchivesPage() {
searchStr={localSearchStr}
onSubmit={setSearchStr}
placeholder='Search Archives...'
inputRef={searchInputRef}
/>;
// Domain header with edit link when filtering by domain