Skip to content
Source
Sign inSign up
TanStack/query

Font size is unusably small on v5 query inspector #6666

Send to my agent
Closedghost opened this issue 5 comments
ghostcommented

Describe the bug

After upgrading to tanstack query v5, the font size is much smaller in the query inspector. There is no way to increase the default font size for the inspector only, and when using browser features to scale up the text, the page I am working on is also impacted.

Your minimal, reproducible example

N/A

Steps to reproduce

  • Set browser font size to default and scaling to 100%
  • Open the tanstack query inspector
  • Try and read the text, it's very small!

Expected behavior

As a developer, I expect that text is legible so I can view the state of the query cache. AND As a developer, I expect that I can set the font size of the query inspector so that text is legible.

How often does this bug happen?

Every time

Screenshots or Videos

With 100% view and default text size Screenshot 2024-01-09 at 11 07 05

When scaling the view to 200% the text is legible, but the page is impacted so much that it starts to act as if it's a different breakpoint Screenshot 2024-01-09 at 11 18 14

Platform

Mac OSX Firefox 121.0

Tanstack Query adapter

react-query

TanStack Query version

5.17.1

TypeScript version

5.3.3

Additional context

No response

  1. Thanks for reporting, I'm experiencing the same issue with a MacBook Pro 16-inch from 2019, I found it difficult to read in a laptop at the default screen resolution. I wouldn't be surprise if this is related to the high DPI or the retina display and how resolutions works in Mac. This was working better for me in @tanstack/react-query v4.29.19

  2. I gather we're inheriting font size from the container https://github.com/TanStack/query/issues/6226, so the ReactQueryDevTools can just be wrapped in a div with the appropriate font size (which Tanstack will then shrink to 5/8 size, if I've understood correctly...)

    However it would be really nice if this was in the tooling rather than having to be set once per app, since different devs will have different access needs and you shouldn't have to raise a PR or write temporary code just to use the tool effectively.

  3. font size is 0.75 rem (12px) and looks fine in the examples:

    https://codesandbox.io/p/devbox/tanstack-query-example-react-simple-lskn7u

    Screenshot 2024-01-10 at 15 28 17

    It was slightly bigger in v4 (0.9em, 12.6px)

    Are you saying the switch to rem caused this? Are you setting custom styles on your body that made them bigger in v4, and this doesn't work anymore in v5?

    @ardeora fyi

  4. TkDodo added labelspackage: query-devtools

  5. Hello! This is working as intended here is an example for you.

    https://codesandbox.io/p/devbox/eloquent-roman-2w4c27?file=%2Fsrc%2Findex.jsx%3A43%2C1-49%2C13&workspaceId=0d8b5620-4f50-49f2-a5b1-e4173816b150

    You can provide a custom fontSize for the query devtools by simply wrapping the devtools component with your desired fontSize.

          <div
            style={{
              fontSize: "24px",
            }}
          >
            <ReactQueryDevtools initialIsOpen />
          </div>

    This will set the base size of the devtools font to 24px.

    I'll close this issue for now. Please let me know if you still run into any issues!

  6. Okay, the solution is easy. All you have to do is give the body element an explicit font size. Say, body{font-size: 1.6rem;}

Sign in to join this conversation.