Commit Graph
10570 Commits
Author SHA1 Message Date
Abdul Rahman 2c7780e2c4 Refactor navigation components to enhance drag-and-drop functionality and improve code clarity. This update introduces a new preload mechanism for the drag-and-drop kit, replaces the WorkspaceDndKitPreloadEffect with direct preloading in PageDragDropProvider, and adds read-only components for better rendering in edit mode. Additionally, it consolidates logic in NavigationDrawerSection components and introduces new skeleton loaders for improved user experience during loading states. 2026-03-03 02:54:35 +05:30
Abdul Rahman 8167b68626 Remove WorkspaceDndKitDraggableItem component to streamline drag-and-drop functionality. This deletion enhances code clarity and maintainability by eliminating unused components, contributing to a cleaner codebase. 2026-03-03 01:08:44 +05:30
Abdul Rahman 584e06d0b6 Introduce WorkspaceDndKitPreloadEffect to preload drag-and-drop kit and refactor PageDragDropProvider for improved structure. This change enhances the component's rendering logic by integrating the preload effect, ensuring better performance and maintainability in drag-and-drop functionality. 2026-03-02 15:53:05 +05:30
Abdul Rahman dce9c281ee Refactor WorkspaceDndKitProvider to improve type safety and streamline drag-and-drop event handling. This update introduces new type definitions for drag start, drag over, and drag end events, enhancing clarity and maintainability while ensuring better integration with the drag-and-drop logic. 2026-03-02 15:49:15 +05:30
Abdul Rahman 93640eef04 Add EditModeProps and refactor component imports for improved type management
This commit introduces the EditModeProps type to enhance type safety in edit mode handling. Additionally, it updates component imports in NavigationDrawerSectionForWorkspaceItemContent, NavigationDrawerSectionForWorkspaceItems, and NavigationDrawerSectionForWorkspaceItemsListDndKit to utilize the new type definitions, improving clarity and maintainability across the object metadata module.
2026-03-02 15:36:23 +05:30
Abdul Rahman 46ee272bdd Refactor navigation components to remove unused onAddMenuItem prop and streamline add menu item functionality. This change enhances clarity and maintainability by consolidating logic and improving the drag-and-drop experience in the workspace navigation. 2026-03-02 15:31:33 +05:30
Abdul Rahman 806d72e2b4 Refactor NavigationDrawerSection components to improve clarity and maintainability by removing unused props and consolidating logic. This change enhances the drag-and-drop functionality and streamlines the rendering of workspace items, ensuring a cleaner code structure. 2026-03-02 15:25:13 +05:30
Abdul Rahman 3215a7b9e6 Refactor WorkspaceDndKitProvider to remove FavoritesDragContext and streamline the rendering logic of drag-and-drop components. This change enhances code clarity and maintainability by consolidating context providers and improving the overall structure of the component. 2026-03-02 15:22:13 +05:30
Abdul Rahman 0015085fd5 Refactor WorkspaceDndKitProvider to improve drag-and-drop logic by consolidating condition checks and enhancing readability. This change streamlines the handling of sortable and droppable elements, ensuring clearer flow and better maintainability of the component's drag-and-drop functionality. 2026-03-02 15:13:15 +05:30
Abdul Rahman 8e3f9283b9 Refactor WorkspaceDndKitProvider to enhance drag-and-drop event handling by introducing new type definitions for drag operations. This change improves code clarity and maintainability, streamlining the handling of drag events and ensuring better type safety throughout the component. 2026-03-02 15:10:53 +05:30
Abdul Rahman 9951aa3202 Refactor WorkspaceDndKitProvider to improve drag-and-drop logic by introducing a DropDestination type and consolidating drop result options. This change enhances code clarity and maintainability while streamlining sensor configuration and event handling. 2026-03-02 15:03:41 +05:30
Abdul Rahman 4c4d755daf Refactor PageDragDropProvider and CurrentWorkspaceMemberNavigationMenuItemFoldersDispatcher to streamline drag-and-drop logic. Removed unnecessary feature flag checks and consolidated rendering logic, enhancing clarity and maintaining consistent behavior across components. 2026-03-02 14:48:31 +05:30
Abdul Rahman 6ad6cc8e69 Refactor useHandleWorkspaceNavigationMenuItemDragAndDrop to extract getPositionBetween utility function for improved clarity and reusability. This change enhances the drag-and-drop logic by centralizing position calculation, streamlining the component's code. 2026-03-02 14:37:15 +05:30
Abdul Rahman 1b5b2f7fc4 Enhance MainNavigationDrawerScrollableItems by adding Suspense for lazy-loaded components. This change improves loading behavior and user experience by providing a fallback during component loading. 2026-03-02 14:31:48 +05:30
Abdul Rahman f78454b6b0 Refactor navigation components to enhance drag-and-drop functionality by removing the WorkspaceDndKitContext dependency and consolidating the rendering logic. This change improves clarity and maintains consistency in edit mode handling across components, while also deleting the unused NavigationDrawerSectionForWorkspaceItemsListHelloPangea component. 2026-03-02 07:32:17 +05:30
Abdul Rahman 622c89d3a9 Refactor WorkspaceNavigationMenuItemFolderSubItem to improve edit mode handling by introducing isEditableInEditMode variable. This change enhances clarity in the component's logic and maintains consistency with the existing state management approach. 2026-03-02 07:21:15 +05:30
Abdul Rahman 00f2e56925 Refactor navigation menu components to streamline state management by removing objectMetadataItems and views props. Introduced local state retrieval for object metadata and core views, enhancing code clarity and reducing prop drilling across components. 2026-03-02 07:19:12 +05:30
Abdul Rahman cfec6c8e26 Refactor navigation menu components to utilize isNavigationMenuInEditMode state for improved edit mode handling. This change enhances code clarity and consistency across various components by replacing direct isEditMode props with the new state management approach. 2026-03-02 07:15:03 +05:30
Abdul Rahman d6e9e0ca9d Remove useDndKit prop from WorkspaceSectionItemContent and related components to simplify the API and improve clarity in drag-and-drop functionality. 2026-03-02 07:03:33 +05:30
Abdul Rahman 7916f58fe9 Add WorkspaceNavigationMenuItemFolderSubItem component to enhance navigation menu structure. This new component encapsulates the logic for rendering sub-items in the workspace navigation menu, improving code organization and maintainability. 2026-03-02 07:03:14 +05:30
Abdul Rahman b57c6cf7a4 Refactor useHandleWorkspaceNavigationMenuItemDragAndDrop to improve drag-and-drop logic by introducing a new function for calculating item positions. This change enhances the clarity and maintainability of the code while ensuring accurate position updates during item reordering. 2026-03-02 06:56:49 +05:30
Abdul Rahman 1bd326eefe Refactor WorkspaceDndKitDroppableSlot to simplify the component structure by introducing a new variable, isEmpty, for determining the empty state. This change enhances readability and maintains consistency in drag-and-drop functionality. 2026-03-02 06:44:07 +05:30
Abdul Rahman cabb5950af Remove unused isInsideScrollableContainer prop from WorkspaceDndKitDraggableItem component to simplify the code and improve clarity in drag-and-drop functionality. 2026-03-02 06:40:39 +05:30
Abdul Rahman ef4a5ab345 Refactor CommandMenuItemWithAddToNavigationDrag to simplify drag-and-drop logic by removing the dependency on DnD Kit context. Enhanced conditional rendering to improve component structure and user experience when drag index is not defined. 2026-03-02 06:34:20 +05:30
Abdul Rahman b44fe87117 Refactor CommandMenuAddToNavDroppable to simplify drag-and-drop implementation by removing the conditional rendering for DnD Kit. Introduced a fallback provided object to enhance the suspense fallback behavior, improving the overall component structure and user experience. 2026-03-02 06:27:19 +05:30
Abdul Rahman 5e565feef1 Remove CommandMenuAddToNavDraggablePlaceholder component and update references in CommandMenuNewSidebarItemMainMenu and CommandMenuObjectPickerSubView to streamline drag-and-drop functionality. This change simplifies the component structure by eliminating unnecessary placeholders. 2026-03-02 06:19:19 +05:30
Abdul Rahman 4c22c47f6b Refactor CommandMenuAddToNavDroppable and CommandMenuAddToNavDroppableDndKit to use AddToNavDroppableProvided type for improved type safety. Update drop target properties to enhance drag-and-drop functionality consistency across components. Remove unused NavigationDrawerSectionForWorkspaceItemsShared file. 2026-03-02 06:07:51 +05:30
Abdul Rahman 682a7123e1 Refactor WorkspaceSectionListDndKit to utilize WorkspaceOrphanDropTarget for improved structure and readability. Update drop target IDs to use NavigationMenuItemDroppableIds for consistency across components. 2026-03-02 05:52:18 +05:30
Abdul Rahman 20b8153c57 Refactor WorkspaceDndKitProvider to improve readability by introducing a new variable, isAddToNavDrag, for checking drag source. This change enhances the clarity of conditional checks related to drag-and-drop functionality. 2026-03-02 05:48:05 +05:30
Abdul Rahman c2cbfaa73d Refactor CommandMenuSystemObjectPickerSubView to enhance drag-and-drop functionality. Introduced conditional rendering for add variant using CommandMenuAddToNavDroppable, improving user experience when adding system objects to navigation. 2026-03-02 05:41:17 +05:30
Abdul Rahman ab9dfccc35 Enhance drag-and-drop functionality in WorkspaceDndKitProvider and NavigationDrawerSection components by conditionally setting active and forbidden drop targets based on the source droppable ID. Refactor WorkspaceSectionListDndKit to utilize NavigationItemDropTarget for improved structure and readability. 2026-03-02 05:37:36 +05:30
Abdul Rahman 0c14801175 Refactor NavigationDrawerSection components to remove unused theme prop and update prop types for DnD Kit and Hello Pangea sections. 2026-03-01 03:26:59 +05:30
Abdul Rahman 129d429006 Remove unused theme prop from WorkspaceSectionItemContentProps and WorkspaceSectionListCommonProps in NavigationDrawerSectionForWorkspaceItemsTypes. 2026-03-01 03:22:59 +05:30
Abdul Rahman c5d216d69b Refactor NavigationDrawerSectionForWorkspaceItemContent to use getEffectiveNavigationMenuItemColor for icon color and pass folder color directly. Removed unused theme prop. 2026-03-01 03:22:49 +05:30
Abdul Rahman 05a2a1db20 Merge branch 'main' into dnd-kit-navbar-drag-drop 2026-03-01 01:59:45 +05:30
Charles BochetandGitHub 159bb9d70a A few fixes on table performance (#18304)
## RecordTable Performance Investigation & Optimization (WIP)

Investigates what makes the RecordTable slow (14 components, ~12 hooks
per cell) and starts applying fixes.

### Key Findings (2,000 cells benchmark)

![Cell Render
Benchmark](https://github.com/twentyhq/twenty/blob/table-perf/packages/twenty-front/src/modules/object-record/record-table/__perf__/cell-render-benchmark.png?raw=true)

![State Access
Benchmark](https://github.com/twentyhq/twenty/blob/table-perf/packages/twenty-front/src/modules/object-record/record-table/__perf__/state-access-benchmark.png?raw=true)

- **Jotai atoms are the dominant cost**: 10 atom reads/cell = +312%.
Full sim with atoms = +476%.
- **Derived atoms are 3x cheaper** than individual reads (12 sources:
+93% vs +294%).
- **Component depth is expensive**: 4-level nesting = +82%, 14 wrappers
= +109%.
- **Styling engines are comparable**: Linaria vs Emotion is within
noise.
- **Context reads and useState are nearly free** vs baseline.

### Optimizations Applied

1. **Static focus providers** — replaced per-cell `useState(false)` with
static context. Eliminates 400 useState instances.
2. **Delegated onMouseMove** — single handler on table body instead of
400 per-cell handlers.
3. **Hoisted `useObjectMetadataItems()`** — moved from per-cell to
table-level context. Eliminates 400 global atom reads.

### Tooling

- Perf page at `/__perf__/table`: 17 cell render + 13 state access
benchmarks
- Render profiler: `window.__RECORD_TABLE_PROFILE = true`
- Full plan in `__perf__/PERFORMANCE_PLAN.md`

### Remaining Phases (not high priority to-be-honest)

| Phase | What | Status |
|-------|------|--------|
| 1 | Separate display from interaction | Partial |
| 2 | Flatten hierarchy (14 → ~5 components/cell) | TODO |
| 3 | Reduce atom reads per cell | Partial |
| 4 | CSS-only hover/focus | TODO |
| 5 | Event delegation, lazy Draggable | TODO |
2026-02-28 15:12:44 +01:00
b341704a0e i18n - translations (#18306)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2026-02-28 14:24:11 +01:00
d5d0f5d994 i18n - translations (#18302)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2026-02-28 14:11:52 +01:00
Félix MalfaitGitHubclaude[bot] <41898282+claude[bot]@users.noreply.github.com>
012d819557 OAuth Client — Unified ApplicationRegistration, OAuth server, and frontend (#18267)
## Summary

Consolidates three separate PRs (#18260, #18261, #18262) into a single
unified branch with all review feedback addressed:

### New features
- **ApplicationRegistration entity** — server-level registration for
OAuth apps with encrypted server variables
- **OAuth 2.0 server** — authorization code, client credentials, refresh
token grants with PKCE support
- **OAuth discovery endpoint** —
`.well-known/oauth-authorization-server` metadata
- **Frontend UI** — app registration details page with credential
management, redirect URI editing, and server variable configuration
- **CLI integration** — `twenty dev` auto-registers apps and stores
OAuth credentials locally
- **Authorize consent screen** — OAuth consent page at `/authorize`
showing requested scopes

### Review feedback addressed

**Renames (PR #18260):**
- `appRegistration` → `applicationRegistration` (entity, tables, files,
imports, GraphQL types)
- `appRegistrationVariable` → `applicationRegistrationVariable`
- `clientId` → `oAuthClientId`, `clientSecretHash` →
`oAuthClientSecretHash`, `redirectUris` → `oAuthRedirectUris`, `scopes`
→ `oAuthScopes`

**Security fixes (PR #18261):**
- Fixed redirect URI validation bypass when `oAuthRedirectUris` is an
empty array
- Fixed workspace isolation in `clientCredentialsGrant` — now uses
`find()` with explicit handling for multiple installations
- Added error logging in refresh token `catch` block instead of silently
swallowing

**Code quality (PR #18262):**
- Split `VersionDistributionEntry` into its own file (one export per
file)
- Split GraphQL queries and mutations into individual files with a
shared fragment
- Removed unused `OAuth` entry from `AuthProviderEnum`
- Added loading state to `handleRotateSecret`
- Removed 27 narration-style comments from test files
- Added proper guards (`PublicEndpointGuard`, `NoPermissionGuard`) to
controllers and resolvers

## Test plan

- [ ] Verify `twenty dev` registers an app and stores OAuth credentials
- [ ] Test OAuth authorization code flow end-to-end (authorize → token →
API call)
- [ ] Test client credentials grant
- [ ] Verify redirect URI validation rejects requests when no URIs are
registered
- [ ] Verify app registration detail page renders correctly
- [ ] Test secret rotation with loading state
- [ ] Verify server variable editing and saving
- [ ] Run `npx nx database:reset twenty-server` to validate migration

Closes #18260, #18261, #18262


Made with [Cursor](https://cursor.com)

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
2026-02-28 14:07:49 +01:00
Abdul RahmanGitHubCopilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>DevessierCharles Bochet
9fe2a07c55 Navbar customization v2 (#18026)
Adds color support for navigation menu items.

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Devessier <baptiste@devessier.fr>
Co-authored-by: Charles Bochet <charles@twenty.com>
2026-02-28 11:48:28 +01:00
63f17eec2c i18n - translations (#18300)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2026-02-27 23:43:42 +01:00
e806d36099 Navbar with AI chats (#18161)
## Summary
Add Home/Chat tabs and a dedicated threads list in the navigation
drawer.

## Changes
- **Navbar tabs:** Tabs in the drawer to switch between Home and Chat
(with “New chat” button). Shown on desktop when expanded and on mobile
below the workspace selector.
- **Navbar threads list:** New `NavigationDrawerAIChatThreadsList` for
the Chat tab with date groups (Today / Yesterday / Older), thread rows
as `NavigationDrawerItem` (IconComment, title, timestamp). Shared
`useAIChatThreadClick` hook used by navbar and command menu; navbar
passes `resetNavigationStack: true`.
- **NavigationDrawerItem:** New `alwaysShowRightOptions` prop so the
timestamp is always visible (no hover-only).

---------

Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2026-02-27 23:37:14 +01:00
9f5a8735c9 i18n - docs translations (#18280)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2026-02-27 23:12:39 +01:00
c0e6aa1c0b i18n - translations (#18295)
Created by Github action

---------

Co-authored-by: github-actions <github-actions@twenty.com>
2026-02-27 23:12:15 +01:00
Charles BochetandGitHub 9342b16aad Fix more tests 2 (#18293)
## Summary
- Migrate more hand-written test mocks to auto-generated data from a
real Twenty instance
- Add generators for views, billing plans, API keys; extend record
generator for workspace members, favorites, connected accounts, calendar
events
- Remove 9 hand-written mock files replaced by generated equivalents
- Update 16 test/story files to use generated data
- Fix WorkflowEditActionEmailBase story assertion to match configured
recipient email

## Test plan
- [x] Lint, typecheck, unit tests pass
- [ ] Storybook tests pass in CI
2026-02-27 23:11:56 +01:00
Baptiste DevessierandGitHub cfad24da48 Fix empty user id clickhouse (#18238)
- Fixes:
- Make Workspace User select work; previously, it didn't work as we were
not fetching the workspace users correctly
  - Send Object Events with valid record id and object id

## Audit logs demo


https://github.com/user-attachments/assets/92437037-d253-4810-a138-7c709550755d
2026-02-27 16:58:44 +01:00
Charles BochetandGitHub 86fbf69e95 Fix more tests (#18287)
Improve mock in front tests
2026-02-27 14:06:18 +01:00
9667b3f369 i18n - translations (#18291)
Created by Github action

Co-authored-by: github-actions <github-actions@twenty.com>
2026-02-27 14:05:24 +01:00
Abdullah.andGitHub 76c7639eb3 fix: upgrade storybook to latest to resolve dependabot alert (#18285)
Resolves [Dependabot Alert
509](https://github.com/twentyhq/twenty/security/dependabot/509).

Upgraded storybook and related packages to latest, also fixed a failing
test to match what the DOM really contains.
2026-02-27 10:58:54 +01:00
Abdullah.andGitHub 4ed09a3feb Upgrade blocknote dependencies from 0.31.1 to 0.47.0. (#18207)
This PR pgrades all BlockNote packages (@blocknote/core,
@blocknote/react, @blocknote/mantine, @blocknote/server-util,
@blocknote/xl-docx-exporter, @blocknote/xl-pdf-exporter) to 0.47.0 and
adapts the codebase to the new API.

### Changes
- Dependency upgrades: Bumped all BlockNote packages to 0.47.0, added
required Mantine v8 peer dependencies, removed unnecessary prosemirror
resolutions
- Formatting toolbar: Replaced the manual reimplementation of
FormattingToolbarController (which handled visibility, positioning,
portal rendering, text-alignment-based placement, and a
dangerouslySetInnerHTML transition trick) with BlockNote's built-in
FormattingToolbarController. The toolbar buttons themselves are
unchanged.
- Side menu: Replaced manual drag handle menu positioning and rendering
(DashboardBlockDragHandleMenu, DashboardBlockColorPicker, and their
floating configs) with BlockNote's built-in SideMenuController,
DragHandleButton, and DragHandleMenu components. Deleted 4 files that
became dead code.
- Extension API migration: Replaced deprecated editor.suggestionMenus
and editor.formattingToolbar APIs with the new extension system
(SuggestionMenu, useExtensionState, editor.getExtension())
- Slash menu fixes: Filtered out BlockNote's new default "File" item
(added in 0.47) to avoid duplicates with our custom one; added icon
mappings for new block types (Toggle List, Divider, Toggle Headings,
Headings 4-6)
- Server-side: Switched @blocknote/server-util to dynamic import() to
handle ESM-only transitive dependencies in CJS context
2026-02-27 09:16:49 +01:00