Skip to content
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

fix: 3 first columns should be sticky view group #9123

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

magrinj
Copy link
Member

@magrinj magrinj commented Dec 18, 2024

Fix #9113

Screenshot 2024-12-18 at 3 33 05 PM Screenshot 2024-12-18 at 3 34 37 PM

@magrinj magrinj marked this pull request as ready for review December 18, 2024 14:35
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Fixed sticky column behavior in RecordTable components when view groups are enabled, ensuring proper rendering of the first three columns.

  • Modified RecordTableActionRow.tsx to split single colspan cell into individual cells for sticky columns
  • Updated RecordTableRecordGroupSection.tsx to remove colspan and add StyledEmptyTd for proper space handling
  • Changed RecordTableBodyDroppable.tsx to use static 'record-table-body' ID for consistent rendering
  • Aligned table structure across components to maintain sticky behavior for first three columns

3 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +71 to 73
<StyledEmptyTd colSpan={visibleTableColumns.length - 1} />
<StyledEmptyTd />
<StyledEmptyTd />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Three empty cells at the end may cause layout issues if table structure changes. Consider making this more dynamic based on table configuration.

@@ -23,7 +23,7 @@ export const RecordTableBodyDroppable = ({
>
{(provided) => (
<RecordTableBody
id={`record-table-body${recordGroupId ? `-${recordGroupId}` : ''}`}
id="record-table-body"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: removing recordGroupId from ID could cause duplicate IDs if multiple record tables exist on same page

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious to understand why this is not problematic indeed?

@@ -108,6 +108,7 @@ export const RecordTableRecordGroupSection = () => {
/>
<StyledTotalRow>{recordIdsByGroup.length}</StyledTotalRow>
</StyledRecordGroupSection>
<StyledEmptyTd colSpan={visibleColumns.length - 1} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: colSpan calculation could underflow if visibleColumns.length is 0 or 1

@@ -23,7 +23,7 @@ export const RecordTableBodyDroppable = ({
>
{(provided) => (
<RecordTableBody
id={`record-table-body${recordGroupId ? `-${recordGroupId}` : ''}`}
id="record-table-body"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious to understand why this is not problematic indeed?

@magrinj magrinj merged commit 01fc70d into main Dec 18, 2024
22 checks passed
@magrinj magrinj deleted the fix/view-group-sticky-columns branch December 18, 2024 15:35
@magrinj
Copy link
Member Author

magrinj commented Dec 18, 2024

@ijreilly record-table-body is the id, and the sticky column effect is based on the effect.
I've added the recordGroupId in the if of the tbody but it's not really needed and it's going to add more complexity on the sticky effect.
Thanks for the review ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

View group sticky column not rendered properly
2 participants