Skip to content

fix: pivot row dimension width reset#9377

Open
djbarnwal wants to merge 2 commits intomainfrom
fix/pivot-column-width-reset
Open

fix: pivot row dimension width reset#9377
djbarnwal wants to merge 2 commits intomainfrom
fix/pivot-column-width-reset

Conversation

@djbarnwal
Copy link
Copy Markdown
Member

Fixes pivot table row dimension column widths resetting unexpectedly after table state changes.

https://linear.app/rilldata/issue/APP-802/pivot-table-columns-widths-reset-unexpectedly-when-switching-tabs-or

Changes

  • Persist nested pivot row dimension widths in the same way measure widths are persisted.
  • Key the persisted row dimension width by the first row dimension, so width survives:
    • switching tabs
    • expanding or collapsing nested pivot rows
    • adding or removing unrelated pivot columns
  • Add unit coverage for stable nested row dimension width key behavior.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@djbarnwal djbarnwal requested a review from a team as a code owner May 4, 2026 21:33
@djbarnwal djbarnwal requested a review from AdityaHegde May 4, 2026 21:34
<script lang="ts" context="module">
import { writable } from "svelte/store";
const measureLengths = writable(new Map<string, number>());
const rowDimensionLengths = writable(new Map<string, number>());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doesnt this need a reset between explores?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, have added a scope key for different explore and canvas instances. Given a canvas can have multiple pivot tables, the scope key contains the component id as well in those cases.

@djbarnwal djbarnwal requested a review from AdityaHegde May 5, 2026 14:23
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.

2 participants