Skip to content

M3-06 slice 4d: choose a to-one from the inspector - #10

Merged
anandghegde merged 1 commit into
mainfrom
claude/next-step-implementation-96e1x8
Sep 25, 2026
Merged

anandghegde merged 1 commit into
mainfrom
claude/next-step-implementation-96e1x8

Conversation

@anandghegde

@anandghegde anandghegde commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

What and why

M3-06, slice 4d. Until now, a to-one could only be changed from the relationships panel. In an editable store, a to-one field on the inspector's Details tab can now be changed where it's shown.

  • Choose: a link button, Choose Object… in the context menu, and a VoiceOver action all open the object picker. The object the field points at now is marked Linked. What's chosen replaces it, staged as an edit of the field (undo reads Edit head).
  • Set to Nil: empties an optional to-one that points somewhere, as attribute fields already do.
  • One picker: ProjectContext.objectPicker(for:linked:choose:) now builds the picker next to the value-editing rules, and the relationships panel uses it too. toOneChoosing(_:value:of:) says how a field is chosen, the way fieldEditing says how one is typed, so the grid's text editor never gets a to-one.
  • Tests: EditingSessionTests +1, using a department's head. It checks:
    • the field isn't typed, and attributes and to-manys get no chooser;
    • the picker lists the five managers with the current one marked;
    • what's chosen replaces it as Edit head;
    • Set to Nil empties it and is then no longer offered.
  • Docs: IMPLEMENTATION_PLAN gets slice 4d and an updated Next list.

PRD IDs: EDT-3

Checklist

  • Clean-room: this change is based only on public documentation and on Apple frameworks observed through public APIs. I did not decompile or inspect any closed-source product.
  • Commits are signed off (git commit -s, DCO).
  • Tests added or updated. The app tests run on macOS in CI.
  • No new strict-concurrency warnings.
  • Public engine API has DocC comments. (No engine API changes.)
  • No row data is logged (store-derived values are wrapped in Redacted).
  • User-visible strings are externalised; new controls have accessibility labels.
  • ADR added or amended if a decision changed. (Not needed.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01AT9wkNZ97Eo3MvLLtP7JHP


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • In editable stores, to-one relationships can now be changed from the Details tab using an object picker. The picker marks the currently linked object, and optional relationships can be cleared.
    • Existing relationship fields retain their current text-editing behavior; to-many relationships are not affected.

In an editable store, a to-one field on the inspector's Details tab can
now be changed in place (EDT-3).

- A link button, "Choose Object…" in the context menu and a VoiceOver
  action open the object picker. The object the field leads to now is
  marked Linked. What is chosen replaces it, staged as an edit of the
  field ("Edit head")
- "Set to Nil" empties an optional to-one that leads somewhere
- The picker is built in one place,
  ProjectContext.objectPicker(for:linked:choose:), which the relationships
  panel now uses too. toOneChoosing(_:value:of:) describes how a field is
  chosen, the way fieldEditing describes how one is typed, so the grid's
  text editor never gets a to-one
- Tests: EditingSessionTests +1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AT9wkNZ97Eo3MvLLtP7JHP
Signed-off-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 4197b33a-4776-47a0-8667-6e214e77990b

📥 Commits

Reviewing files that changed from the base of the PR and between 3b84e27 and 5e02bb5.

📒 Files selected for processing (8)
  • App/CoreDataDabbi/Editing/ValueEditing.swift
  • App/CoreDataDabbi/Inspector/DetailsTab.swift
  • App/CoreDataDabbi/Inspector/FieldRow.swift
  • App/CoreDataDabbi/Inspector/InspectorModel.swift
  • App/CoreDataDabbi/Relationships/RelationshipsModel.swift
  • App/CoreDataDabbi/Resources/Localizable.xcstrings
  • App/CoreDataDabbiTests/EditingSessionTests.swift
  • docs/IMPLEMENTATION_PLAN.md

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


📝 Walkthrough

Walkthrough

Editable to-one relationships can now be chosen from inspector fields and cleared when optional. Picker creation is shared with the relationships panel. Tests cover chooser availability, selection, linked-object marking, and clearing.

Changes

To-One Inspector Editing

Layer / File(s) Summary
To-one editing and shared picker
App/CoreDataDabbi/Editing/ValueEditing.swift, App/CoreDataDabbi/Relationships/RelationshipsModel.swift
ProjectContext provides to-one editing and picker creation. The relationships panel now uses the shared picker.
Inspector relationship controls
App/CoreDataDabbi/Inspector/FieldRow.swift, App/CoreDataDabbi/Inspector/InspectorModel.swift, App/CoreDataDabbi/Inspector/DetailsTab.swift
DetailsTab passes chooser configuration to FieldRow. The field can present an object picker, offer a choose action, and clear an optional relationship.
Workflow validation and supporting updates
App/CoreDataDabbiTests/EditingSessionTests.swift, App/CoreDataDabbi/Resources/Localizable.xcstrings, docs/IMPLEMENTATION_PLAN.md
Tests cover chooser availability, selection, linked-object marking, and clearing. The localization catalog and implementation notes are updated.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant DetailsTab
  participant InspectorModel
  participant ProjectContext
  participant FieldRow
  participant ObjectPicker
  DetailsTab->>InspectorModel: request toOneChoosing for field
  InspectorModel->>ProjectContext: look up to-one chooser
  ProjectContext-->>DetailsTab: return optional chooser configuration
  DetailsTab->>FieldRow: provide chooser configuration
  FieldRow->>ProjectContext: request picker when choose is invoked
  ProjectContext-->>FieldRow: return ObjectPicker
  FieldRow->>ObjectPicker: present picker
  ObjectPicker-->>ProjectContext: selected object reference
  ProjectContext-->>FieldRow: stage selected reference as to-one value
Loading

Merge Risk: ⚪ Minimal · up to 5e02b

The inspector’s to-one selection and clearing workflow is ready for normal checks before merge; no actionable issue is established by the available evidence.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 5e02b

The new inspector action appears limited to an editable store and uses the existing staged-edit path. No introduced security issue was established, but recovery and stale-action behavior are not fully covered by the available tests.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new action's demonstrated reach is relationship data in the user's editable store, rather than a new service or privileged deployment boundary. The picker reads candidate objects through its supplied store session.

Trust Boundaries and Controls

  • observed — UI eligibility checks precede picker creation, while the store mutation independently checks editability, source identity, to-one cardinality, and destination entity. The setter does not explicitly repeat the chooser's transient and optionality checks.

Resilience and Maintainability Implications

  • observed — Staged operations are serialized for the current editing session, and failed edit groups are rolled back. The available inspector test does not directly exercise interruption, stale callbacks, or repeated selection.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling users to choose a to-one relationship from the inspector.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 6 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

Copy link
Copy Markdown
Owner Author

Test (macos-15, Xcode 26.3) fails for a reason that isn't this PR's. It is the continue-on-error canary, and it stops on the same error it hits on main: Sources/DabbiTracking/VersionLog.swift:254:36: error: sending 'connection' risks causing data races. That error comes from the stricter data-race checking in Xcode 26.3's Swift compiler. This PR changes only app files, which that job doesn't build, and the log has no other compile errors. There is no fix for it yet. The canary is not a required check; the Xcode 26.4 jobs are the ones that gate this PR.


Generated by Claude Code

@anandghegde
anandghegde merged commit 420e7a5 into main Sep 25, 2026
6 of 7 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.

2 participants