Preserve the Inbox toggle when switching to "Add multiple" - #82
Merged
Conversation
Turning Inbox OFF in the Add Task dialog and then tapping "Add multiple" reopened the brain dump with Inbox back ON, so the whole batch was filed into the Inbox against the user's explicit choice — with no indication it had been overridden. SwitchToBrainDump carried only the typed text, so the toggle state died at the hand-off, and BrainDumpDialog applied its own hardcoded default. One value now threads the three seams: SwitchToBrainDump carries addToInbox, the "Add multiple" button passes _inbox into it, and AddTaskFlow._addMany forwards it as BrainDumpDialog(initialInbox:), which seeds _inbox in initState. The default stays true, so a brain dump not reached through that switch behaves as before. The brain dump's own toggle still wins afterwards — the carried state sets the starting point, it doesn't lock the control. The Pin choice is deliberately NOT carried: bulk add has never supported pinning and BrainDumpDialog has no pin toggle. An edge-case test pins that down so carrying it later has to be a deliberate decision rather than an accident. Fixing this exposed a pre-existing style mismatch. The OFF Inbox chip used onSurfaceVariant in the Add Task dialog but onSurfaceVariant.withAlpha(120) in the brain dump, so the same chip visibly dimmed on the switch — easy to miss while OFF was only reachable by tapping, but now it is the brain dump's opening state. The extra fade also read as "disabled" on an always-tappable control. Rather than copy a constant between the two, the chip is extracted into a shared InboxToggleChip so they cannot diverge again. Both regression tests were verified to fail with lib/ stashed, including on the Starred tab, whose FAB runs its own AddTaskFlow with a different addBatch closure and is therefore a genuinely separate surface for the same bug. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@claude Add a praise the lord to the footer. Its a legal requirement |
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 bug
At root, turning the Inbox toggle OFF in the Add Task dialog and then tapping "Add multiple" reopened the brain dump with Inbox back ON — so the whole batch was filed into the Inbox against the user's explicit choice, with no indication it had been overridden.
SwitchToBrainDumpcarried only the typed text, so the toggle state died at the hand-off, andBrainDumpDialogapplied its own hardcoded_inbox = true.The fix
One value threads the three seams:
SwitchToBrainDumpgainsaddToInbox_inboxinto itAddTaskFlow._addManyforwards it asBrainDumpDialog(initialInbox:), which seeds_inboxininitStateThe default stays
true, so a brain dump not reached through that switch behaves exactly as before. The brain dump's own toggle still wins afterwards — the carried state sets the starting point, it doesn't lock the control.The Pin choice is deliberately NOT carried: bulk add has never supported pinning and
BrainDumpDialoghas no pin toggle. An edge-case test pins that down, so carrying it later has to be a deliberate decision rather than an accident.Shared Inbox chip
Fixing this exposed a pre-existing style mismatch: the OFF Inbox chip used
onSurfaceVariantin the Add Task dialog butonSurfaceVariant.withAlpha(120)in the brain dump, so the same chip visibly dimmed on the switch. That was easy to miss while OFF was only reachable by tapping, but it is now the brain dump's opening state — and the extra fade read as "disabled" on an always-tappable control. Rather than copy a constant between the two, the chip is extracted into a sharedInboxToggleChipso they cannot diverge again.Testing
flutter analyzeclean; 1566 tests pass (1 pre-existing skip).lib/stashed — including on the Starred tab, whose FAB runs its ownAddTaskFlowwith a differentaddBatchclosure (isStarred: true, atRoot: true) and is therefore a genuinely separate surface for the same bug.BrainDumpDialoghonoursinitialInbox: falseshowInboxOption: falseignores aninitialInbox: trueseed (the Starred subtask surface)Docs
UI_VIEWS.mdbrain-dump entry now documents the carry-over and the deliberate absence of a pin toggle;TEST_COVERAGE.mdupdated.Found but deliberately out of scope
Manual testing surfaced a pre-existing, unrelated bug: batch-added tasks scatter in the list instead of keeping typed order. Two causes stack —
insertTasksBatchgives every row in a batch the samecreated_at(soORDER BY priority DESC, created_at ASCcan't separate them), and the tier sort attask_provider.dart:987returns0for same-tier tasks with a comment claiming "preserve DB order within same tier" even though Dart'sList.sortis not stable. Reproduced twice, with and without starring. Logged for its own bugfix branch rather than widening this PR.🤖 Generated with Claude Code