Skip to content
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

Larger mobile autocomplete fonts and paddings #1900

Conversation

joel-jeremy
Copy link
Contributor

@joel-jeremy joel-jeremy commented Nov 12, 2023

Made autocomplete components easier to tap by making the fonts and paddings larger.

Previous:
image

New:
image

Copy link

netlify bot commented Nov 12, 2023

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 514fd75
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/65669ac8c9fd84000861ac8b
😎 Deploy Preview https://deploy-preview-1900.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Nov 12, 2023

Bundle Stats — desktop-client

Hey 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

Files count Total bundle size % Changed
16 3.08 MB → 3.08 MB (+3.06 kB) +0.10%
Changeset
File Δ Size
src/components/modals/EditField.js 📈 +2.74 kB (+42.04%) 6.51 kB → 9.25 kB
src/components/autocomplete/AccountAutocomplete.tsx 📈 +540 B (+9.92%) 5.32 kB → 5.84 kB
src/components/autocomplete/CategoryAutocomplete.tsx 📈 +638 B (+7.74%) 8.05 kB → 8.67 kB
src/components/autocomplete/PayeeAutocomplete.tsx 📈 +386 B (+2.54%) 14.85 kB → 15.23 kB
src/components/autocomplete/SavedFilterAutocomplete.tsx 📈 +45 B (+2.19%) 2 kB → 2.05 kB
src/components/transactions/MobileTransaction.js 📈 +274 B (+0.50%) 53.91 kB → 54.18 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
static/js/226.chunk.js 0 B → 28.82 kB (+28.82 kB) -

Removed

Asset File Size % Changed
static/js/821.chunk.js 121.15 kB → 0 B (-121.15 kB) -100%

Bigger

Asset File Size % Changed
static/js/main.js 1.17 MB → 1.26 MB (+95.71 kB) +8.01%
static/js/wide-components.chunk.js 113.85 kB → 113.85 kB (+4 B) +0.00%

Smaller

Asset File Size % Changed
static/js/narrow-components.chunk.js 52.93 kB → 52.61 kB (-328 B) -0.61%

Unchanged

Asset File Size % Changed
static/js/665.chunk.js 824.28 kB 0%
static/media/Inter-italic.var.woff2 239.29 kB 0%
static/media/Inter-roman.var.woff2 221.86 kB 0%
static/js/444.chunk.js 156.11 kB 0%
static/js/231.chunk.js 117.37 kB 0%
static/js/reports.chunk.js 74.96 kB 0%
static/js/473.chunk.js 13 kB 0%
static/js/resize-observer-polyfill.chunk.js 8.88 kB 0%
static/css/main.css 7.41 kB 0%
asset-manifest.json 2.07 kB 0%
index.html 1.66 kB 0%
static/media/browser-server.js 911 B 0%

Copy link
Contributor

github-actions bot commented Nov 12, 2023

Bundle Stats — loot-core

Hey 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

Files count Total bundle size % Changed
2 2.22 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
kcab.worker.js 1.23 MB 0%
xfo.xfo.kcab.worker.js 1014.46 kB 0%

@joel-jeremy joel-jeremy force-pushed the mobile-transaction-larger-components branch 3 times, most recently from cff0be7 to d480374 Compare November 16, 2023 18:26
@trevdor
Copy link
Contributor

trevdor commented Nov 17, 2023

Yes! We’ve needed to improve this.
Two thoughts:

  1. Would you see what you think of it with an even larger font, but regular weight instead of bold?
  2. How about a subtle list item divider?

Apple’s native lists for comparison:
IMG_6976

@joel-jeremy joel-jeremy force-pushed the mobile-transaction-larger-components branch 2 times, most recently from b1bbbcf to f85806b Compare November 18, 2023 20:51
@joel-jeremy
Copy link
Contributor Author

@trevdor Updated. :) Let me know if you want me to adjust the font sizes.

@trevdor
Copy link
Contributor

trevdor commented Nov 19, 2023

Definitely easy tap targets now!

Seems like the font-size could decrease just a hair on list items so they're smaller than group headings. That contrast was nice in your original screenshot. (Maybe our font sizes in styles.ts aren't quite up to the task...)

On my phone, grasping the entire diff is tricky, so apologies if I've misread--but how about regular list items get weight 400, font-size...um, a rogue 17?!, and vertical passing of 8? (think I see 10 right now, and rows seem just a touch tall imo)

I haven't had a chance to tweak it in my own browser to give a true "here's my favorite sizing"--it just feels a bit chunky on a small phone at the moment. Thanks for hearing me out!

@joel-jeremy joel-jeremy force-pushed the mobile-transaction-larger-components branch from 0b0ca3e to 3833a74 Compare November 19, 2023 09:19
@joel-jeremy
Copy link
Contributor Author

@trevdor Adjusted the fonts and paddings. :)

@joel-jeremy joel-jeremy added this to the v23.12.0 milestone Nov 23, 2023
@joel-jeremy joel-jeremy force-pushed the mobile-transaction-larger-components branch from 3833a74 to 17935f6 Compare November 23, 2023 15:42
@trevdor
Copy link
Contributor

trevdor commented Nov 24, 2023

Trying to get through the rest of the code tonight, but the visual look good to me!

trevdor
trevdor previously approved these changes Nov 25, 2023
Copy link
Contributor

@trevdor trevdor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This will help me personally, if nothing else :D

Left a few questions/comments, but however you resolve those is good with me.


// It should not allow filtering on group names
await userEvent.clear(input);
await userEvent.type(input, 'Usual Expenses');

items = tooltip.querySelectorAll('[data-testid*="category-item"]');
items = tooltip.querySelectorAll('[data-testid$="category-item"]');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏻 yay for narrowing the selectors & the separating data-highlighted in general

Comment on lines 549 to 550
let highlighted = tooltip.querySelector('[data-highlighted]');
expect(highlighted).not.toBeNull();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're looking for one and not two highlights, how about?

Suggested change
let highlighted = tooltip.querySelector('[data-highlighted]');
expect(highlighted).not.toBeNull();
let highlighted = tooltip.querySelectorAll('[data-highlighted]');
expect(highlighted).toHaveLength(1);

(haven't run this change, so double-check me if you accept it)

@@ -63,7 +63,7 @@ test.describe('Transactions', () => {
await expect(autocomplete).toMatchThemeScreenshots();

// Select the active item
await page.getByRole('button', { name: 'Clothing' }).click();
await page.getByTestId('Clothing-category-item').click();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I prefer getByRole with the user-visible text over grabbing elements by something the user can't see, in order to keep our tests behaving similarly to a user. Did the existing selector fail after the refactor?

As I say, it's a preference, so ship it as you see fit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, the test is hanging on this getByRole call so I had to change it. I'm happy to revert it back to use getByRole if anybody can get it to work again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth holding it up for (although we're in code freeze at the moment).

@SalvyTek
Copy link

@joel-jeremy To improve the readability of the selected category name, could you use a color with greater contrast? Thanks for increasing the font size in this component!
Screenshot_20231125-093256.png

@joel-jeremy
Copy link
Contributor Author

I have updated the hover colors

@SalvyTek
Copy link

SalvyTek commented Nov 27, 2023

Thank you! Now it's perfect!

@joel-jeremy joel-jeremy merged commit 5d1f2d4 into actualbudget:master Dec 1, 2023
18 of 19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved labels Dec 1, 2023
FlorianLang06 pushed a commit to FlorianLang06/actual that referenced this pull request Mar 7, 2024
* Larger mobile autocomplete fonts and paddings

* Release notes

* VRT + update tests

* Update tests

* Update data-highlighted and tests

* Use styles text

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Adjust Add Transaction padding + VRT updates

* Larger autocomplete text and divider

* Fix rebase

* Fix rebase

* Fix icons

* Adjust fonts

* Fix lint errors

* PR feedback

* VRT

* Update embedded autocomplete highlight hover color

* Refactor create payee button

* Embedded create payee button color

* Dummy change to re-run CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants