Skip to content

Complete manual shortcut correction flow - #33

Merged
HusseinBaraja merged 2 commits into
mainfrom
manual-shortcut-flow
Oct 3, 2026
Merged

HusseinBaraja merged 2 commits into
mainfrom
manual-shortcut-flow

Conversation

@HusseinBaraja

@HusseinBaraja HusseinBaraja commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Manual selected-text requests previously reached the correction engine but always refused replacement. This completes the manual shortcut flow for supported selections, then commits corrected text to informative context, clears executable context, records app-level undo, and writes metadata-only correction events.

Selection replacement requires the exact admitted span and independent UI Automation/native caret proof that the selection ends at the caret. Backward or unprovable selections skip correction. Current-session ownership remains required unless arbitrary-selection correction is explicitly enabled; security, app rules, confidence policy, clipboard preservation, and post-caret protection remain enforced.

Validation:

  • cargo test: 375 passed, 5 existing opt-in/pending tests ignored; the additional selected medium-confidence regression passed afterward.
  • Focused manual/pipeline regressions passed.
  • Interactive native_edit_replacement_smoke passed, including runtime shortcut dispatch, selection opt-in, backward-selection refusal, Unicode replacement, unchanged post-caret text, undo, and metadata.
  • dotnet test .\AutoFix.sln: 151 passed.
  • Rust and .NET builds passed; .NET reported zero warnings/errors.
  • Formatting and diff checks passed; the rebuilt engine started and stopped successfully with an isolated profile.

API routing and completion are covered with controlled engine responses; no live provider request was sent. Medium-confidence suggestion acceptance remains planned; unchanged or suppressed selections retain their context.

Summary by CodeRabbit

  • New Features
    • Manual correction can now replace eligible selected text, including selections that end at the caret. Successful replacements support undo.
    • Selected text is checked against the live selection and surrounding context before correction. Text after the caret remains unchanged.
  • Bug Fixes
    • Backward, stale, or unverifiable selections are skipped, helping prevent unintended replacements.
    • Unchanged or suppressed corrections preserve the original selection and context.
    • Correction records contain metadata only and do not include document text or engine response details.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
README.md — configured
AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 35764ac8-5d48-4549-84a7-37cf01c21677
📥 Commits

Reviewing files that changed from the base of the PR and between e4e96ea and 7f0b5a8.

📒 Files selected for processing (12)
  • README.md
  • app-core-rust/README.md
  • app-core-rust/src/background/context_capture.rs
  • app-core-rust/src/background/mod.rs
  • app-core-rust/src/background/pipeline.rs
  • app-core-rust/src/background/pipeline/tests.rs
  • app-core-rust/src/background/pipeline/tests/manual.rs
  • app-core-rust/src/background/replacement/mod.rs
  • app-core-rust/src/background/replacement/native.rs
  • app-core-rust/src/background/replacement/tests.rs
  • app-core-rust/src/background/session.rs
  • app-core-rust/src/background/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Manual correction now supports eligible selected text after caret and live-context validation. The pipeline applies verified replacements, updates session and undo state, and records metadata. Native replacement rechecks the selection and caret before editing.

Changes

Selected-text correction

Layer / File(s) Summary
Selection and context proof
README.md, app-core-rust/README.md, app-core-rust/src/background/context_capture.rs, app-core-rust/src/background/mod.rs
Selection capture requires UI Automation and native caret proof at the selection end. Correction context is returned only when the selected text and surrounding anchors match the request.
Selected-text replacement
app-core-rust/src/background/replacement/*, app-core-rust/src/background/replacement/tests.rs
Replacement plans mark selected-text targets. Native replacement checks the exact selection and caret, and tests cover backward-selection refusal, replacement methods, and shortcut behavior.
Manual correction and session completion
README.md, app-core-rust/README.md, app-core-rust/src/background/pipeline.rs, app-core-rust/src/background/session.rs, app-core-rust/src/background/pipeline/tests.rs, app-core-rust/src/background/pipeline/tests/manual.rs, app-core-rust/src/background/tests.rs
The pipeline admits eligible manual selections, validates live context, and completes changed selections with session and undo updates. Applied and unchanged commits share metadata logging. Tests cover success, rejection, confidence outcomes, and state preservation.

Priority: ⬇️ Low

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

Change: Feature

Merge Risk: ⚪ Minimal · up to 7f0b5

The selected-text correction flow is mergeable after normal checks; no actionable issue remains from this review.

🚥 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 clearly summarizes the main change: completing the manual shortcut correction flow, including support for selected-text corrections.
Docstring Coverage ✅ Passed Docstring coverage is 95.92% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 10 files. (2 skipped: 2…
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 docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@HusseinBaraja

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Pull request base or head changed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@HusseinBaraja

Copy link
Copy Markdown
Owner Author

@coderabbitai Your completed review covers commit 7f0b5a8 and reports no actionable comments or remaining issues. The branch is fully pushed, both Rust checks and Windows build and tests passed, and no inline findings are outstanding. Please confirm that no review concerns remain and this PR is ready to merge. If any issue still needs fixing, identify it before we merge.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr view 33 --repo HusseinBaraja/AutoFix --json url,state,isDraft,headRefOid,mergeable,mergeStateStatus,reviewDecision,statusCheckRollup,reviews
gh api repos/HusseinBaraja/AutoFix/issues/33/comments --paginate --jq '.[] | select(.user.login == "coderabbitai[bot]") | {created_at,body}'
gh api graphql -f query='
query {
  repository(owner: "HusseinBaraja", name: "AutoFix") {
    pullRequest(number: 33) {
      reviewThreads(first: 100) {
        pageInfo { hasNextPage endCursor }
        nodes {
          isResolved
          isOutdated
          path
          comments(first: 20) {
            nodes { author { login } body url }
          }
        }
      }
    }
  }
}'

Length of output: 12362


@HusseinBaraja No review concerns remain. PR #33 is ready to merge based on the completed review and current GitHub status.

I verified:

  • The current head is 7f0b5a8246a0662c00e8541a35ab08a07595ef4e.
  • The completed CodeRabbit review covers that commit and reports no actionable issues.
  • Rust checks, Windows build and tests, and CodeRabbit status all passed.
  • No inline review threads are outstanding.
  • GitHub reports MERGEABLE with a CLEAN merge state.

No additional fix is required by this review.

You are interacting with an AI system.

@HusseinBaraja
HusseinBaraja merged commit a7d40be into main Oct 3, 2026
3 checks passed
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.

1 participant