-
Notifications
You must be signed in to change notification settings - Fork 111
feat: make subtitles draggable and customizable #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,8 @@ function General({ onSave, onCancel }: GeneralProps): JSX.Element { | |
| handleCharacterPresetChange, | ||
| showSubtitle, | ||
| setShowSubtitle, | ||
| subtitleConfig, | ||
| setSubtitleConfig, | ||
| } = useGeneralSettings({ | ||
| bgUrlContext, | ||
| confName, | ||
|
|
@@ -99,6 +101,35 @@ function General({ onSave, onCancel }: GeneralProps): JSX.Element { | |
| onChange={setShowSubtitle} | ||
| /> | ||
|
|
||
| {showSubtitle && ( | ||
| <> | ||
| <InputField | ||
| label="Subtitle Font Size" | ||
| value={subtitleConfig.fontSize} | ||
| onChange={(value) => setSubtitleConfig({ fontSize: value as string })} | ||
| placeholder="e.g. 1.5rem, 24px" | ||
| /> | ||
| <InputField | ||
| label="Subtitle Color" | ||
| value={subtitleConfig.color} | ||
| onChange={(value) => setSubtitleConfig({ color: value as string })} | ||
| placeholder="e.g. white, #ffffff" | ||
| /> | ||
| <InputField | ||
| label="Subtitle Background Color" | ||
| value={subtitleConfig.backgroundColor} | ||
| onChange={(value) => setSubtitleConfig({ backgroundColor: value as string })} | ||
| placeholder="e.g. rgba(0, 0, 0, 0.7)" | ||
| /> | ||
| <InputField | ||
| label="Subtitle Font Family" | ||
| value={subtitleConfig.fontFamily} | ||
| onChange={(value) => setSubtitleConfig({ fontFamily: value as string })} | ||
| placeholder="e.g. Arial, sans-serif" | ||
| /> | ||
|
Comment on lines
+104
to
+129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Localize the new subtitle control labels and placeholders. This block hardcodes English copy while the rest of the settings panel uses 🤖 Prompt for AI Agents |
||
| </> | ||
| )} | ||
|
|
||
| {!settings.useCameraBackground && ( | ||
| <> | ||
| <SelectField | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,7 +73,12 @@ export const useGeneralSettings = ({ | |
| onSave, | ||
| onCancel, | ||
| }: UseGeneralSettingsProps) => { | ||
| const { showSubtitle, setShowSubtitle } = useSubtitle(); | ||
| const { | ||
| showSubtitle, | ||
| setShowSubtitle, | ||
| subtitleConfig, | ||
| setSubtitleConfig, | ||
| } = useSubtitle(); | ||
|
Comment on lines
+76
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep subtitle style edits in the save/cancel draft flow. These values now bypass Also applies to: 264-265 |
||
| const { setUseCameraBackground } = bgUrlContext || {}; | ||
| const { startBackgroundCamera, stopBackgroundCamera } = useCamera(); | ||
| const { configFiles, getFilenameByName } = useConfig(); | ||
|
|
@@ -256,5 +261,7 @@ export const useGeneralSettings = ({ | |
| handleCharacterPresetChange, | ||
| showSubtitle, | ||
| setShowSubtitle, | ||
| subtitleConfig, | ||
| setSubtitleConfig, | ||
| }; | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drag position still resets after refresh.
This wires in
useDraggable, but the suppliedsrc/renderer/src/hooks/electron/use-draggable.tsimplementation only keeps position in refs and never loads/saves anything bycomponentId. After a reload the subtitle goes back to its default location, so the persistence part of the feature is still missing.🤖 Prompt for AI Agents