Skip to content

feat(navigation): observe exact editor selection - #397

Closed
dubesinhower wants to merge 13 commits into
mixelpixx:mainfrom
dubesinhower:feat/editor-selection-observation
Closed

feat(navigation): observe exact editor selection#397
dubesinhower wants to merge 13 commits into
mixelpixx:mainfrom
dubesinhower:feat/editor-selection-observation

Conversation

@dubesinhower

Copy link
Copy Markdown
Contributor

Summary

  • add exact project/document/sheet-bound GetSelection observation with a before/after open-document freshness check
  • decode selected board objects and the stable schematic line/label protobufs into KIID/UUID results using exact full type URLs
  • add provisional get_editor_selection to the editor_navigation toolset
  • add structured wrong-project, wrong-document, wrong-sheet-instance, ambiguity, stale-state, unsupported-type, and malformed-item refusals

Navigation MVP rationale

This is N2, the readback foundation for verified navigation. Selection mutation and cross-probe cannot claim success unless the client can observe the exact selected KIIIDs in the intended project, document, editor, and hierarchy instance.

Public naming and compatibility remain provisional under #395, so this PR is intentionally a draft.

Dependency

Behavior and refusals

The request must echo one exact identity returned by get_editor_state. GetOpenDocuments is matched before GetSelection and read again afterward because KiCad's SelectionResponse carries no response header. No first-document fallback exists.

The full observation fails closed for:

  • wrong project, PCB document, or schematic instance path
  • duplicate exact document identities
  • document disappearance or retargeting during readback
  • malformed selected protobufs or empty KIIIDs
  • selected object types not represented by the bundled stable KiCad protobuf model
  • unsupported commands and unreachable/closed endpoints

Intentionally unsupported

  • heuristic protobuf wire decoding for unmodelled schematic symbols or other unknown objects
  • treating references such as C10 as identity (N3)
  • selection mutation (N4), activation/reveal (N5), and cross-probe (N6)

The vendored KiCad 10 schematic schema models lines and labels but not schematic symbols. Such selections return unsupported_capability; they are not guessed from bytes or saved files.

Verification

  • cargo fmt --all -- --check — pass
  • cargo test -p konnect-ipc --test mock_server_test — 44 passed, 1 ignored
  • cargo test -p konnect-core editor_navigation --lib — 6 passed
  • cargo test --workspace --all-targets — pass (933 core tests; all non-environmental targets passed)
  • cargo clippy --workspace --all-targets -- -D warnings — pass
  • xtask fix-doc-counts --check — 21 toolsets, 223 registered tools, 230 total; current
  • git diff --check — pass

Remaining risks

  • KiCad 10's schematic protobuf surface cannot serialize every selectable schematic object; callers receive typed unsupported results until the stable protocol expands
  • the response lacks a document header; the before/after open-document readback detects context churn but cannot make the two transport calls atomic
  • public request names and compatibility are awaiting maintainer direction in Design Priority 1 semantic editor navigation MVP #395

@neusse

neusse commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Same coordination request here: please pause further work on this draft while we start with #369 and land the existing stack from the bottom up. #397 is stacked on #396 and all of its earlier prerequisites, so every change below it currently ripples through the whole branch. Once #396 has been rebuilt on the final accepted IPC base and the #395 public API decisions are settled, #397 can be restacked once and reviewed against stable prerequisites. Holding here will avoid repeated rebases and keep the eventual review and test evidence meaningful.

@neusse

neusse commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

The unique N2 portion of this cumulative draft has been reconstructed directly on the merged N1 foundation as #491.

#491 preserves the original authorship, retains the already-merged safety work and tests, and passes the complete local gate. This old stacked draft is now superseded and is being closed so there is only one active implementation path.

@neusse neusse closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:waiting-on-dependency Next actor: the dependency owner — see linked blocking issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants