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

feat: record group insert at bottom when created #9053

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

magrinj
Copy link
Member

@magrinj magrinj commented Dec 13, 2024

Fix #9050

When we add a new record in a record group this one should be added at them bottom.

@magrinj magrinj marked this pull request as ready for review December 13, 2024 11:46
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

This PR modifies record insertion behavior in record groups to add new records at the bottom of the visible page instead of the top, addressing issue #9050.

  • Modified position calculation in useUpsertTableRecordInGroup.ts to place new records after the last record with a +0.0001 position increment
  • Reordered components in RecordTableRecordGroupRows.tsx to place RecordTablePendingRecordGroupRow before load more section
  • Added support for 'first', 'last', and numeric positioning in triggerCreateRecordsOptimisticEffect.ts for flexible record insertion
  • Removed pending record check in RecordTableRecordGroupSectionAddNew.tsx to allow consecutive record additions
  • Fixed syntax error in graphql-query-create-one-resolver.service.ts by removing erroneous 'async;' line

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

@charlesBochet
Copy link
Member

charlesBochet commented Dec 13, 2024

@magrinj tested your PR, looks better and better!

Found a bug: if I have many pages, I add a record and then click on load more, my record is present twice
image

which makes sense! We should either:

  • update the cursor (containing the sorts + position) to take care of the new last position
  • update our pagination concatenation to remove duplicates (might be easier and more robust)

@magrinj magrinj merged commit 9e9c1bd into main Dec 16, 2024
19 checks passed
@magrinj magrinj deleted the feat/record-group-insert-record-bottom branch December 16, 2024 13:57
charlesBochet pushed a commit that referenced this pull request Dec 17, 2024
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.

Record group adding a new row should insert at the bottom
2 participants