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

feat: move theme options out of labs #2340

Open
wants to merge 7 commits into
base: qa
Choose a base branch
from
Open

feat: move theme options out of labs #2340

wants to merge 7 commits into from

Conversation

jimniels
Copy link
Collaborator

@jimniels jimniels commented Feb 27, 2025

Resolves #2283

CleanShot 2025-02-27 at 15 38 50@2x

CleanShot 2025-02-27 at 14 57 44@2x


Notes on implementation:

  1. Theme options no longer live in "Labs" but are now under "Profile & preferences".
    1. We can consider moving this to a separate place in the future, like making "Profile" and "Preferences" two different places. Just doesn't feel like we have enough of a reason to make that distinction today? So was just planning on keeping them combined for now.
  2. Theme options remain in the same spot when you're in the spreadsheet.
  3. "Labs" is no longer in the sidebar because there are 0 things in the lab (so it disappears from the menu)
  4. Users who never turned this on in labs will have theming turned on automatically. Defaults are blue/light.
  5. Moved the css invert style to individual elements that need it, rather than the entire grid wrapper (as this was causing visual bugs where things were white when they should be black)

@cla-bot cla-bot bot added the cla-signed label Feb 27, 2025
Copy link

qa-wolf bot commented Feb 27, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link
Contributor

github-actions bot commented Feb 27, 2025

Preview - Build & Deploy Images

✅ Build images
✅ Deploy images

🕒 Last deployed: Feb 28, 2025 at 07:59 PM UTC

🔗 URL: https://jim-2283.quadratic-preview.com

@github-actions github-actions bot temporarily deployed to preview-pr-2340 February 27, 2025 22:04 Destroyed
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.94%. Comparing base (951a3ed) to head (90fffaf).
Report is 21 commits behind head on qa.

Additional details and impacted files
@@            Coverage Diff             @@
##               qa    #2340      +/-   ##
==========================================
+ Coverage   89.93%   89.94%   +0.01%     
==========================================
  Files         380      380              
  Lines       83654    83720      +66     
==========================================
+ Hits        75231    75306      +75     
+ Misses       8423     8414       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot temporarily deployed to preview-pr-2340 February 27, 2025 22:41 Destroyed
Copy link
Collaborator

@AyushAgrawal-A2 AyushAgrawal-A2 left a comment

Choose a reason for hiding this comment

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

can you please fix the drag/drop modal dark mode

Screencast.from.2025-02-28.04-48-33.webm

@github-actions github-actions bot temporarily deployed to preview-pr-2340 February 27, 2025 23:26 Destroyed
@jimniels
Copy link
Collaborator Author

Nice, good catch @AyushAgrawal-A2 — it's a straightforward fix, swapped some hard-coded colors to theme variables. Screenshots:

CleanShot 2025-02-27 at 16 26 07@2x

CleanShot 2025-02-27 at 16 26 14@2x

@github-actions github-actions bot temporarily deployed to preview-pr-2340 February 28, 2025 17:29 Destroyed
<EmptyGridMessage />
<Search />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved these just to try and put all these elements in the same place. They were in QuadraticGrid before, but ultimately render in the same place. So I'm sticking them here where everything else is.

@@ -148,7 +148,7 @@ export const SuggestionDropDown = () => {
return (
<div
className={cn(
'border.gray-300 pointer-events-auto absolute cursor-pointer overflow-y-auto border bg-white text-gray-500',
'pointer-events-auto absolute cursor-pointer overflow-y-auto rounded-sm border border-border bg-background text-muted-foreground',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CleanShot 2025-02-28 at 10 30 05@2x

Using theme colors here rather than hard-coded colors.

@github-actions github-actions bot temporarily deployed to preview-pr-2340 February 28, 2025 18:25 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-2340 February 28, 2025 19:42 Destroyed
@@ -37,7 +35,6 @@ export default function QuadraticGrid() {
return (
<div
ref={containerRef}
className="dark-mode-hack"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved this from the parent because it was inverting everything under it. This cause HTML-rendered elements like the empty sheet message to invert to white in dark mode:

CleanShot 2025-02-28 at 12 40 25@2x

Instead, we now apply dark-mode-hack to any individual element that should be inverted. Hopefully over time we can strip these out one-by-one and apply proper theme colors.

@@ -45,6 +45,8 @@ export const Following = () => {
</div>
<div
style={{
top: 0,
left: 0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

dark-mode-hack which uses filter changes stacking contexts in CSS, so this now needs a reference for its positioning since we removed it from the parent.

<div className="fixed bottom-16 left-8 z-50 h-[92px] w-[403px] select-none border border-slate-200 bg-white pb-2 pl-4 pr-4 pt-2 tracking-tight shadow-[0_2px_5px_0px_rgba(0,0,0,0.15)]">
<div className="flex justify-between">
<div className="absolute bottom-4 left-4 z-50 w-96 select-none rounded border border-border bg-background pb-2 pl-4 pr-4 pt-2 tracking-tight shadow-lg">
<div className="mb-2 flex items-center justify-between">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This element had a bunch of hard-coded values. Causing it to not work well in dark mode.

CleanShot 2025-02-28 at 12 46 44@2x

Changed all them to be theme colors.

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.

Take Themes/Dark mode out of Labs
2 participants