Skip to content

refactor: migrate to solid_lints 1.0.0-dev.1 plugin and fix lints - #102

Open
andrew-bekhiet-solid wants to merge 5 commits into
mainfrom
use-latest-solid-lints
Open

refactor: migrate to solid_lints 1.0.0-dev.1 plugin and fix lints#102
andrew-bekhiet-solid wants to merge 5 commits into
mainfrom
use-latest-solid-lints

Conversation

@andrew-bekhiet-solid

@andrew-bekhiet-solid andrew-bekhiet-solid commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

refactor: reduce cyclomatic complexity of some methods
refactor: reduce numbers of parameters by extracting a class
docs: update changelog

Summary by CodeRabbit

  • New Features
    • Unified mistake highlight colors via a single configuration.
    • Added customizable mistake popup styling (size, spacing, suggestion button).
    • Exposed match location details (offset, length, sentence) in the public API.
  • Bug Fixes
    • Fixed mistake selection/positioning in scrolled multiline fields (correct axis handling for scroll offset).
  • Documentation
    • Updated breaking-change notes and versioning for the new colors, match-location, and popup-style APIs.
  • Chores
    • Improved CI formatting/static analysis steps and updated the linter configuration.

refactor: reduce cyclomatic complexity of some methods
refactor: reduce numbers of parameters by extracting a class
docs: update changelog
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 66909b2f-cb2f-4a11-8794-22fdabda88d3

📥 Commits

Reviewing files that changed from the base of the PR and between 9b2b874 and 7553d62.

📒 Files selected for processing (1)
  • lib/src/presentation/language_tool_text_field.dart

📝 Walkthrough

Walkthrough

The change groups match location, mistake colors, and popup styling into public configuration models, updates parsing and rendering integrations, moves the example UI into a separate app file, and migrates lint checks from custom_lint to solid_lints.

Changes

Model and UI configuration refactor

Layer / File(s) Summary
Grouped public models and exports
lib/src/core/model/*, lib/src/domain/*, lib/languagetool_textfield.dart, CHANGELOG.md
MatchLocation, MistakeColors, and MistakePopupStyle are introduced and exported; Match and HighlightStyle use the grouped models.
Client and controller integration
lib/src/client/language_tool_client.dart, lib/src/core/controllers/language_tool_controller.dart, lib/src/presentation/language_tool_text_field.dart
Parsed match offsets use MatchLocation, highlight colors resolve through MistakeColors, and text offset calculation accounts for scroll direction.
Popup and text-field styling integration
lib/src/utils/mistake_popup.dart, lib/src/presentation/language_tool_text_field.dart
Popup sizing, margins, height limits, and suggestion button styling use MistakePopupStyle; text-field color access and scroll tracking are updated.
Example application and lint migration
example/lib/*, analysis_options.yaml, example/analysis_options.yaml, pubspec.yaml, example/pubspec.yaml, .github/workflows/code_check.yaml
The example UI is separated from its entry point, dictionary management is retained in App, and lint dependencies and CI checks are migrated to solid_lints and dart analyze.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant LanguageToolTextField
  participant LanguageToolController
  participant LanguageToolService
  App->>LanguageToolTextField: provide text field and mistake popup
  LanguageToolTextField->>LanguageToolController: submit edited text
  LanguageToolController->>LanguageToolService: request throttled spell check
  LanguageToolService-->>LanguageToolController: return detected mistakes
  LanguageToolController-->>LanguageToolTextField: render highlighted mistakes
  LanguageToolTextField-->>App: add ignored word and recheck text
Loading

Suggested reviewers: solid-danylosafonov, danylo-safonov-solid

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: migrating to solid_lints 1.0.0-dev.1 and addressing lint issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch use-latest-solid-lints

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/src/core/controllers/language_tool_controller.dart`:
- Around line 486-493: Update the layout and offset handling around TextPainter
in the relevant controller method: keep maxWidth constrained to textFieldWidth
for vertically scrolled multiline text, and apply scrollOffset to dy. Use
unbounded width with dx adjustment only for horizontal single-line scrolling,
preserving wrapped text alignment and correct popup selection after vertical
scrolling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 678e4175-1cfa-4d2e-90b2-8f59a5e769bb

📥 Commits

Reviewing files that changed from the base of the PR and between 41971cf and 8dfd518.

📒 Files selected for processing (18)
  • .github/workflows/code_check.yaml
  • CHANGELOG.md
  • analysis_options.yaml
  • example/analysis_options.yaml
  • example/lib/app.dart
  • example/lib/main.dart
  • example/pubspec.yaml
  • lib/languagetool_textfield.dart
  • lib/src/client/language_tool_client.dart
  • lib/src/core/controllers/language_tool_controller.dart
  • lib/src/core/model/match.dart
  • lib/src/core/model/match_location.dart
  • lib/src/domain/highlight_style.dart
  • lib/src/domain/mistake_colors.dart
  • lib/src/domain/mistake_popup_style.dart
  • lib/src/presentation/language_tool_text_field.dart
  • lib/src/utils/mistake_popup.dart
  • pubspec.yaml

Comment thread lib/src/core/controllers/language_tool_controller.dart

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/src/presentation/language_tool_text_field.dart`:
- Around line 220-222: Update _textControllerListener registration so it also
listens to _scrollController scroll events, ensuring scrollOffset and scrollAxis
stay current during scrolling; remove the same listener from _scrollController
in dispose() while preserving the existing controller listener cleanup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb9effb1-2a1e-434e-b020-bb74c714774b

📥 Commits

Reviewing files that changed from the base of the PR and between 8dfd518 and f3e79ac.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • lib/src/core/controllers/language_tool_controller.dart
  • lib/src/presentation/language_tool_text_field.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md

Comment thread lib/src/presentation/language_tool_text_field.dart
Comment thread CHANGELOG.md Outdated
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.

2 participants