Skip to content

Conversation

@konstantiniiv
Copy link
Collaborator

@konstantiniiv konstantiniiv commented Nov 24, 2025


  • I understand that contributing to this repository will require me to agree with the CLA

Description

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes drag-and-drop ID collision issues in widget sections by introducing composite keys that include section type information, ensuring uniqueness across different widget sections (PINNED, TYPES, etc.).

Key changes:

  • Introduced compositeKey() and extractWidgetId() extension functions to manage unique widget identifiers
  • Refactored duplicate gesture handling code into reusable ReorderableItemModifier and LongPressWithSlopDetector components
  • Added optimistic UI updates with rollback mechanism for type widget reordering

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
WidgetView.kt Added compositeKey() and extractWidgetId() extension functions with comprehensive documentation
WidgetViewExtensionTest.kt New test file with extensive coverage for the extension functions, including edge cases and roundtrip tests
ReorderableItemModifier.kt Extracted reusable modifier function for reorderable items, consolidating duplicate code
LongPressWithSlopDetector.kt Extracted custom drag gesture detector into standalone class for reusability
HomeScreenViewModel.kt Added optimistic updates and rollback logic for type widget reordering to improve UI responsiveness
WidgetsScreen.kt Updated to extract widget IDs from composite keys during drag operations
WidgetSection.kt Updated to use composite keys for LazyList items and replaced inline code with extracted reusable components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@konstantiniiv konstantiniiv changed the title Droid 4113 dnd ids fix DROID-4113 Widgets | Fixes drag-and-drop ID collision issues in widget sections Nov 24, 2025
@konstantiniiv konstantiniiv merged commit 076289e into main Nov 24, 2025
10 checks passed
@konstantiniiv konstantiniiv deleted the droid-4113-dnd-ids-fix branch November 24, 2025 13:01
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants