Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Jan 20, 2026

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

  • Bug Fixes

    • Prevented duplicate columns from appearing by deduplicating saved and displayed column order.
    • Improved column ordering stability and persistence across views.
  • New Features / Improvements

    • Spreadsheet view now uses a sanitized, explicit column order with fixed left/right columns and preserved column widths for more predictable layout.
    • Table header rendering updated for more reliable UI updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@ItzNotABug ItzNotABug self-assigned this Jan 20, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

Walkthrough

getColumnOrder and saveColumnOrder in the preferences store now deduplicate column ID arrays before returning or persisting them. The spreadsheet component adds a new setupColumns routine that removes system columns (e.g., $id, actions), deduplicates, validates against allowed keys (including $createdAt and $updatedAt), and preserves column widths. makeTableColumns was changed to assign a fixed left column and fixed right column, build a reorderable middle section (including some static columns), and apply reordering to that middle section before composing the final columns array. The table header iteration was keyed by column id to stabilize rendering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title uses vague and generic language ('things!') that doesn't clearly convey what the pull request actually does, despite referencing real issues being fixed. Replace vague terms like 'things!' with specific technical details. Consider: 'Fix: column deduplication, ordering, and keyed iteration to prevent crashes and infinite loops' to better describe the actual changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/lib/stores/preferences.ts`:
- Around line 265-269: The saveColumnOrder method can throw when columnIds is
undefined because new Set(undefined) is invalid; in saveColumnOrder (and where
teamPreferences.columnOrder is set) coerce columnIds to a default empty array
before creating the Set (e.g., use columnIds ?? [] or Array.isArray check) so
teamPreferences.columnOrder[tableId] = Array.from(new Set(defaultedColumnIds));
ensure you still call ensureObjectProperty(teamPreferences, 'columnOrder') first
and use the same symbol names (saveColumnOrder, teamPreferences, columnOrder,
columnIds) when making the change.

@ItzNotABug ItzNotABug merged commit a2491f5 into main Jan 20, 2026
3 checks passed
@ItzNotABug ItzNotABug deleted the fix-prefs branch January 20, 2026 06:09
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.

3 participants