File a thread out of the box it is in, not the list it was found through - #412
Merged
Conversation
monorkin
force-pushed
the
file-from-bundles
branch
from
September 8, 2026 07:44
bc38fb8 to
6d9ebfc
Compare
The filing keys refused a thread opened from a bundle, a contact's threads or a search. That is the customer report behind the card, and the customer is right that all three file fine on the web. The web manages it because its toolbar reads the posting's own box — posting.box.kind, off the row rather than off the page you came from. HEY serves that box to every client: postings/_object.jbuilder writes box_id on every posting, and the SDK's generated type has carried BoxId all along. mail.Posting was dropping it on the way through, so the TUI had nothing to ask and fell back to asking the list. A list can draw rows from several boxes at once — a search, a label, a collection, a contact's threads — so the list's box was the wrong thing to ask. Filing measured "already in Paper Trail" against whatever box sat behind the results, and the fix for that was to refuse those lists outright rather than to ask the row. So: carry BoxID through, take the box from the posting, and the refusals go with it. Only a topic opened by its id has no row and nothing to file. The same lookup fixes filing from a label or a collection list, where the source carries no box kind at all and the already-in guard could never have fired. A filed row also leaves whichever list was drawn over the box list. Nothing re-reads a search's results or a bundle's threads — both are drawn once when they open — so a row left behind stays there offering to file a thread that has already moved. That is the second commit of #349, which I dropped while rebasing it as unreachable; this is what makes it reachable.
monorkin
force-pushed
the
file-from-bundles
branch
from
September 8, 2026 07:55
6d9ebfc to
46e263f
Compare
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 filing keys refused a thread opened from a bundle, from a contact's threads, or from search results. That is the customer report behind the card, and the customer is right that all three file fine on the web.
@jeremy — this removes the rule you set in #371, so it wants your eye.
The one fact this turns on
HEY serves every posting's box.
postings/_object.jbuilder:The SDK's generated
Postinghas carriedBoxIdall along.mail.Postingwas dropping it on the way through, so the TUI had nothing to ask and fell back to asking the list.That is also what the web reads. Its toolbar is
posting.box.kind— off the row, not off the page you came from — which is why the action bar is the same however you arrived.What was actually wrong
A list can draw rows from several boxes at once: a search, a label, a collection, a contact's threads. So the list's box was the wrong thing to ask. Filing measured "already in Paper Trail" against whatever box happened to sit behind the results, and the fix for that was to refuse those lists outright rather than to ask the row.
Carry
BoxIDthrough, take the box from the posting, and the refusals go with it. Only a topic opened by its id has no row and nothing to file.The same lookup fixes a case nobody reported: filing from a label or collection list, where the source carries no box kind at all, so the already-in guard could never fire.
The row cleanup
A filed row leaves whichever list was drawn over the box list. Nothing re-reads a search's results or a bundle's threads — both are drawn once when they open — so a row left behind stays there offering to file a thread that has already moved.
That is the second commit of #349, which I dropped while rebasing that PR as unreachable. Removing the refusals is what makes it reachable. Credit to @badta5te for writing it.
How I got here
Worth recording, because I had this wrong twice. First I allowed all bundles, which was too broad — a contact's threads span boxes. Then I narrowed it to unseen bundles only and wrote a comment claiming "a posting carries no box of its own to ask instead", which is simply false. @monorkin ran the TUI, showed me the web performing every one of these actions on the exact screen I had just justified refusing, and that sent me to the jbuilder.
Checks
make checkpasses. The behaviour is mutation-checked: droppingBoxIDat the edge fails the newinternal/mailtest, and removing the row cleanup fails the list tests. The help bar is asserted directly for a bundle, a contact's threads and a search, since the reported symptom was the help bar rather than the keys.