Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
9dc9936
(refactor): Add `useSectionMenuItems` hook and integrate context menu…
filipvnencak Dec 5, 2025
b7498bb
(refactor): Replace `useSectionMenuItems` with `useSlicerMenuItems` f…
filipvnencak Dec 5, 2025
43efc3b
(refactor): Enhance `useSlicerMenuItems` hook with additional actions…
filipvnencak Dec 8, 2025
2b160a2
(refactor): Remove rename dialog logic, add keyboard shortcuts, and u…
filipvnencak Dec 9, 2025
8c5ca2a
(refactor): Simplify `useSlicerMenuItems` by removing unused logic, d…
filipvnencak Dec 10, 2025
a47eb4c
(refactor): Enhance SimpleTable context for dynamic menu items and co…
filipvnencak Dec 11, 2025
208e817
(refactor): Remove redundant console logs from `SimpleTableContext` f…
filipvnencak Dec 11, 2025
2e81719
(refactor): Remove `useSimpleTableMenu` and migrate alt-click expand/…
filipvnencak Dec 11, 2025
ce4059c
(refactor): Remove `useSimpleTableMenu` and migrate alt-click expand/…
filipvnencak Dec 11, 2025
d815c0b
(refactor): Simplify `SimpleTableContext` and enhance context menu logic
filipvnencak Dec 15, 2025
c3bc03b
Merge branch 'develop' into 1641-YN-0177-add-expand/collapse-function…
filipvnencak Feb 3, 2026
d5521f9
(fix): Add Alt+Click functionality for expand/collapse in `SimpleTabl…
filipvnencak Feb 3, 2026
31b73ec
Merge branch 'develop' into 1641-YN-0177-add-expand/collapse-function…
filipvnencak Mar 4, 2026
961ad2b
Merge branch 'develop' into 1641-YN-0177-add-expand/collapse-function…
filipvnencak Mar 4, 2026
3435832
feat(SimpleTable): replace `handleAltClick` with `expandAllForRow` fo…
filipvnencak Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shared/src/api/generated/folders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export type FolderListItem = {
status: string
attrib?: object
ownAttrib?: string[]
hasVersions: boolean
createdAt: string
updatedAt: string
}
Expand Down
2 changes: 2 additions & 0 deletions shared/src/containers/ProjectTreeTable/ProjectTreeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ const TableBody = ({
})

const handleTableBodyContextMenu = cellContextMenuHook.handleTableBodyContextMenu
const handleTableBodyAltClick = cellContextMenuHook.handleTableBodyAltClick

const { handlePreFetchTasks } = usePrefetchFolderTasks()

Expand Down Expand Up @@ -1172,6 +1173,7 @@ const TableBody = ({
display: 'grid',
}}
onContextMenu={handleTableBodyContextMenu}
onClick={handleTableBodyAltClick}
onMouseOver={(e) => {
handlePreFetchTasks(e)
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,48 @@ const useCellContextMenu = ({
cellContextMenuShow(e, constructedMenuItems)
}

return { handleTableBodyContextMenu }
// Alt+Click handler for expand/collapse
const handleTableBodyAltClick = (e: React.MouseEvent<HTMLTableSectionElement, MouseEvent>) => {
if (!e.altKey) return

const target = e.target as HTMLElement
const tdEl = target.closest('td')
const cellId = tdEl?.firstElementChild?.id

if (!cellId) return

const cellData = getCellData(cellId)
if (!cellData) return

// Only handle folders in the name column
if (cellData.columnId !== 'name' || cellData.entityType !== 'folder') return

e.preventDefault()
e.stopPropagation()

// Get selected folder IDs from current selection
const currentSelectedCells = Array.from(selectedCells)
const selectedCellsData = currentSelectedCells.flatMap((id) => getCellData(id) || [])
const selectedFolderIds = [
...new Set(
selectedCellsData.filter((c) => c.entityType === 'folder').map((c) => c.entityId),
),
]

// Check if clicked folder is in the selection
const isClickedInSelection = selectedFolderIds.includes(cellData.entityId)

// If clicked folder is in selection, use all selected folders; otherwise just the clicked one
const idsToToggle = isClickedInSelection ? selectedFolderIds : [cellData.entityId]

// Check if clicked row is expanded
const isExpanded = expanded[cellData.entityId as keyof typeof expanded]

// Toggle expand/collapse
toggleExpands(idsToToggle, !isExpanded)
}

return { handleTableBodyContextMenu, handleTableBodyAltClick }
}

export default useCellContextMenu
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export const EntityNameWidget = ({
{isExpandable ? (
<Expander
onClick={(e) => {
e.stopPropagation()
if (e.altKey) {
// expand/collapse all children
toggleExpandAll(id)
Expand Down
8 changes: 8 additions & 0 deletions shared/src/containers/SimpleTable/SimpleTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ const SimpleTable: FC<SimpleTableProps> = ({
onRowSelectionChange,
rowPinning,
onRowPinningChange,
onContextMenu,
expandAllForRow,
} = useSimpleTableContext()
const lastSelectedIdRef = useRef<string | null>(null)
const tableRef = useRef<Table<SimpleTableRow> | null>(null)
Expand Down Expand Up @@ -374,6 +376,9 @@ const SimpleTable: FC<SimpleTableProps> = ({
const cellMeta = cellTableInstance.options.meta

const handleCellClick = (event: ReactMouseEvent<HTMLElement, MouseEvent>) => {
// Alt+Click is handled by the RowExpander for expand/collapse
if (event.altKey) return

// Prevent row selection if clicking on an interactive element within the cell
if (
event.target instanceof HTMLInputElement ||
Expand Down Expand Up @@ -422,6 +427,7 @@ const SimpleTable: FC<SimpleTableProps> = ({
isRowExpanded: row.getIsExpanded(),
isTableExpandable: cellMeta?.isExpandable,
onExpandClick: row.getToggleExpandedHandler(),
onAltExpandClick: () => expandAllForRow?.(row.id),
startContent: row.original.startContent,
endContent: row.original.endContent,
isDisabled: row.original.isDisabled,
Expand All @@ -446,6 +452,7 @@ const SimpleTable: FC<SimpleTableProps> = ({
enableClickToDeselect,
enableNonFolderIndent,
imgRatio,
expandAllForRow,
], // include enableClickToDeselect for completeness
)

Expand Down Expand Up @@ -592,6 +599,7 @@ const SimpleTable: FC<SimpleTableProps> = ({
key={row.id}
id={row.id}
{...pt?.row}
onContextMenu={onContextMenu}
style={{
transform: `translateY(${virtualRow.start}px)`, //this should always be a `style` as it changes on scroll
...pt?.row?.style, // custom styles to be passed
Expand Down
11 changes: 10 additions & 1 deletion shared/src/containers/SimpleTable/SimpleTableRowTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type RowExpanderProps = {
enableNonFolderIndent?: boolean
isTableExpandable?: boolean
onExpandClick?: () => void
onAltExpandClick?: () => void
}

export const RowExpander = ({
Expand All @@ -17,12 +18,17 @@ export const RowExpander = ({
enableNonFolderIndent = true,
isTableExpandable,
onExpandClick,
onAltExpandClick,
}: RowExpanderProps) =>
isRowExpandable ? (
<Styled.Expander
onClick={(e) => {
e.stopPropagation()
onExpandClick?.()
if (e.altKey) {
onAltExpandClick?.()
} else {
onExpandClick?.()
}
}}
icon={isRowExpanded ? 'expand_more' : 'chevron_right'}
className="expander"
Expand All @@ -47,6 +53,7 @@ export interface SimpleTableCellTemplateProps extends React.HTMLAttributes<HTMLD
isTableExpandable?: boolean
enableNonFolderIndent?: boolean
onExpandClick?: () => void
onAltExpandClick?: () => void
// when used as a template
startContent?: React.ReactNode
endContent?: React.ReactNode
Expand Down Expand Up @@ -78,6 +85,7 @@ export const SimpleTableCellTemplate = forwardRef<HTMLDivElement, SimpleTableCel
isTableExpandable,
enableNonFolderIndent = true,
onExpandClick,
onAltExpandClick,
startContent,
endContent,
depth = 0,
Expand Down Expand Up @@ -105,6 +113,7 @@ export const SimpleTableCellTemplate = forwardRef<HTMLDivElement, SimpleTableCel
isRowExpanded={isRowExpanded}
isTableExpandable={isTableExpandable}
onExpandClick={onExpandClick}
onAltExpandClick={onAltExpandClick}
enableNonFolderIndent={enableNonFolderIndent}
{...pt?.expander}
/>
Expand Down
Loading