Skip to content

connect domain use cases and implement reactive UI updates#48

Closed
IntFxZen wants to merge 3 commits intoembedded-dev-research:mainfrom
IntFxZen:ui-development-with-usecases
Closed

connect domain use cases and implement reactive UI updates#48
IntFxZen wants to merge 3 commits intoembedded-dev-research:mainfrom
IntFxZen:ui-development-with-usecases

Conversation

@IntFxZen
Copy link
Copy Markdown
Contributor

@IntFxZen IntFxZen commented Apr 6, 2026

Summary

  • Refactored the app presentation layer to use domain use cases through NotesViewModel (Koin-based injection), replacing local/fallback state handling with use-case-driven flows for directories and notes.

  • Implemented note deletion via left swipe in the notes list, wired end-to-end through UI events to DeleteNoteUseCase, and improved swipe UX (custom delete container, smoother visuals, progressive behavior, spacing polish).

  • Added directory management in UI: create directory from a top-bar dialog (via CreateFolderUseCase) and delete directory on long press with confirmation (via DeleteFolderUseCase), including guardrails for non-deletable system folder behavior.

  • Stabilized app-layer lifecycle/state handling (job cancellation, screen transitions, folder-id mapping for “All Notes”), and cleaned/modernized Koin module wiring for ViewModel + use cases.

  • Next steps: wire up counters and finish integrating the remaining use cases. Later: rework the UI.

Screenshot 1 Screenshot 2 Screenshot 3
ZF7XSMm7GZh3eMLCWc4Lu7lCWVLV3_SZL2ju9GhlBuiGu-E3Fp1awI7n1uMpHS31iebqQ3JSb2JQt07iaSAITBkB nGEn6uZErq5f_T3P-AyK0qeeWf-s1P4I5-nptBTzOpcgyam98MDaqU9GB-oqxxoeWl22Z0c9Q0qNVSTAxs2OBcJy Q8hnhWAF8l3NcSVlL0gA8ylyWTfOQQq4E0hevg982brxAi9UCjDUbIZ34Gd0c1NdBRT0JWN30cWNMXsPRTKr19oZ

Comment thread app/src/main/java/com/itlab/notes/ui/NotesViewModel.kt Fixed
Comment thread app/src/main/java/com/itlab/notes/ui/NotesViewModel.kt Fixed
@allnes
Copy link
Copy Markdown
Member

allnes commented Apr 9, 2026

I still have a few technical concerns before merge:

  • Saving a note from the “All Notes” screen looks risky, because the note is reconstructed from the current directory context. That seems to mean an existing note can lose its original folderId after save.
  • Deleting a directory does not seem to handle notes that still belong to that directory, so this may leave orphaned notes.
  • In the notes list, swipe-to-delete state is stored per row, but the list does not use stable item keys. That can lead to incorrect row state after deletion/recomposition.

Also, I think this PR would still be easier to review if it were split into a few smaller parts:

  1. app/bootstrap + DI wiring
  2. ViewModel / use-case integration
  3. UI interactions and UX changes (directory dialogs, swipe-to-delete, etc.)

@IntFxZen
Copy link
Copy Markdown
Contributor Author

IntFxZen commented Apr 9, 2026

Fixed all noted issues (folderId preservation, directory-note cleanup, stable keys for swipe rows).
Next PR will be smaller and split into focused parts for easier review.

@IntFxZen IntFxZen closed this Apr 11, 2026
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.

3 participants