From 3bfe0c0b7d41b467ee572c155532fff858b92921 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Mon, 15 Jun 2026 02:02:38 +0100 Subject: [PATCH] feat(base): add focused-cell atom and cell coordinate types --- apps/client/src/ee/base/atoms/base-atoms.ts | 14 +++++++++++++- apps/client/src/ee/base/types/base.types.ts | 8 ++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/client/src/ee/base/atoms/base-atoms.ts b/apps/client/src/ee/base/atoms/base-atoms.ts index 213553fac..9404e0410 100644 --- a/apps/client/src/ee/base/atoms/base-atoms.ts +++ b/apps/client/src/ee/base/atoms/base-atoms.ts @@ -1,6 +1,6 @@ import { atom } from "jotai"; import { atomFamily } from "jotai/utils"; -import { EditingCell } from "@/ee/base/types/base.types"; +import { EditingCell, FocusedCell } from "@/ee/base/types/base.types"; // Atoms are scoped per-base via `pageId` so that two BaseTable instances on // the same page don't share UI state. @@ -41,3 +41,15 @@ export const selectedRowIdsAtomFamily = atomFamily((_pageId: string) => export const lastToggledRowIndexAtomFamily = atomFamily((_pageId: string) => atom(null), ); + +export const focusedCellAtomFamily = atomFamily((_pageId: string) => + atom(null), +); + +export type PendingTypeInsert = { + rowId: string; + propertyId: string; + char: string; +} | null; + +export const pendingTypeInsertAtom = atom(null); diff --git a/apps/client/src/ee/base/types/base.types.ts b/apps/client/src/ee/base/types/base.types.ts index f5efeca4b..444e401e3 100644 --- a/apps/client/src/ee/base/types/base.types.ts +++ b/apps/client/src/ee/base/types/base.types.ts @@ -251,10 +251,14 @@ export type IBase = { baseSchemaVersion: number; }; -export type EditingCell = { +export type CellCoord = { rowId: string; propertyId: string; -} | null; +}; + +export type EditingCell = CellCoord | null; + +export type FocusedCell = CellCoord | null; export type CreateBaseInput = { name: string;