-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature(UI): Add text tool to canvas #8723
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?
Feature(UI): Add text tool to canvas #8723
Conversation
…DustyShoe/InvokeAI into Feature/UI-Add-Text-tool-to-canvas
…ithout commiting text.
…llback, minor tweaks
|
|
||
| let attempts = 0; | ||
| const MAX_ATTEMPTS = 5; | ||
| const tryFocus = () => { |
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.
The idea here of counting attempts to try to focus it feels like an ungraceful band-aid solution.
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.
What would be the better solution here in your opinion?
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.
What behavior is it fixing? If it's event bubbling, I'd probably suggest a callback ref pattern instead
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.
It was probing, if the input field is ready and auto-enables typing mode. Changed to focus logic to a single RAF per session, preventing repeated focus attempts.
| const handleCompositionStart = useCallback(() => setIsComposing(true), []); | ||
| const handleCompositionEnd = useCallback(() => setIsComposing(false), []); | ||
|
|
||
| const containerMetrics = useMemo(() => { |
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.
Maybe a name like textContainerData would be more descriptive here
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.
Good point! Changed that.
…n CanvasTextOverlay.tsx Renamed containerMetrics to textContainerData in CanvasTextOverlay.tsx Fixed mouse cursor disapearing during typing.
Summary
Canvas Basic Text Tool!
Summary:
2025-12-30.13-29-23.mp4
Related Issues / Discussions
The fonts information is stored in
invokeai\frontend\web\src\features\controlLayers\text\textConstants.tsIf anyone have an opinion what fonts and fallbacks should be used, please write in comments. There's 10 fonts to choose ATM and i'd like to make selection as diverse as possible.
QA Instructions
Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)