You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2026/06/07 14:49:22 UTC
(causeway) 31/50: CAUSEWAY-4014: proposes replayable command open target refinement
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-4014
in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 75d4788f4372197f83025446a5694b360e734221
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Jun 7 12:08:25 2026 +0100
CAUSEWAY-4014: proposes replayable command open target refinement
---
.../.openspec.yaml | 2 +
.../design.md | 47 ++++++++++++++++++++++
.../proposal.md | 30 ++++++++++++++
.../specs/replayable-command-remappings/spec.md | 36 +++++++++++++++++
.../tasks.md | 14 +++++++
5 files changed, 129 insertions(+)
diff --git a/openspec/changes/replayable-command-open-target-refinement/.openspec.yaml b/openspec/changes/replayable-command-open-target-refinement/.openspec.yaml
new file mode 100644
index 00000000000..11967fcb6a7
--- /dev/null
+++ b/openspec/changes/replayable-command-open-target-refinement/.openspec.yaml
@@ -0,0 +1,2 @@
+schema: spec-driven
+created: 2026-06-07
diff --git a/openspec/changes/replayable-command-open-target-refinement/design.md b/openspec/changes/replayable-command-open-target-refinement/design.md
new file mode 100644
index 00000000000..e4cc2330fba
--- /dev/null
+++ b/openspec/changes/replayable-command-open-target-refinement/design.md
@@ -0,0 +1,47 @@
+## Context
+
+`ReplayableCommand` recently removed the target summary fields and the old target-opening mixins because participant rows now carry target information.
+The participants table is still the right place for target details, but users benefit from a command-level navigation action that opens the current actual target when that actual target is known and resolvable.
+
+## Goals / Non-Goals
+
+**Goals:**
+
+- Reintroduce an `openTarget` mixin for `ReplayableCommand`.
+- Associate the action with the `participants` collection using sequence `1`.
+- Resolve the target from the target participant's actual bookmark rather than from legacy target summary fields.
+- Disable the action when there is no actual target available to open.
+
+**Non-Goals:**
+
+- Do not reintroduce `targetType` or `targetId` properties.
+- Do not reintroduce the table-row `openTargetTR` action.
+- Do not change participant row layout, column order, or derivation except as needed to locate the actual target.
+- Do not change replay mapping SPI or replay execution behaviour.
+
+## Decisions
+
+### Use a participants-associated mixin
+
+The action should be associated with the `participants` collection so it appears next to the data that justifies opening the target.
+Using sequence `1` gives predictable placement among collection-associated actions.
+The alternative was to place the action in a separate field set or domain-object action area, but that would weaken the relationship with participant data.
+
+### Open only actual target values
+
+The action should open the target participant's actual target object, not the recorded command target.
+This matches the participant table semantics and avoids reintroducing the older recorded-target navigation behaviour.
+The alternative was to open the command log entry target, but that can point at recorded state rather than the actual replay participant.
+
+### Disable when no actual target is available
+
+The action should be disabled when no target participant actual bookmark exists or when the bookmark cannot resolve to an object.
+This avoids presenting an action that would return null.
+The alternative was to leave the action enabled and return null, but that gives a poor UI signal.
+
+## Risks / Trade-offs
+
+- [Risk] Resolving the actual target during disable checks can perform a bookmark lookup while rendering the page.
+ → Mitigate by limiting lookup to the target participant and using best-effort existing bookmark lookup semantics.
+- [Risk] Multiple target participants could exist for a command.
+ → Mitigate by using the first target participant, consistent with the existing command title and target handling conventions.
diff --git a/openspec/changes/replayable-command-open-target-refinement/proposal.md b/openspec/changes/replayable-command-open-target-refinement/proposal.md
new file mode 100644
index 00000000000..5ae5976aacb
--- /dev/null
+++ b/openspec/changes/replayable-command-open-target-refinement/proposal.md
@@ -0,0 +1,30 @@
+## Why
+
+The participants table is now the primary place to inspect replayable command targets, but users still need a convenient action on the command page to open the actual target when one is available.
+Reintroducing `openTarget` as a participants-associated action keeps navigation close to the participant data without restoring the removed target summary fields.
+
+## What Changes
+
+- Reintroduce the `ReplayableCommand_openTarget` mixin.
+- Associate the action with the `participants` collection.
+- Set the action layout sequence to `1`.
+- Open the actual target represented by the target participant.
+- Disable the action when no actual target is available.
+- Do not reintroduce `targetType`, `targetId`, or table-row `openTargetTR` actions.
+
+## Capabilities
+
+### New Capabilities
+
+None.
+
+### Modified Capabilities
+
+- `replayable-command-remappings`: Refines replayable command target navigation so `openTarget` is available as a participants-associated action only when an actual target can be opened.
+
+## Impact
+
+- Affects `ReplayableCommand` and its mixins in `extensions/core/commandlog/applib`.
+- Affects module imports in `CausewayModuleExtCommandLogApplib`.
+- Affects focused command log applib tests for participant-derived target actuals and action enablement.
+- No persistence schema, replay mapping SPI, or participant table column changes are expected.
diff --git a/openspec/changes/replayable-command-open-target-refinement/specs/replayable-command-remappings/spec.md b/openspec/changes/replayable-command-open-target-refinement/specs/replayable-command-remappings/spec.md
new file mode 100644
index 00000000000..e46e310650b
--- /dev/null
+++ b/openspec/changes/replayable-command-open-target-refinement/specs/replayable-command-remappings/spec.md
@@ -0,0 +1,36 @@
+## MODIFIED Requirements
+
+### Requirement: Replayable participant layouts expose participant data
+The system SHALL provide fallback layout metadata for `ReplayableCommandParticipant`.
+The participant layout SHALL expose role, parameter name, recorded bookmark, target, parameter, result, and actual bookmark in that order.
+The `ReplayableCommand` fallback layout SHALL include the participants collection as a table named `Participants` before the control field set.
+The `ReplayableCommand` object view MUST NOT expose separate target summary properties for target type or target identifier.
+The `ReplayableCommand` object view SHALL expose an `openTarget` action associated with the participants collection.
+The `openTarget` action SHALL have layout sequence `1`.
+The `openTarget` action SHALL open the actual target object when a target participant has an actual target available.
+The `openTarget` action SHALL be disabled when no actual target object is available.
+Target inspection and navigation SHALL be available through target rows in the participants collection.
+
+#### Scenario: User views participants table on a replayable command
+- **WHEN** a user views a replayable command using fallback layout metadata
+- **THEN** the layout includes the participants collection as a table named `Participants`
+- **AND** the participants table appears before the control field set
+
+#### Scenario: User views participant fields
+- **WHEN** a user views a replayable command participant using fallback layout metadata
+- **THEN** the layout displays the participant role, parameter name, recorded bookmark, target, parameter, result, and actual bookmark in order
+
+#### Scenario: User inspects target through participants
+- **WHEN** a user views a replayable command using fallback layout metadata
+- **THEN** the layout does not display separate `targetType` or `targetId` properties
+- **AND** target information is available through the participants table
+
+#### Scenario: User opens actual target from participants action
+- **WHEN** a replayable command target participant has an actual target object available
+- **THEN** the replayable command exposes an `openTarget` action associated with the participants collection
+- **AND** the `openTarget` action has layout sequence `1`
+- **AND** invoking the action opens the actual target object
+
+#### Scenario: User cannot open target without actual target
+- **WHEN** a replayable command has no target participant actual target object available
+- **THEN** the `openTarget` action is disabled
diff --git a/openspec/changes/replayable-command-open-target-refinement/tasks.md b/openspec/changes/replayable-command-open-target-refinement/tasks.md
new file mode 100644
index 00000000000..3a17a45d1da
--- /dev/null
+++ b/openspec/changes/replayable-command-open-target-refinement/tasks.md
@@ -0,0 +1,14 @@
+## 1. Open Target Mixin
+
+- [ ] 1.1 Add `ReplayableCommand_openTarget` mixin back to the replay package.
+- [ ] 1.2 Configure the mixin action layout with `associateWith = "participants"` and `sequence = "1"`.
+- [ ] 1.3 Implement the action to open the actual target object from the target participant.
+- [ ] 1.4 Disable the action when no actual target object is available.
+- [ ] 1.5 Register the mixin in `CausewayModuleExtCommandLogApplib`.
+
+## 2. Tests and Validation
+
+- [ ] 2.1 Add or update tests for opening the actual target object.
+- [ ] 2.2 Add or update tests for disabling the action when no actual target is available.
+- [ ] 2.3 Run focused command log applib tests for replayable command mapping and participant behaviour.
+- [ ] 2.4 Run `openspec validate replayable-command-open-target-refinement --strict`.