Skip to content

Fix inconsistent vertical scrolling#85

Merged
Irineu333 merged 2 commits intodevelopfrom
bugfix/issue-15-inconsistent-vertical-scrolling-in-text
Nov 2, 2025
Merged

Fix inconsistent vertical scrolling#85
Irineu333 merged 2 commits intodevelopfrom
bugfix/issue-15-inconsistent-vertical-scrolling-in-text

Conversation

@Irineu333
Copy link
Owner

@Irineu333 Irineu333 commented Nov 1, 2025

Fixes #15

@Irineu333 Irineu333 self-assigned this Nov 1, 2025
@Irineu333 Irineu333 force-pushed the bugfix/issue-15-inconsistent-vertical-scrolling-in-text branch 2 times, most recently from 1f6fb77 to 0a7af6c Compare November 1, 2025 10:47
@Irineu333 Irineu333 force-pushed the bugfix/issue-15-inconsistent-vertical-scrolling-in-text branch from 0a7af6c to 761797e Compare November 1, 2025 11:00
@Irineu333 Irineu333 requested a review from Copilot November 1, 2025 13:59
Copy link

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 refactors the text sample management to use Compose's built-in TextFieldState instead of custom state management. The migration eliminates redundant state synchronization code and leverages Compose's native undo/redo functionality.

Key changes:

  • Replaced TextSampleRepository with SampleRepository using TextFieldState for text state management
  • Migrated TextEditor component to use TextFieldState directly instead of value/onChange pattern
  • Updated onTextLayout callback to work with TextFieldState2 API (receives lambda returning TextLayoutResult)

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
MatcherAction.kt Removed obsolete UpdateText action since state is now managed directly via TextFieldState
MatcherViewModel.kt Updated to use SampleRepository and expose sampleField instead of managing text updates via actions
MatcherScreen.kt Simplified TextEditor usage by passing TextFieldState directly instead of value/onChange callbacks
TextEditor.*.kt Migrated to TextFieldState parameter and updated onTextLayout to receive lambda for TextFieldState2 compatibility
SampleRepository.kt New interface exposing TextFieldState and flows for text/history instead of combined state flow
SampleRepositoryImpl.kt New implementation using TextFieldState with built-in undo/redo support
PatternStateRepository.kt Added cleanUpdate method and updated clear signature for consistency
SalvageManagerImpl.kt Updated to work with new repository interfaces and direct text access
Opened.kt Changed to accept CharSequence instead of SampleState for simplified comparison
Pattern.kt Updated sample field type to CharSequence for compatibility with TextFieldState
PatternsSqlDelightDataSource.kt Added .toString() conversion when persisting CharSequence to database
Inputs.kt Removed text field as it's no longer needed in the model
HistoryState.kt Added constructor accepting UndoState for compatibility with TextFieldState
TextLayoutResult.kt Added bounds checking to prevent index out of bounds errors

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

@Irineu333 Irineu333 force-pushed the bugfix/issue-15-inconsistent-vertical-scrolling-in-text branch 2 times, most recently from ccfdc14 to 0169e75 Compare November 2, 2025 03:21
@Irineu333 Irineu333 force-pushed the bugfix/issue-15-inconsistent-vertical-scrolling-in-text branch from 0169e75 to 97001a5 Compare November 2, 2025 04:02
@Irineu333 Irineu333 force-pushed the bugfix/issue-15-inconsistent-vertical-scrolling-in-text branch from 97001a5 to 4a7eca6 Compare November 2, 2025 04:05
@Irineu333 Irineu333 merged commit 8cb0090 into develop Nov 2, 2025
4 of 5 checks passed
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.

1 participant

Comments