-
-
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
Allow the report table columns to grow to fill available space #3872
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
|
/update-vrt |
WalkthroughThis pull request introduces layout modifications to two components: Possibly related PRs
Suggested reviewers
Warning Rate limit exceeded@actual-github-bot[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 21 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 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 (1.23.1)
packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsxOops! 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 (3)
packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsx (2)
Line range hint
69-74
: Consider a more flexible width approach.Instead of combining fixed width with
flexGrow
, consider usingminWidth
for better flexibility:<Cell style={{ - width: compact ? 80 : 125, + minWidth: compact ? 80 : 125, flexShrink: 0, flexGrow: 1, }}This would:
- Ensure minimum width for readability
- Allow more natural growth based on content
- Prevent potential layout issues when viewport size changes
Line range hint
46-74
: Consider adding max-width constraint.To prevent the first column from dominating the layout, especially with longer account names, consider adding a maximum width constraint:
<Cell style={{ width: compact ? 80 : 125, flexShrink: 0, flexGrow: 1, + maxWidth: '33%', // Prevents the column from taking too much space }}
This would help maintain a balanced layout while still providing more space for account names.
packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx (1)
126-126
: LGTM! Consider adding a comment to document the flex behavior.The addition of
flexGrow: 1
effectively addresses the issue of narrow first columns by allowing them to expand and utilize available space. This change aligns well with the component's existing flex layout structure.Consider adding a comment to document this important layout behavior:
flexShrink: 0, + // Allow the first column to grow and fill available space flexGrow: 1,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
upcoming-release-notes/3872.md
is excluded by!**/*.md
📒 Files selected for processing (2)
packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsx
(1 hunks)packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx
(1 hunks)
🔇 Additional comments (1)
packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableHeader.tsx (1)
73-73
: LGTM! Consider monitoring fixed width behavior.
The addition of flexGrow: 1
aligns with the PR objective to better accommodate account names. However, the combination of fixed width
with flexGrow
might lead to unexpected behavior in certain viewport sizes.
Let's verify the visual consistency across different viewport sizes:
✅ Verification successful
Styling is consistent, change is safe
The flexGrow: 1
addition in the header aligns perfectly with the row implementation, as the first Cell in ReportTableRow also uses flexGrow: 1
with the same width constraints (80px for compact, 125px for regular mode). The styling is consistent across both components, ensuring proper column alignment.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Find related table components to verify consistent styling
# Look for other table components that might need similar flexGrow adjustments
rg -t tsx "ReportTable(Row|Cell)" packages/desktop-client/src/components/
Length of output: 103
Script:
#!/bin/bash
# Search for related table components using ripgrep without file type restriction
rg "ReportTable(Row|Cell)" packages/desktop-client/src/components/
Length of output: 887
Script:
#!/bin/bash
# Check the styling in ReportTableRow to verify consistency with the header's flexGrow
cat packages/desktop-client/src/components/reports/graphs/tableGraph/ReportTableRow.tsx
Length of output: 10101
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.
LGTM
I'll need someone with more experience here to tell me if/why this is a bad idea, but it fixes my problem of the first column being far too small for account names etc.
Before:
After: