Colour grid values by type

Open
#367 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli, database

Research direction

Start by locating the result-grid cell rendering, theme-token definitions, and the settings handling for [grid] and :set; the issue does not name files or tests. Trace how cell types, cursor and selection colors, and stripe colors are currently chosen, then check the terminal theme against real screens. Done means the requested type colors and off setting work, text and NULL retain their stated behavior, and numbers remain right-aligned.

Written by the indexing model from the issue text.

Description

enhancement roadmap
Problem

In the result grid every value is drawn in the same colour except NULL. Numbers, dates and text look alike, so scanning a wide result for the kind of value takes longer than it needs to.

Proposal

Colour cell values by their type, with a setting to turn it off:

Kind Examples Colour
Numbers integer, numeric, float number colour
Date and time date, timestamp, interval date colour, different from text
Boolean true, false boolean colour
Structured JSON, arrays, binary, UUID a muted colour of its own
NULL NULL as today (dim, italic)
Text varchar, text, enum the normal text colour
  • Text keeps the normal colour, since most values are text; only the other kinds stand out.
  • Setting [grid] cell_colors = "type" (default) or "off", also in :set and the settings screen.
  • The colours are theme tokens, so custom themes can change them; the terminal theme picks from the 16 terminal colours.
  • Check against the cursor, selection and stripe colours with real screens before it ships.
  • Colour is never the only cue: numbers stay right-aligned.
Dominant language
Rust
Stars
166
Forks
8
Avg merge
4h 24m
Merged PRs (30d)
291

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DokaDev/datarig

All issues in DokaDev/datarig

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.