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: Optimistically render when drag-and-dropping event #209

Merged

Conversation

that-one-arab
Copy link
Contributor

Fixes issue

In this commit, whenever we drag and drop a someday event to the grid, we now handle:

  • Optimistically removing the someday event from the sidebar
  • Optimistically inserting the grid event

We also error handle the optimistic flow and revert if needed

Peek.2024-12-31.07-50.webm

Copy link
Contributor

@tyler-dane tyler-dane left a comment

Choose a reason for hiding this comment

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

This approach is looking good. I started a little cleanup to make the saga easier to understand. I'll continue the cleanup and merge after QAing a little more.

Can you plz start on #207 next?

that-one-arab and others added 2 commits January 1, 2025 08:12
Fixes [issue](SwitchbackTech#203)

In this commit, whenever we drag and drop a someday event to the grid, we now handle:
- Optimistically removing the someday event from the sidebar
- Optimistically inserting the grid event

We also error handle the optimistic flow and revert if needed
'order' and 'recurrence' aren't currently needed for a grid event
@tyler-dane tyler-dane force-pushed the fix_dnd_sidebar_event_to_grid branch from c435313 to 56b83f8 Compare January 1, 2025 15:11
@tyler-dane tyler-dane force-pushed the fix_dnd_sidebar_event_to_grid branch from a809445 to 543cc01 Compare January 3, 2025 12:24
@tyler-dane
Copy link
Contributor

Nice work, @that-one-arab!

You'll notice that my commits don't sneak in any extra functionality. I also didn't go overboard and try to clean up things in parts of the codebase that don't relate to this issue. Instead, I refactored the files that already changed to improve readability and testability.

This is the "clean up as we go" strategy I'd like us to take whenever possible. This will help us improve code stability, make the codebase more approachable, and make it easier to refactor (eg when we replace Redux Saga)... all while avoiding massive PRs that slow progress.

@tyler-dane tyler-dane merged commit 1423ed4 into SwitchbackTech:main Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimistically render when drag-and-dropping event
2 participants