Skip to content

Commit 143b6c3

Browse files
committed
Stylistic changes
1 parent 31e2566 commit 143b6c3

File tree

5 files changed

+7
-34
lines changed

5 files changed

+7
-34
lines changed

apps/react/tables/libraries/AgGrid/marketing-spend-demo-single-comment/components/document/day-view-table-component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export const TableComponent: React.FC = () => {
4646
const commentElement = client.getCommentElement();
4747
commentElement.disableCommentPinHighlighter();
4848

49-
// Enable location-based comments for stable attachment across sorting
50-
commentElement.enablePriorityCommentLocationId();
49+
// Location-based comments are enabled automatically via data-velt-location-id attribute
50+
// Velt will prioritize location IDs when the attribute is present on elements
5151
}
5252
}, [client]);
5353

apps/react/tables/libraries/AgGrid/marketing-spend-demo-single-comment/components/document/grid-components/VeltCellRenderer.tsx

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,14 @@ export const createVeltCellRenderer = (
1212
const cellKey = getCellFormattingKey(props.data.id, props.colDef.field);
1313
const formatting = cellFormatting[cellKey] || {};
1414

15-
// Set ID and location ID on parent AG Grid cell element and add comment tool
15+
// Set ID and location ID on parent AG Grid cell element
1616
React.useEffect(() => {
1717
if (props.eGridCell) {
1818
// Set both the element ID and the Velt location ID
1919
// The location ID is stable and based on data row, not DOM position
2020
props.eGridCell.id = cellId;
2121
props.eGridCell.setAttribute('data-velt-location-id', locationId);
22-
23-
// Check if comment tool already exists
24-
let commentTool = props.eGridCell.querySelector('velt-comment-tool');
25-
if (!commentTool) {
26-
// Create and append comment tool directly to cell
27-
commentTool = document.createElement('velt-comment-tool');
28-
commentTool.setAttribute('target-comment-element-id', cellId);
29-
commentTool.style.cssText = 'position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 1;';
30-
31-
// Append to cell (outside ag-cell-wrapper)
32-
props.eGridCell.appendChild(commentTool);
33-
} else {
34-
// Update target-comment-element-id when cell is recycled
35-
commentTool.setAttribute('target-comment-element-id', cellId);
36-
}
3722
}
38-
39-
return () => {
40-
// Cleanup: remove comment tool and location ID when cell data changes
41-
if (props.eGridCell) {
42-
const commentTool = props.eGridCell.querySelector('velt-comment-tool');
43-
if (commentTool) {
44-
commentTool.remove();
45-
}
46-
// Note: We don't remove the location ID here because AG Grid might
47-
// recycle this cell immediately for another row, and we want to avoid
48-
// any timing issues where Velt might see the cell without a location ID
49-
}
50-
};
5123
}, [cellId, locationId, props.eGridCell]);
5224

5325
const textStyle: React.CSSProperties = {

apps/react/tables/libraries/AgGrid/marketing-spend-demo-single-comment/components/document/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const styles: { [key: string]: React.CSSProperties } = {
2222
backgroundColor: '#090909',
2323
borderRadius: '8px',
2424
overflow: 'hidden',
25-
paddingTop: '36px',
25+
paddingTop: '40px',
2626
paddingBottom: '16px',
2727
},
2828
gridWrapper: {

apps/react/tables/libraries/AgGrid/marketing-spend-demo-single-comment/components/velt/ui-customization/VeltCommentToolWf.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const VeltCommentToolWf = () => {
3636
transform: 'translate(-50%, -50%)',
3737
width: '11px',
3838
height: '11px',
39-
border: '0.972px solid white',
39+
border: '1.5px solid white',
4040
borderRadius: '6px 6px 6px 1px',
4141
boxSizing: 'border-box'
4242
}}

apps/react/tables/libraries/AgGrid/marketing-spend-demo-single-comment/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@apps/react-tables-AgGrid-marketing-spend-demo-single-comment",
2+
"name": "@apps/react-tables-AgGrid-marketing-spend-demo-multiple-comments",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
@@ -9,6 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12+
"@veltdev/react": "^4.5.6-beta.17",
1213
"@tabler/icons-react": "^3.35.0",
1314
"ag-grid-community": "^34.3.0",
1415
"ag-grid-react": "^34.3.0",

0 commit comments

Comments
 (0)