-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Category Labels Not Scaling Correctly On Small Screen #3906
base: master
Are you sure you want to change the base?
Category Labels Not Scaling Correctly On Small Screen #3906
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
WalkthroughThe pull request introduces modifications to the Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
packages/desktop-client/src/components/transactions/TransactionsTable.jsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-eslint-plugin". (The package "eslint-plugin-eslint-plugin" was not found when loaded as a Node module from the directory "/packages/eslint-plugin-actual".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-eslint-plugin" was referenced from the config file in "packages/eslint-plugin-actual/.eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
packages/desktop-client/src/components/transactions/TransactionsTable.jsx (4)
Line range hint
273-279
: Simplify theselectAscDesc
function for improved readabilityThe nested ternary operators in the
selectAscDesc
function can reduce readability and make the code harder to maintain. Consider refactoring it using if-else statements or simplifying the ternary expressions.Here's a possible refactor:
function selectAscDesc(field, ascDesc, clicked, defaultAscDesc = 'asc') { - return field === clicked - ? ascDesc === 'asc' - ? 'desc' - : 'asc' - : defaultAscDesc; + if (field === clicked) { + return ascDesc === 'asc' ? 'desc' : 'asc'; + } else { + return defaultAscDesc; + } }
Line range hint
727-1133
: Refactor theTransaction
component to enhance maintainabilityThe
Transaction
component spans over 400 lines and handles multiple responsibilities, including rendering, state management, and event handling. This complexity can make the component difficult to understand, test, and maintain. Consider breaking it down into smaller, reusable components to improve readability and adhere to the Single Responsibility Principle.
Line range hint
822-865
: Prevent potential multiple calls inonUpdate
functionThe
onUpdate
function includes checks to prevent multiple modal displays, but there might still be scenarios where it gets called multiple times unintentionally. This can lead to inconsistent state or unexpected behaviors.Consider implementing a debounce or throttling mechanism, or revising the condition checks to ensure
onUpdate
is called only when necessary.
Line range hint
1355-1370
: OptimizemakeTemporaryTransactions
function for future scalabilityCurrently, the
makeTemporaryTransactions
function returns an array with a single temporary transaction. If there is a future requirement to generate multiple temporary transactions, consider adjusting the function to accept a parameter specifying the number of transactions to create.For example:
-function makeTemporaryTransactions(currentAccountId, currentCategoryId, lastDate) { +function makeTemporaryTransactions(currentAccountId, currentCategoryId, lastDate, count = 1) { + return Array.from({ length: count }, (_, index) => ({ id: 'temp', date: lastDate || currentDay(), account: currentAccountId || null, category: currentCategoryId || null, cleared: false, amount: null, + index, })); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
upcoming-release-notes/3906.md
is excluded by!**/*.md
📒 Files selected for processing (1)
packages/desktop-client/src/components/transactions/TransactionsTable.jsx
(1 hunks)
🔇 Additional comments (1)
packages/desktop-client/src/components/transactions/TransactionsTable.jsx (1)
Line range hint 1606-1665
: Verify edge case handling in notesTagFormatter
function
The notesTagFormatter
function processes note tags within the notes text. Ensure that it correctly handles edge cases, such as multiple consecutive '#' characters, empty tags, or special characters, to prevent potential rendering issues or errors.
To verify this, consider adding unit tests covering scenarios like:
- Notes with multiple consecutive '#' characters (e.g.,
###tag
) - Notes with tags containing special characters or spaces
- Notes with empty tags or trailing '#' characters
This will help ensure the function behaves correctly in all cases.
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.
Thanks for this!
Fixes #3849
Category Labels should now scale alongside the background on smaller screens. See fix below: