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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ function SingleAutocomplete<T extends Item>({
isNonModal
style={{
...styles.darkScrollbar,
...styles.popover,
backgroundColor: theme.menuAutoCompleteBackground,
color: theme.menuAutoCompleteText,
minWidth: 200,
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/select/DateSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import { stringToInteger } from 'loot-core/src/shared/util';

import { useSyncedPref } from '../../hooks/useSyncedPref';
import { theme } from '../../style';
import { styles, theme } from '../../style';
import { Input } from '../common/Input';
import { Popover } from '../common/Popover';
import { View } from '../common/View';
Expand Down Expand Up @@ -335,7 +335,7 @@ export function DateSelect({
isOpen={open}
isNonModal
onOpenChange={() => setOpen(false)}
style={{ minWidth: 225 }}
style={{ ...styles.popover, minWidth: 225 }}
data-testid="date-select-tooltip"
>
{content}
Expand Down
10 changes: 9 additions & 1 deletion packages/desktop-client/src/style/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,18 @@ export const styles = {
tooltip: {
padding: 5,
...shadowLarge,
borderWidth: 2,
borderRadius: 4,
borderStyle: 'solid',
borderColor: theme.tooltipBorder,
backgroundColor: theme.tooltipBackground,
color: theme.tooltipText,
overflow: 'auto',
},
popover: {
border: 'none',
backgroundColor: theme.menuBackground,
color: theme.menuItemText,
overflow: 'auto',
},
// Dynamically set
horizontalScrollbar: null as CSSProperties | null,
Expand Down
4 changes: 4 additions & 0 deletions packages/desktop-client/src/style/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,7 @@ export const budgetHeaderCurrentMonth = tableHeaderBackground;
export const floatingActionBarBackground = colorPalette.purple800;
export const floatingActionBarBorder = floatingActionBarBackground;
export const floatingActionBarText = colorPalette.navy150;

export const tooltipText = colorPalette.navy100;
export const tooltipBackground = colorPalette.navy800;
export const tooltipBorder = colorPalette.navy700;
4 changes: 4 additions & 0 deletions packages/desktop-client/src/style/themes/development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,7 @@ export const budgetHeaderOtherMonth = colorPalette.gray80;
export const floatingActionBarBackground = colorPalette.purple400;
export const floatingActionBarBorder = floatingActionBarBackground;
export const floatingActionBarText = colorPalette.navy50;

export const tooltipText = colorPalette.navy900;
export const tooltipBackground = colorPalette.navy50;
export const tooltipBorder = colorPalette.navy150;
4 changes: 4 additions & 0 deletions packages/desktop-client/src/style/themes/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,7 @@ export const budgetHeaderOtherMonth = colorPalette.gray80;
export const floatingActionBarBackground = colorPalette.purple400;
export const floatingActionBarBorder = floatingActionBarBackground;
export const floatingActionBarText = colorPalette.navy50;

export const tooltipText = colorPalette.navy900;
export const tooltipBackground = colorPalette.white;
export const tooltipBorder = colorPalette.navy150;
Comment on lines +212 to +214
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.

4 changes: 4 additions & 0 deletions packages/desktop-client/src/style/themes/midnight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,7 @@ export const budgetHeaderCurrentMonth = tableHeaderBackground;
export const floatingActionBarBackground = colorPalette.gray900;
export const floatingActionBarBorder = colorPalette.purple300;
export const floatingActionBarText = colorPalette.purple200;

export const tooltipText = colorPalette.gray100;
export const tooltipBackground = colorPalette.gray800;
export const tooltipBorder = colorPalette.gray600;
6 changes: 6 additions & 0 deletions upcoming-release-notes/3298.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [VoltaicGRiD, psybers]
---

Implement greater visibility and accessibility on popover menus and tooltips.
Loading