Skip to content

feat(episode): add ability to override episode title - #1467

Merged
harshithmohan merged 3 commits into
masterfrom
feature/episode-title-override
Sep 14, 2026
Merged

harshithmohan merged 3 commits into
masterfrom
feature/episode-title-override

Conversation

@hidden4003

Copy link
Copy Markdown
Member

Summary

Adds a UI for manually overriding an episode's title, closing #922. A pencil icon next to the episode title opens a modal where you can type a custom title or pick from AniDB's alternate titles, with a reset option to clear the override. This is backed by the existing Episode/{id}/OverrideTitle server endpoint, mirroring the series title-override pattern already in the app.

@harshithmohan harshithmohan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modal and mutation follow the existing series-title-override pattern nicely, and the endpoint contract checks out. A few changes requested below.


useToggleModalKeybinds(show, 'modal');
useToggleModalKeybinds(!show, 'primary');
useHotkeys('escape', onRequestClose, { scopes: 'modal' });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape closes the modal while the save is pending

The Escape hotkey is bound unconditionally, so it defeats the intent of onRequestClose={isPending ? undefined : onRequestClose} (which only guards the backdrop click). During an in-flight save, Esc still closes the modal:

useHotkeys('escape', () => !isPending && onRequestClose(), { scopes: 'modal' });

useToggleModalKeybinds(show, 'modal');
useToggleModalKeybinds(!show, 'primary');
useHotkeys('escape', onRequestClose, { scopes: 'modal' });
useHotkeys('enter', handleSave, { scopes: 'modal' });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enter-to-save doesn't fire while the input is focused

react-hotkeys-hook ignores key events whose target is a form tag (input/textarea/select) unless enableOnFormTags is set. Since the title <Input autoFocus> is focused as soon as the modal opens — the normal case — this hotkey never runs, so the Enter shortcut is effectively dead. Either add enableOnFormTags: true or drop the Enter binding:

useHotkeys('enter', handleSave, { scopes: 'modal', enableOnFormTags: true });

Comment thread src/components/Collection/Episode/EditEpisodeTitleModal.tsx
Adds an edit button next to the episode title that opens a modal for
setting a custom title or picking from AniDB alternate titles, backed
by the existing Episode/{id}/OverrideTitle endpoint.
Guard the Escape hotkey against an in-flight save, enable the Enter
hotkey on form tags so it fires while the title input is focused, and
add success/error toasts around the save and reset mutations.
Guard escape hotkeys against in-flight mutations and enable Enter on
form tags when a modal has a focused text input, per feedback on the
episode title override modal.
@harshithmohan
harshithmohan force-pushed the feature/episode-title-override branch from 6b9c07f to 2c1c852 Compare September 14, 2026 18:35
@harshithmohan
harshithmohan merged commit 39e00ca into master Sep 14, 2026
3 checks passed
@harshithmohan
harshithmohan deleted the feature/episode-title-override branch September 14, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants