-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
♻️ (components) remove InputWithContent component #4566
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
Conversation
inlining some of its functionality in the consumers instead. This allows us to reduce the footprint of stuff we will need to include in the component library.
✅ 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
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 removes the Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
🔇 Additional comments (8)
✨ Finishing Touches
🪧 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 (
|
...unts-opens-individual-account-page-and-checks-that-filtering-is-working-6-chromium-linux.png
Outdated
Show resolved
Hide resolved
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-4-chromium-linux.png
is excluded by!**/*.png
packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-5-chromium-linux.png
is excluded by!**/*.png
packages/desktop-client/e2e/settings.mobile.test.ts-snapshots/Mobile-Settings-checks-that-settings-page-can-be-opened-6-chromium-linux.png
is excluded by!**/*.png
📒 Files selected for processing (2)
packages/desktop-client/src/components/common/Search.tsx
(2 hunks)packages/desktop-client/src/components/mobile/transactions/TransactionListWithBalances.tsx
(2 hunks)
🧰 Additional context used
🪛 GitHub Check: lint
packages/desktop-client/src/components/common/Search.tsx
[warning] 7-7:
There should be no empty line within import group
[warning] 9-9:
@actual-app/components/icons/v2
import should occur before import of @actual-app/components/input
[warning] 10-10:
@actual-app/components/theme
import should occur before import of @actual-app/components/view
🪛 GitHub Actions: Test
packages/desktop-client/src/components/common/Search.tsx
[warning] 7-7: There should be no empty line within import group import/order
[warning] 9-9: @actual-app/components/icons/v2
import should occur before import of @actual-app/components/input
import/order
[warning] 10-10: @actual-app/components/theme
import should occur before import of @actual-app/components/view
import/order
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Visual regression
- GitHub Check: Functional
- GitHub Check: build (windows-latest)
- GitHub Check: build (ubuntu-latest)
🔇 Additional comments (6)
packages/desktop-client/src/components/mobile/transactions/TransactionListWithBalances.tsx (3)
6-6
: Added necessary theme import.The addition of the theme import is essential for accessing theme-related properties used in the component, particularly for the
mobilePageBackground
property used in the TransactionSearchInput component.
13-13
: ReplacedInputWithContent
withSearch
import.This change aligns with the PR objective to remove the
InputWithContent
component, replacing it with theSearch
component. This is a good refactoring step for reducing the component library footprint.
42-55
: Migrated fromInputWithContent
toSearch
component with updated props.The refactoring properly replaces
InputWithContent
with theSearch
component, making appropriate prop adjustments:
- Renamed
onChangeValue
toonChange
for better API consistency- Added explicit
width
andheight
properties- Changed
style
toinputStyle
and updated border styling to useborderColor
These changes maintain the same functionality while using the more focused
Search
component.packages/desktop-client/src/components/common/Search.tsx (3)
18-20
: Enhanced SearchProps type with additional styling options.The type definition has been improved with:
- Support for a percentage-based width (
100%
)- Optional height property
- Optional inputStyle property for additional styling customization
These changes provide better flexibility for consumers of the component.
35-37
: Added focus state management and dynamic padding calculation.The component now manages its own focus state, which improves user experience by providing visual feedback. The calculated padding ensures the clear button is properly positioned regardless of the input height.
40-123
: Refactored component structure to remove dependency on InputWithContent.The Search component has been completely rewritten to:
- Directly utilize View and Input components instead of InputWithContent
- Maintain the same visual appearance and behavior
- Implement proper focus state management
- Preserve the clear button functionality
- Use consistent styling applied via component props
This is a solid implementation that successfully inlines the functionality previously provided by InputWithContent.
/update-vrt |
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.
Mobile users won't see the hover effect. I kept it 8px there to align with the search icon on the other side. To be consistent. |
inlining some of its functionality in the consumers instead. This allows us to reduce the footprint of stuff we will need to include in the component library.