Skip to content

[CB] Ability to pin column in the Data Editor#3794

Merged
SychevAndrey merged 86 commits intodevelfrom
6859-cb-ability-to-pin-column-in-the-data-editor
Dec 24, 2025
Merged

[CB] Ability to pin column in the Data Editor#3794
SychevAndrey merged 86 commits intodevelfrom
6859-cb-ability-to-pin-column-in-the-data-editor

Conversation

@sergeyteleshev
Copy link
Copy Markdown
Contributor

@sergeyteleshev sergeyteleshev commented Oct 1, 2025

closes https://github.com/dbeaver/pro/issues/6859

Changes:

  1. Added pin/unpin logic
  2. Some features need to use visual column ID, some need to use dataColIdx. So used it respectively where required
  3. Added some changes to react-data-grid API in this brunch

@sergeyteleshev sergeyteleshev self-assigned this Oct 1, 2025
@sergeyteleshev sergeyteleshev marked this pull request as ready for review October 9, 2025 09:00
$color-negative: hsl(0, 95%, 65%);
$color-status: #a08600;

$color-add-status: #65974c;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I’m not sure these tokens should be here, since they’re scoped to specific grid behavior, while core theming is meant for shared concepts like negative and positive colors, etc. I suggest to move it to data spread sheet plugin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved to layer styles of data grid component

const tableData = useTableData(model as unknown as IDatabaseDataModel<ResultSetDataSource>, resultIndex, dataGridDivRef);
const gridSelectionContext = useGridSelectionContext(tableData, selectionAction);

const pinColumn = useCallback((colIdx: IGridColumnKey) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think its better to move logic with pinnedColumns state and setters to separate hook because data grid table is quite large and i dont see the point of keeping this helpers here. What do you think?

usePinnedColumns or something else

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good idea! component became quite big so moved the logic into the hook

devnaumov
devnaumov previously approved these changes Dec 23, 2025
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
@layer Components {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should be components from small letter c

SychevAndrey
SychevAndrey previously approved these changes Dec 23, 2025
@SychevAndrey SychevAndrey self-requested a review December 24, 2025 09:49
@SychevAndrey SychevAndrey merged commit 7a8c4a1 into devel Dec 24, 2025
9 of 10 checks passed
@SychevAndrey SychevAndrey deleted the 6859-cb-ability-to-pin-column-in-the-data-editor branch December 24, 2025 12:44
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.

6 participants