{
- doToggleDirectoryExpansion(item.id, item.id)
- }}
+ onPress={toggleExpanded}
/>
- validation.DIRECTORY_NAME_REGEX.test(newTitle) &&
- backendModule.isNewTitleValid(
- item,
- newTitle,
- nodeMap.current.get(item.parentId)?.children?.map((child) => child.item),
- )
- }
+ checkSubmittable={checkSubmittable}
onSubmit={doRename}
- onCancel={() => {
- setIsEditing(false)
- }}
+ onCancel={onCancel}
>
{item.title}
diff --git a/app/gui/src/dashboard/components/dashboard/ProjectIcon.tsx b/app/gui/src/dashboard/components/dashboard/ProjectIcon.tsx
index 99db417b7e..ee6be4ac98 100644
--- a/app/gui/src/dashboard/components/dashboard/ProjectIcon.tsx
+++ b/app/gui/src/dashboard/components/dashboard/ProjectIcon.tsx
@@ -20,6 +20,7 @@ import * as backendModule from '#/services/Backend'
import { useBackendQuery } from '#/hooks/backendHooks'
import * as tailwindMerge from '#/utilities/tailwindMerge'
import { useMemo } from 'react'
+import { useEventCallback } from '#/hooks/eventCallbackHooks'
// =================
// === Constants ===
@@ -137,15 +138,15 @@ export default function ProjectIcon(props: ProjectIconProps) {
}
})()
- const doOpenProject = () => {
+ const doOpenProject = useEventCallback(() => {
openProject({ ...item, type: backend.type })
- }
- const doCloseProject = () => {
+ })
+ const doCloseProject = useEventCallback(() => {
closeProject({ ...item, type: backend.type })
- }
- const doOpenProjectTab = () => {
+ })
+ const doOpenProjectTab = useEventCallback(() => {
openProjectTab(item.id)
- }
+ })
switch (state) {
case backendModule.ProjectState.new:
diff --git a/app/gui/src/dashboard/components/dashboard/column/LabelsColumn.tsx b/app/gui/src/dashboard/components/dashboard/column/LabelsColumn.tsx
index 985a3d40e2..38791ab10d 100644
--- a/app/gui/src/dashboard/components/dashboard/column/LabelsColumn.tsx
+++ b/app/gui/src/dashboard/components/dashboard/column/LabelsColumn.tsx
@@ -20,6 +20,7 @@ import ManageLabelsModal from '#/modals/ManageLabelsModal'
import * as backendModule from '#/services/Backend'
+import { useEventCallback } from '#/hooks/eventCallbackHooks'
import * as permissions from '#/utilities/permissions'
// ====================
@@ -44,6 +45,12 @@ export default function LabelsColumn(props: column.AssetColumnProps) {
(self?.permission === permissions.PermissionAction.own ||
self?.permission === permissions.PermissionAction.admin)
+ const onPress = useEventCallback(() => {})
+
+ const renderManageLabelsModal = useEventCallback(() => (
+
+ ))
+
return (
{(item.labels ?? [])
@@ -93,7 +100,7 @@ export default function LabelsColumn(props: column.AssetColumnProps) {
isDisabled
key={label}
color={labelsByName.get(label)?.color ?? backendModule.COLORS[0]}
- onPress={() => {}}
+ onPress={onPress}
>
{label}
@@ -101,7 +108,7 @@ export default function LabelsColumn(props: column.AssetColumnProps) {
{managesThisAsset && (
-
+ {renderManageLabelsModal}
)}
diff --git a/app/gui/src/dashboard/layouts/AssetsTable.tsx b/app/gui/src/dashboard/layouts/AssetsTable.tsx
index 73eeed4cdf..d337ff8b11 100644
--- a/app/gui/src/dashboard/layouts/AssetsTable.tsx
+++ b/app/gui/src/dashboard/layouts/AssetsTable.tsx
@@ -2574,7 +2574,7 @@ export default function AssetsTable(props: AssetsTableProps) {
count: displayItems.length,
getScrollElement: () => rootRef.current,
estimateSize: () => ROW_HEIGHT_PX,
- overscan: 20,
+ overscan: 0,
})
const columns = useMemo(
@@ -2614,31 +2614,38 @@ export default function AssetsTable(props: AssetsTableProps) {
}
return (
-
item.item.id === id)}
- visibility={visibilities.get(item.key)}
- columns={columns}
- id={item.item.id}
- parentId={item.directoryId}
- path={item.path}
- initialAssetEvents={item.initialAssetEvents}
- depth={item.depth}
- state={state}
- hidden={hidden || visibilities.get(item.key) === Visibility.hidden}
- isKeyboardSelected={
- keyboardSelectedIndex != null && item === visibleItems[keyboardSelectedIndex]
- }
- grabKeyboardFocus={grabRowKeyboardFocus}
- onClick={onRowClick}
- select={selectRow}
- onDragStart={onRowDragStart}
- onDragOver={onRowDragOver}
- onDragEnd={onRowDragEnd}
- onDrop={onRowDrop}
- />
+
+ item.item.id === id)}
+ visibility={visibilities.get(item.key)}
+ columns={columns}
+ id={item.item.id}
+ parentId={item.directoryId}
+ path={item.path}
+ initialAssetEvents={item.initialAssetEvents}
+ depth={item.depth}
+ state={state}
+ hidden={hidden || visibilities.get(item.key) === Visibility.hidden}
+ isKeyboardSelected={
+ keyboardSelectedIndex != null && item === visibleItems[keyboardSelectedIndex]
+ }
+ grabKeyboardFocus={grabRowKeyboardFocus}
+ onClick={onRowClick}
+ select={selectRow}
+ onDragStart={onRowDragStart}
+ onDragOver={onRowDragOver}
+ onDragEnd={onRowDragEnd}
+ onDrop={onRowDrop}
+ />
+
)
})
@@ -2690,7 +2697,7 @@ export default function AssetsTable(props: AssetsTableProps) {
}}
>
- {headerRow}
+ {headerRow}
{itemRows}
@@ -2792,6 +2799,7 @@ export default function AssetsTable(props: AssetsTableProps) {
{...mergeProps()(innerProps, {
className: 'flex-1 overflow-auto container-size w-full h-full',
onKeyDown,
+ ref: rootRef,
onBlur: (event) => {
if (
event.relatedTarget instanceof HTMLElement &&