Skip to content

feat: add color_static color rule; use it to highlight join-key columns in compare#594

Merged
paddymul merged 2 commits intomainfrom
feat/compare-pk-header-highlight
Feb 26, 2026
Merged

feat: add color_static color rule; use it to highlight join-key columns in compare#594
paddymul merged 2 commits intomainfrom
feat/compare-pk-header-highlight

Conversation

@paddymul
Copy link
Collaborator

Summary

  • New framework primitive: color_static color rule in the Buckaroo styling config — applies a single constant background color to every cell in a column without depending on any data value. Adds ColorStaticRules to DFWhole.ts, colorStatic() to Styler.tsx, and handles "color_static" in getStyler().
  • Compare tool: Join/primary-key columns now use color_static with #6c5fc7 (purple) instead of the membership-based categorical coloring, making it immediately obvious which columns are the join key vs the data-diff columns.
  • CLAUDE.md: Documents the framework/app architecture principle — visual needs should be expressed through general framework primitives, not one-off CSS hacks or per-feature special cases.

Motivation

Before this change, join-key columns in the compare view used the same pink/green/blue membership coloring as data columns. There was no visual distinction — users had no way to tell which columns were being treated as the primary key.

The fix was to add a proper general-purpose color_static rule (useful for any app that wants to mark a column's role rather than its value), then use it in col_join_dfs.

Test plan

  • Existing compare_test.py tests still pass
  • test_load_compare.py still passes
  • In the compare view, join-key columns show a uniform purple background; data-diff columns still show pink/green/blue membership colors
  • color_static can be set via column_config in any Storybook/standalone usage

🤖 Generated with Claude Code

…ns in compare

Add a general-purpose color_static rule to the styling config that applies
a single constant background color to every cell in a column, without
depending on any data value.  Any app using the column_config API can now
mark a column's visual role independently of its data.

Use it in col_join_dfs to highlight join/primary-key columns with a distinct
purple (#6c5fc7), making it immediately obvious which columns are being
treated as the join key vs the columns being diff-ed.

Also add CLAUDE.md documenting the framework/app architecture principle:
visual needs should be expressed through general framework primitives, not
one-off CSS hacks or special-cased app logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

📦 TestPyPI package published

pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.12.12.dev22421272339

or with uv:

uv pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.12.12.dev22421272339

MCP server for Claude Code

claude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.12.12.dev22421272339" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ff21a2d3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"color_rule": "color_categorical",
"map_name": eq_map,
"val_column": "membership",
"color_rule": "color_static",

Choose a reason for hiding this comment

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

P1 Badge Avoid emitting unsupported color_static in compare output

col_join_dfs now emits "color_rule": "color_static", but the server-rendered frontend still comes from buckaroo/static/standalone.js (see buckaroo/server/handlers.py), and that bundle’s getStyler switch only handles color_map, color_categorical, color_from_column, and color_not_null (no color_static path). In the default standalone app, join-key highlighting will therefore be ignored, so this feature does not take effect for users until the static bundle is rebuilt/committed with the new rule.

Useful? React with 👍 / 👎.

color_static was added to TS/Python but the compiled standalone.js
predates it, so the rule was silently ignored in the browser.

Switch to color_categorical with a constant 4-element map of pk_color —
membership values 1/2/3 all index into pk_color, giving a solid purple
column background that works with the current compiled JS.

color_static remains the cleaner long-term implementation once the JS
bundle is rebuilt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@paddymul paddymul added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit f8a8b94 Feb 26, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant