fix: don't write "mixed" tag placeholder when bulk editing transactions - #201
Open
GlebYavorski wants to merge 1 commit into
Open
fix: don't write "mixed" tag placeholder when bulk editing transactions#201GlebYavorski wants to merge 1 commit into
GlebYavorski wants to merge 1 commit into
Conversation
When bulk editing transactions with different categories, the modal puts a `mixed` placeholder in the tag list, and `modifyTags` is supposed to expand it into each transaction's own tags. For a transaction without any category `prevTags` is `null`, so the `id === 'mixed' && prevTags` check fell through to the `else` branch and stored the literal `mixed` string as a tag id. After that `usePopulatedTags()['mixed']` is `undefined` and rendering the transaction list crashes in `Symbol` (`tag.symbol` of undefined), taking the whole app down. Fixes ardov#147 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
@GlebYavorski is attempting to deploy a commit to the Alexey Ardov's projects Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Jul 30, 2026
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.
Fixes #147
Проблема
При массовом редактировании операций с разными категориями модалка подставляет служебный тег
mixed(«Разные категории»), который при сохранении должен раскрываться в собственные категории каждой операции. Но если у операции категории нет вообще,prevTags === null, и проверкауходит в
else, записывая строку'mixed'в операцию как настоящий id категории.После этого
usePopulatedTags()['mixed']возвращаетundefined, и рендер списка операций падает вSymbol(Transaction.Components.tsx) наtag.symbol— приложение целиком уходит в error boundary («Что-то навернулось…dt is undefined»).Фикс
'mixed'раскрывается в собственные теги операции независимо от того, есть они или нет:if (id === 'mixed') prevTags?.forEach(addId).Тесты
Добавлен
src/5-entities/transaction/thunks.test.ts— два кейса наbulkEditTransactions: обычное добавление категории к операциям с разными категориями и кейс из issue (одна операция без категории). Второй тест падает без фикса (expected [ 'mixed', 'tag3' ] to deeply equal [ 'tag3' ]) и проходит с ним.npx tsc --noEmitчистый.npx vitest run— 17 тестов проходят;TagSelect2.test.tsxпадает на этапе загрузки (мокi18nextбезdefault-экспорта) — это воспроизводится и наmasterбез этих изменений, к PR не относится.🤖 Generated with Claude Code