Repository navigation
feat: email search linking - #394
Merged
Merged
Conversation
gbirman
commented
Dec 1, 2025
| <BozzyBracket | ||
| active={props.focused} | ||
| unfocusable={props.unfocusable} | ||
| unfocusable={props.isTarget || props.unfocusable} |
Contributor
Author
There was a problem hiding this comment.
you can't flash while also focused, so this flashes and then focuses
synoet
approved these changes
Dec 1, 2025
Comment on lines
+10
to
+56
|
|
||
| /** | ||
| * Creates a signal that mirrors a source signal but automatically clears | ||
| * after a duration. Used for temporary UI states like message highlighting. | ||
| * | ||
| * @param source - The source signal to track | ||
| * @param duration - Duration in milliseconds before the active state clears (default: 800ms) | ||
| * @returns An accessor for the active target value | ||
| * | ||
| * @example | ||
| * const activeId = createActiveTarget(targetId); | ||
| * // activeId() mirrors targetId() for 800ms, then becomes undefined | ||
| */ | ||
| export function createActiveTarget<T>( | ||
| source: Accessor<T | undefined>, | ||
| duration = DEFAULT_ACTIVE_TARGET_TIME | ||
| ): Accessor<T | undefined> { | ||
| const [active, setActive] = createSignal<T | undefined>(); | ||
| let timeoutId: ReturnType<typeof setTimeout> | undefined; | ||
|
|
||
| createEffect( | ||
| on(source, (target) => { | ||
| if (timeoutId !== undefined) { | ||
| clearTimeout(timeoutId); | ||
| timeoutId = undefined; | ||
| } | ||
|
|
||
| if (target !== undefined) { | ||
| setActive(() => target); | ||
| timeoutId = setTimeout(() => { | ||
| setActive(undefined); | ||
| timeoutId = undefined; | ||
| }, duration); | ||
| } else { | ||
| setActive(undefined); | ||
| } | ||
| }) | ||
| ); | ||
|
|
||
| onCleanup(() => { | ||
| if (timeoutId !== undefined) { | ||
| clearTimeout(timeoutId); | ||
| } | ||
| }); | ||
|
|
||
| return active; | ||
| } |
Contributor
There was a problem hiding this comment.
@sedson didn't you write something exactly like this ?
peterchinman
reviewed
Dec 1, 2025
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.
Summary
this flashes the email message from a search result similar to how we do it for block-channel. it also keeps the message_id query param for the same behavior. re-clicking from the search in a separate panel will also trigger the highlight behavior
Screenshots, GIFs, and Videos
CleanShot.2025-12-01.at.17.34.31.mp4