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

Update tooltip and themes with better visibility #3298

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

psybers
Copy link
Contributor

@psybers psybers commented Aug 20, 2024

Reviving #2815.

@actual-github-bot actual-github-bot bot changed the title Update tooltip and themes with better visibility [WIP] Update tooltip and themes with better visibility Aug 20, 2024
Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 6d86d92
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66ecf29cc1ff200008fce34b
😎 Deploy Preview https://deploy-preview-3298.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 Aug 20, 2024

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
9 5.28 MB → 5.28 MB (+656 B) +0.01%
Changeset
File Δ Size
src/style/styles.ts 📈 +197 B (+4.41%) 4.36 kB → 4.55 kB
src/style/themes/dark.ts 📈 +101 B (+1.31%) 7.53 kB → 7.63 kB
src/style/themes/development.ts 📈 +100 B (+1.31%) 7.46 kB → 7.56 kB
src/style/themes/midnight.ts 📈 +95 B (+1.28%) 7.24 kB → 7.33 kB
src/style/themes/light.ts 📈 +99 B (+1.27%) 7.59 kB → 7.69 kB
src/components/select/DateSelect.tsx 📈 +29 B (+0.33%) 8.54 kB → 8.57 kB
src/components/autocomplete/Autocomplete.tsx 📈 +35 B (+0.21%) 16.21 kB → 16.25 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3.31 MB → 3.31 MB (+656 B) +0.02%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/AppliedFilters.js 20.97 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/usePreviewTransactions.js 1.59 kB 0%
static/js/narrow.js 80.95 kB 0%
static/js/wide.js 225.37 kB 0%
static/js/ReportRouter.js 1.5 MB 0%

Copy link
Contributor

github-actions bot commented Aug 20, 2024

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
1 1.19 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.19 MB 0%

@psybers psybers changed the title [WIP] Update tooltip and themes with better visibility Update tooltip and themes with better visibility Aug 20, 2024
@psybers
Copy link
Contributor Author

psybers commented Aug 20, 2024

@VoltaicGRiD I revived your old PR and updated VRT.

@youngcw
Copy link
Contributor

youngcw commented Aug 20, 2024

The tooltips in light theme seem off. Like it has a shadow over the whole thing. The dark modes seem fine.

@psybers
Copy link
Contributor Author

psybers commented Aug 20, 2024

https://deploy-preview-3298.demo.actualbudget.org

I think I see what you mean. The background isn't white, like the table cells, it is somewhat off.

@psybers
Copy link
Contributor Author

psybers commented Aug 20, 2024

image

@psybers
Copy link
Contributor Author

psybers commented Aug 20, 2024

@youngcw How about this?

@youngcw
Copy link
Contributor

youngcw commented Aug 20, 2024

thats better

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this stay as needing updated if you re-run the vrt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does. Not sure why it hovers now when it did not before.

@youngcw
Copy link
Contributor

youngcw commented Aug 20, 2024

This adds borders around the payee and category pickers. It would be nice if those stayed the same.

@psybers
Copy link
Contributor Author

psybers commented Aug 21, 2024

This adds borders around the payee and category pickers. It would be nice if those stayed the same.

@youngcw Changed. None of the autocomplete menus show the border now.

@youngcw
Copy link
Contributor

youngcw commented Sep 4, 2024

Im guessing that you are letting those filter tooltips be different on purpose. Thats fine, but the VRT needs updated.

@psybers
Copy link
Contributor Author

psybers commented Sep 4, 2024

Im guessing that you are letting those filter tooltips be different on purpose. Thats fine, but the VRT needs updated.

I'm not sure why those VRT fail. The new version has an extra filter button for tags, but the 'expected' does not. I did not touch any filters...

Copy link

coderabbitai bot commented Sep 19, 2024

Walkthrough

The changes introduce enhancements to the styling of various components, particularly focusing on tooltips and popovers across multiple theme files. The Autocomplete and DateSelect components receive additional style properties to improve their visual presentation. New constants for tooltip styling are added in the dark, development, light, and midnight theme files, allowing for consistent customization of tooltip appearance. Overall, these updates refine the user interface without altering existing functionality.

Changes

File Path Change Summary
.../autocomplete/Autocomplete.tsx Added ...styles.popover to SingleAutocomplete component for improved styling.
.../select/DateSelect.tsx Imported styles and modified Popover style prop to include styles.popover for enhanced styling.
.../style/styles.ts Expanded tooltip styles with new properties; modified popover style to remove overflow and set border to 'none'.
.../themes/dark.ts Added constants for tooltip styling: tooltipText, tooltipBackground, tooltipBorder.
.../themes/development.ts Added constants for tooltip styling: tooltipText, tooltipBackground, tooltipBorder.
.../themes/light.ts Added constants for tooltip styling: tooltipText, tooltipBackground, tooltipBorder.
.../themes/midnight.ts Added constants for tooltip styling: tooltipText, tooltipBackground, tooltipBorder.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

Outside diff range and nitpick comments (2)
packages/desktop-client/src/components/select/DateSelect.tsx (2)

338-338: Consolidate minWidth into styles.popover for consistency

To maintain consistency and centralize styling, consider moving the minWidth: 225 property into the styles.popover object within your styles module. This approach promotes reusability and simplifies maintenance.


Line range hint 217-235: Safely handle null selectedValue in onBlur handler

In the onBlur handler, if selectedValue is null, calling parse(selectedValue, dateFormat, new Date()) may result in an error. Ensure that selectedValue is not null before parsing to prevent potential runtime errors.

Apply this diff to add a null check:

    } else {
      setValue(selectedValue || '');

+     if (selectedValue) {
        const date = parse(selectedValue, dateFormat, new Date());
        if (date instanceof Date && !isNaN(date.valueOf())) {
          onSelect(format(date, 'yyyy-MM-dd'));
        }
+     }
    }
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b3669b3 and 81bee1f.

Files ignored due to path filters (11)
  • packages/desktop-client/e2e/schedules.test.js-snapshots/Schedules-creates-a-new-schedule-posts-the-transaction-and-later-completes-it-9-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-3-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-4-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-5-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-category-6-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-1-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-2-chromium-linux.png is excluded by !**/*.png
  • packages/desktop-client/e2e/transactions.test.js-snapshots/Transactions-filters-transactions-by-date-3-chromium-linux.png is excluded by !**/*.png
  • upcoming-release-notes/3298.md is excluded by !**/*.md
Files selected for processing (7)
  • packages/desktop-client/src/components/autocomplete/Autocomplete.tsx (1 hunks)
  • packages/desktop-client/src/components/select/DateSelect.tsx (2 hunks)
  • packages/desktop-client/src/style/styles.ts (1 hunks)
  • packages/desktop-client/src/style/themes/dark.ts (1 hunks)
  • packages/desktop-client/src/style/themes/development.ts (1 hunks)
  • packages/desktop-client/src/style/themes/light.ts (1 hunks)
  • packages/desktop-client/src/style/themes/midnight.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • packages/desktop-client/src/components/autocomplete/Autocomplete.tsx
Additional comments not posted (7)
packages/desktop-client/src/style/styles.ts (2)

142-143: Approved: Popover style border set to 'none'

Setting the border property of the popover style to 'none' improves visual consistency and aligns with the intended design.


134-141: Ensure theme variables for tooltip styling are defined

The added properties in the tooltip style rely on theme variables (theme.tooltipBorder, theme.tooltipBackground, theme.tooltipText). Please verify that these theme variables are defined in all theme files to prevent runtime errors.

Run the following script to confirm that the tooltip theme variables are defined:

Verification successful

Tooltip theme variables are properly defined across all themes

The verification process confirms that tooltipBorder, tooltipBackground, and tooltipText are correctly defined in all theme files (midnight, development, light, and dark). This ensures consistent tooltip styling across different visual modes and mitigates the risk of runtime errors.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that tooltip theme variables are defined in theme files.

# Test: Search for definitions of 'tooltipBorder', 'tooltipBackground', and 'tooltipText'.
# Expect: Occurrences of these variables in theme files.

rg --type js --type ts --word-regexp 'tooltip(Border|Background|Text)'

Length of output: 1559

packages/desktop-client/src/style/themes/development.ts (1)

209-211: Addition of tooltip styling constants follows established patterns.

The newly added tooltipText, tooltipBackground, and tooltipBorder constants are appropriately named and utilize colors from the existing colorPalette, maintaining consistency with the rest of the theme definitions.

packages/desktop-client/src/style/themes/dark.ts (1)

210-212: LGTM!

The addition of tooltip styling constants improves the customization and consistency of tooltips in the dark theme.

packages/desktop-client/src/style/themes/light.ts (1)

212-214: New tooltip styling constants added correctly

The addition of tooltipText, tooltipBackground, and tooltipBorder is consistent with the existing naming conventions and structure of the theme file. These constants will enhance the customization and visibility of tooltips in the light theme.

packages/desktop-client/src/style/themes/midnight.ts (1)

212-214: Consistent addition of tooltip styling constants

The new constants tooltipText, tooltipBackground, and tooltipBorder are appropriately defined and align well with the existing midnight theme color palette. This addition enhances tooltip visibility and maintains visual consistency across the application.

packages/desktop-client/src/components/select/DateSelect.tsx (1)

30-30: Appropriate import of 'styles' and 'theme'

Importing { styles, theme } from '../../style' enhances consistency and reusability of styles across components.

Comment on lines +212 to +214
export const tooltipText = colorPalette.navy900;
export const tooltipBackground = colorPalette.white;
export const tooltipBorder = colorPalette.navy150;
Copy link

@coderabbitai coderabbitai bot Sep 19, 2024

Choose a reason for hiding this comment

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

Consider adding tooltip styling constants to other themes for consistency

To maintain a consistent user experience across all themes, consider adding the tooltipText, tooltipBackground, and tooltipBorder constants to the other theme files (e.g., dark.ts, midnight.ts). This ensures that tooltips are styled appropriately regardless of the selected theme.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Swing and a miss... suggesting things that were already done.

Copy link

Choose a reason for hiding this comment

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

@psybers Thank you for pointing that out. I see that you've already added the tooltip styling constants to the other theme files. I'll make sure to be more attentive in future reviews.

🐇🤔


Learnings added
Learnt from: psybers
PR: actualbudget/actual#3298
File: packages/desktop-client/src/style/themes/light.ts:212-214
Timestamp: 2024-09-20T03:54:11.311Z
Learning: The tooltip styling constants `tooltipText`, `tooltipBackground`, and `tooltipBorder` have been added to all theme files, including `dark.ts`, `development.ts`, and `midnight.ts`.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@youngcw youngcw added this to the v24.10.0 milestone Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants