-
Notifications
You must be signed in to change notification settings - Fork 3
feat: email search linking #394
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
Conversation
| <BozzyBracket | ||
| active={props.focused} | ||
| unfocusable={props.unfocusable} | ||
| unfocusable={props.isTarget || props.unfocusable} |
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.
you can't flash while also focused, so this flashes and then focuses
synoet
left a comment
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.
One nit. Will leave to @sedson to confirm
|
|
||
| /** | ||
| * 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; | ||
| } |
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.
@sedson didn't you write something exactly like this ?
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