Skip to content

Implement full-completion insertion and acceptance flow #70

@FuJacob

Description

@FuJacob

Problem

Accepting a full Compose result is different from accepting a small inline autocomplete chunk. The app needs to insert a larger block reliably, avoid stale-focus insertion, and make cancellation/pass-through behavior obvious.

Goal

Implement the insertion and acceptance foundation for full Compose results while preserving the current autocomplete acceptance path.

Proposed Scope

  • Define how a Compose result is represented in active suggestion/session state.
  • Insert the full result at the focused caret only when focus and context are still valid.
  • Cancel pending Compose work on focus changes, app-disabled state, global disable, or mode changes.
  • Decide whether the overlay previews the full result, a collapsed preview, or a summary.
  • Ensure Tab pass-through still works when there is no valid Compose result.
  • Add tests around stale focus, disabled state, and acceptance behavior.

Acceptance Criteria

  • A full Compose result can be accepted into a supported focused text field.
  • Stale results are not inserted after focus/app/context changes.
  • Existing autocomplete chunk acceptance continues to work.
  • Cancellation and disabled-state behavior follows the existing suggestion availability model.
  • Tests cover valid insertion, stale insertion prevention, and pass-through behavior.

Open Questions

  • Should long insertion use pasteboard, accessibility text insertion, synthetic key events, or an app-specific strategy?
  • How should multiline drafts be previewed before acceptance?
  • Should users be able to accept part of a Compose result later?

Parent: #66

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:focusFocus tracking, AX, caret detectionarea:uiMenu bar, overlay, settings surfacesenhancementNew feature or request

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions