refactor: fft module improvement#144
Open
ihasp wants to merge 17 commits into
Open
Conversation
gsiwiec01
reviewed
May 4, 2026
Comment on lines
+45
to
+46
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| dependencies: any[] = [], |
Contributor
Comment on lines
+9
to
+10
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| t: any, |
Comment on lines
+62
to
+64
| fft.interactionMode !== "pan" | ||
| ? "bg-background shadow-sm text-foreground" | ||
| : "text-muted-foreground hover:bg-secondary/80 hover:text-secondary-foreground" |
Contributor
There was a problem hiding this comment.
Suggested change
| fft.interactionMode !== "pan" | |
| ? "bg-background shadow-sm text-foreground" | |
| : "text-muted-foreground hover:bg-secondary/80 hover:text-secondary-foreground" | |
| fft.interactionMode === "draw" | |
| ? "bg-background shadow-sm text-foreground" | |
| : "text-muted-foreground hover:bg-secondary/80 hover:text-secondary-foreground" |
unless, of course, this is the intended effect in erease mode.
Comment on lines
+151
to
+157
| let unlistenPromise: Promise<() => void> | null = null; | ||
| setupListener().then(unlisten => { | ||
| unlistenPromise = Promise.resolve(unlisten); | ||
| }); | ||
| return () => { | ||
| unlistenPromise?.then(fn => fn()); | ||
| }; |
Contributor
There was a problem hiding this comment.
race condition - if the component is unmounted befare setupListener finishes, unlinstenPromise remains null and the listener is never removed.
Comment on lines
+137
to
+145
| rafId = requestAnimationFrame(() => { | ||
| doRedrawOverlay(); | ||
| updateLivePreview(); | ||
|
|
||
| nestedRafId = requestAnimationFrame(() => { | ||
| doRedrawOverlay(); | ||
| updateLivePreview(); | ||
| }); | ||
| }); |
Contributor
There was a problem hiding this comment.
why do you need 2x requestAnimationFrame? shall we add a comment?
| return <EditWindowContent />; | ||
| } | ||
|
|
||
| export function EditWindowWithProps({ |
…n fft editor is active
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fft module improvement
1. Refactor of edit-window.tsx
2. New way of working on the FFT