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, {useState} from "react";
import {useHotkeys} from "react-hotkeys-hook";
import {Grid, StatisticLabel, StatisticValue,} from "semantic-ui-react";
import {createChannel, deleteChannel, refreshChannel, tagChannel, tagChannelInfo} from "../api";
import {CollectionTagModal} from "./collections/CollectionTagModal";
@ -523,6 +524,14 @@ export function ChannelsPage() {
const [channels] = useChannels();
const [searchStr, setSearchStr] = useOneQuery('name');
const searchInputRef = React.useRef();
useHotkeys('f', (e) => {
e.preventDefault();
if (searchInputRef.current) {
searchInputRef.current.focus();
}
}, {enableOnFormTags: false});
// Header section matching DomainsPage pattern
const header = <div style={{marginBottom: '1em'}}>
@ -537,6 +546,7 @@ export function ChannelsPage() {
onClear={() => setSearchStr('')}
onChange={setSearchStr}
onSubmit={null}
inputRef={searchInputRef}
/>
</Grid.Column>
<Grid.Column textAlign='right'>