fix(local-mail): correct empty-mirror empty-state and collapse triage UI feedback#2311
Open
braden-w wants to merge 4 commits into
Open
fix(local-mail): correct empty-mirror empty-state and collapse triage UI feedback#2311braden-w wants to merge 4 commits into
braden-w wants to merge 4 commits into
Conversation
…er heuristic selectedLabel defaults to 'INBOX', so the old isFiltered derived was almost always true and a freshly-synced (empty) mirror showed "No messages match / try a different label" instead of "No messages mirrored / run sync --full". Replace the isFiltered prop with mirrorEmpty (status rows.messages === 0), the real signal for an empty mirror; the SearchX/Inbox icons and both copy strings follow it.
The re-bind existed to re-narrow runtime/session inside handleApi, but the real cause was hoisting: a function declaration is checked against the widened type because it could be called before the guard runs. Making handleApi a const arrow (defined after the guard) inherits the const narrowing directly, so the two aliases and their inaccurate "all closures lose narrowing" comment are gone. Behavior unchanged.
…in MessageDetail
The parent wraps <MessageDetail> in {#key selectedId}, so the whole component
(mutation included) remounts on every selection: id is constant within an
instance, making the "reset on id change" $effect dead. And lastOutcome was
just a copy of modify.data. Delete both; the strip now reads modify.data
directly. No behavior change (the three-branch strip and the toast are
untouched); whether the strip should exist at all is left as an open UX call.
…oast The strip was a persistent second surface for the same per-action feedback the toast already carries, and because a fold usually succeeds its common state was a redundant "Mirror updated" echoing the visibly-changed label chips. This is the append-log surface ADR-0029 (Whispering's dictation-feedback projection) declined to build: let the effect be the receipt (the row leaves the list, the chips update) and keep a transient toast only for what the effect does not show (the folded:false sync-lag note and errors). Also drops the now-unused CheckIcon and a pre-existing dead Separator import.
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.
The triage list showed the wrong empty state on a freshly-synced mailbox.
isFilteredwas derived fromselectedLabel !== null, but the list defaults toINBOX, so it was almost always true: an empty mirror rendered "No messages match / try a different label" instead of "No messages mirrored / runsync --full". The list now keys its empty state off the real signal,status.rows.messages === 0, with the icon and copy following it.The rest is an indirection pass over the same surface. The MessageDetail outcome strip was a persistent second home for feedback the toast already carries, and since a fold usually succeeds its common state just echoed the visibly-updated label chips: the append-log surface ADR-0029 (Whispering's dictation-feedback projection) declined to build. It is removed in favor of letting the effect be the receipt (the row leaves the list, the chips update), with the transient toast kept for what the effect does not show.
up.ts'shandleApibecame aconstarrow so it inherits the post-guard non-null narrowing directly, dropping anrt/sessre-bind and its inaccurate comment. And a dead reset$effect(the pane already remounts via{#key selectedId}) plus alastOutcomestate mirror are gone.Changelog
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.