feat(pinned-rows): ?key prefix marks an optional pinned row#777
Merged
Conversation
…nedRows Three new cases covering the proposed `?`-prefix semantic on PinnedRowConfig.primary_key_val: - `?key` with key present in data → row included (current code returns undefined because it looks up the literal `?key` string). - `?key` with key absent → row omitted entirely from the result array (current code returns undefined, leaving holes). - Unprefixed key absent → preserves today's "kept as undefined" behavior so callers depending on positional alignment with pinned_rows config keep working. Uses toStrictEqual + explicit length checks because Jest's toEqual silently treats trailing undefined items as missing, which made an earlier draft of these tests vacuously pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
A leading `?` on PinnedRowConfig.primary_key_val now means "render the row iff the unprefixed key exists in the summary stats data; otherwise omit it entirely." Unprefixed keys preserve today's behavior (kept as undefined when absent) for callers that rely on positional alignment. Mechanism is purely additive: no existing config carries the prefix, so this PR alone is observable-no-op. It unlocks the in-flight scoped summary stats work (raw / cleaned / filtered scopes) where default configs ship with entries like `?cleaned_histogram_bins` and `?filtered_histogram_bins`, rendered only when those scopes are active. extractPinnedRows skips optional rows whose key is missing. getCellRendererSelector matches stripped keys so the cell renderer selector still binds to the pinned config when the data row's bare `index` matches a `?`-prefixed config entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7327da27ae
ℹ️ 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".
Contributor
📦 TestPyPI package publishedpip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.14.3.dev26187656127or 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.14.3.dev26187656127MCP server for Claude Codeclaude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.14.3.dev26187656127" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table📖 Docs preview🎨 Storybook preview |
This was referenced May 20, 2026
- Two tests in gridUtils.test.ts pin the `?`-prefix strip behavior at renderer-resolution time (in addition to extractPinnedRows): a `?key` config matches a bare-key data row to the same cellRenderer that a bare-key config would; and a literal `?key` in data does NOT match, locking in the reserved-character semantics flagged by Codex. - New `OptionalPinnedRows` storybook story exercises the feature interactively: a scope selector flips between raw / filter / filter+clean states so `?filtered_*` and `?cleaned_*` pinned rows appear and disappear without re-mounting the grid. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
?prefix support toPinnedRowConfig.primary_key_val. A leading?means: render the row iff the unprefixed key exists in the summary stats; otherwise omit the row entirely.undefinedwhen absent) for callers that rely on positional alignment with the config.?cleaned_*/?filtered_*entries.Touches
extractPinnedRows(to skip absent optional rows) andgetCellRendererSelector(to match stripped keys so the cell renderer binds correctly when a?keyconfig entry points at a data row with the bareindex).See
docs/plans/async-stats.md(forthcoming) for the broader plan this slots into.Test plan
test(pinned-rows): failing tests …commit), all assertions strict (toStrictEqual+ explicit length) to avoid Jest'stoEqualsilently ignoring trailingundefineditems.packages/buckaroo-js-corepass locally.🤖 Generated with Claude Code