-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Fix: Match cell editor width to column width #15162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Modified RecordTableCellEditMode to use column-specific CSS variables for cell editor width - Created StyledOverlayContainer that dynamically sets width based on column index - Cell editors now match the width of their corresponding table columns Fixes twentyhq#14599
- Added missing import for isDefined utility function - Fixes TypeScript compilation errors in CI Fixes twentyhq#15156
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
{"summary": "### Grept
Sequence Diagram
sequenceDiagram
participant User
participant RecordTableCellEditMode
participant useRecoilComponentValue
participant useAvailableComponentInstanceIdOrThrow
participant useSetRecoilComponentState
participant useFloating
participant useIsFieldInputOnly
participant RecordTableCellContext
participant useFocusRecordTableCell
participant StyledOverlayContainer
participant StyledInputModeOnlyContainer
User->>RecordTableCellEditMode: "Click to edit cell"
RecordTableCellEditMode->>useRecoilComponentValue: "Get field error state"
useRecoilComponentValue-->>RecordTableCellEditMode: "Return isFieldInError"
RecordTableCellEditMode->>useAvailableComponentInstanceIdOrThrow: "Get component instance ID"
useAvailableComponentInstanceIdOrThrow-->>RecordTableCellEditMode: "Return recordFieldComponentInstanceId"
RecordTableCellEditMode->>useSetRecoilComponentState: "Initialize layout direction state"
useSetRecoilComponentState-->>RecordTableCellEditMode: "Return setFieldInputLayoutDirection"
RecordTableCellEditMode->>useSetRecoilComponentState: "Initialize layout direction loading state"
useSetRecoilComponentState-->>RecordTableCellEditMode: "Return setFieldInputLayoutDirectionLoading"
RecordTableCellEditMode->>useFloating: "Setup floating positioning with middleware"
useFloating-->>RecordTableCellEditMode: "Return refs and floatingStyles"
RecordTableCellEditMode->>useIsFieldInputOnly: "Check if field input only mode"
useIsFieldInputOnly-->>RecordTableCellEditMode: "Return isFieldInputOnly boolean"
RecordTableCellEditMode->>RecordTableCellContext: "Get cell position context"
RecordTableCellContext-->>RecordTableCellEditMode: "Return cellPosition"
RecordTableCellEditMode->>useFocusRecordTableCell: "Get focus cell function"
useFocusRecordTableCell-->>RecordTableCellEditMode: "Return focusRecordTableCell"
alt isFieldInputOnly is true
RecordTableCellEditMode->>StyledInputModeOnlyContainer: "Render input-only container"
User->>StyledInputModeOnlyContainer: "Click container"
StyledInputModeOnlyContainer->>useFocusRecordTableCell: "Focus cell with position"
StyledInputModeOnlyContainer-->>RecordTableCellEditMode: "Render children"
else isFieldInputOnly is false
RecordTableCellEditMode->>StyledOverlayContainer: "Render overlay with column width"
Note over StyledOverlayContainer: "Uses CSS variable for column width based on cellPosition.column"
StyledOverlayContainer-->>RecordTableCellEditMode: "Render children with proper width"
end
RecordTableCellEditMode-->>User: "Display edit mode with proper width"
2 files reviewed, 1 comment
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue'; | ||
import { useContext } from 'react'; | ||
import { useRecoilCallback, useRecoilValue } from 'recoil'; | ||
import { isDefined } from 'twenty-shared/utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: This import is unused and should be removed
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/twenty-front/src/modules/action-menu/hooks/useShouldActionBeRegisteredParams.ts
Line: 19:19
Comment:
**style:** This import is unused and should be removed
How can I resolve this? If you propose a fix, please make it concise.
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:29577 This environment will automatically shut down when the PR is closed or after 5 hours. |
Issue
When a cell is opened for editing, the popup cell editor has a pre-specified width that doesn't match the width of the corresponding column that triggered the cell editor to emerge.
Root Cause
The
OverlayContainer
in RecordTableCellEditMode was using its default width instead of matching the column width.Solution
Modified RecordTableCellEditMode to:
StyledOverlayContainer
that extendsOverlayContainer
with dynamic width--record-table-column-field-{columnIndex}
to set width based on column indexcellPosition.column
ascolumnIndex
propTechnical Details
cellPosition.column
fromRecordTableCellContext
Testing
Expected Behavior
The cell editor width now dynamically matches the width of the column that triggered it, providing a consistent and intuitive user experience.
Fixes #14599