Uh oh!
There was an error while loading. Please reload this page.
ViewConfigPanel: add column reorder support in field selector - #694
Merged
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Export EditorPanelType type for sub-panel state management - Add handleColumnMove for column up/down reordering - Enhanced column selector shows selected columns with move buttons - Unselected fields shown separately for easy addition - All changes propagate via onViewUpdate for real-time preview - Added 9 new test cases covering reorder, save, and edge cases Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
CopilotAI
changed the title
[WIP] Add Columns field selector sub-panel to ViewConfigPanelViewConfigPanel: add column reorder support in field selectorFeb 21, 2026
hotlong
marked this pull request as ready for review
February 21, 2026 09:07
Uh oh!
There was an error while loading. Please reload this page.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds column reordering controls to the ViewConfigPanel column selector so users can both toggle visibility and adjust display order with immediate preview updates.
Changes:
- Added
handleColumnMove(fieldName, 'up' | 'down')to swap adjacent entries indraft.columnsand propagate viaonViewUpdate. - Updated the Fields/Columns selector UI to a two-section layout: selected columns (ordered, with ↑/↓ controls) and unselected fields (add-only).
- Added column reorder/addition/persistence tests and updated the roadmap item to completed.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/console/src/components/ViewConfigPanel.tsx | Implements column move logic and updates the column selector UI to support reordering. |
| apps/console/src/tests/ViewConfigPanel.test.tsx | Adds tests covering reorder behavior, boundary disabled states, save persistence, and real-time updates. |
| ROADMAP.md | Marks column reorder in ViewConfigPanel as completed. |
Comments suppressed due to low confidence (2)
apps/console/src/components/ViewConfigPanel.tsx:609
- In the selected-columns render, using
key={colName}can break React reconciliation ifdraft.columnsever contains duplicates (e.g., from persisted config), andindexOf-based move/remove will also behave unexpectedly. Consider normalizingdraft.columnsto unique values on load (or use a stable unique key such as${colName}-${idx}and de-dupe before rendering/updating).
{draft.columns.map((colName: string, idx: number) => {
const field = fieldOptions.find(f => f.value === colName);
return (
<div key={colName} className="flex items-center gap-1 text-xs hover:bg-accent/50 rounded-sm py-0.5 px-1 -mx-1">
<Checkbox
apps/console/src/components/ViewConfigPanel.tsx:607
- Rendering each selected column does a
fieldOptions.find(...)lookup, which becomes O(selectedColumns × fields) on every render. For objects with many fields this can add noticeable overhead; consider precomputing aMap/record of field metadata keyed byvalue(useMemo) and reading from it in the loop.
{draft.columns.map((colName: string, idx: number) => {
const field = fieldOptions.find(f => f.value === colName);
return (
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 freeto 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.
Column selector in ViewConfigPanel only supported toggle visibility — no way to reorder columns. Users couldn't customize display order from the config panel.
Changes
handleColumnMove(fieldName, 'up' | 'down')swaps adjacent items indraft.columns, propagates viaonViewUpdatefor real-time previewEditorPanelTypeexport:'columns' | 'filter' | 'sort'— typed sub-panel identifiers for parent state managementonViewUpdatepropagationOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.