95: EMC: Display Perps positions in a tree table using dummy data
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-10-19
|
||||
@@ -0,0 +1,25 @@
|
||||
# Design
|
||||
|
||||
## Context
|
||||
|
||||
See proposal.md for motivation. EMC currently constructs matching placeholder tabs under Production and Test in `EvelynMissionControlImpl`. JavaFX and its shared runtime are already available.
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:** Isolate the prototype's construction and sample data inside the EMC implementation package; keep the existing environment tab colors.
|
||||
|
||||
**Non-Goals:** Public position APIs, domain/service models, runtime changes, refresh scheduling, or configuration.
|
||||
|
||||
## Decisions
|
||||
|
||||
- Add a package-private Perps tab builder instead of growing the chart-oriented main implementation or introducing service abstractions. Each environment gets a fresh tree, so collapsing one view does not affect the other.
|
||||
- Use JavaFX's native tree table and an invisible expanded root. A private display record holds a label, optional direction, and optional USD size using the existing `ΩAmountΩ` ValueTag (`BigDecimal`). This is a monetary amount expressed in USD by the display contract, not a USDC token amount or Jupiter-specific raw integer. No Detag configuration changes are needed.
|
||||
- Format the numeric size as US currency in the display layer, align it right, and leave group values blank. Disable column sorting to preserve the sample grouping and position order.
|
||||
- Apply faint background colors through the row factory and reset the style when a virtualized row becomes empty or represents a group. Keep native selection styling and readable text by setting the control's inner background colors rather than overriding selected-row backgrounds.
|
||||
- Put a wrapping sample-data notice above the table, including the illustrative status of Phoenix. Use a growing layout so the table follows the available window size.
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- [Reused rows could retain a position color after collapse or scrolling] → Clear inline styling for groups and empty rows and check it in UI validation.
|
||||
- [Samples could be mistaken for real positions in Production] → Show the explicit sample notice in both environments.
|
||||
- [No graphical display may be available in the execution environment] → Attempt isolated UI verification without starting the operational Hub; record any remaining visual checks honestly.
|
||||
@@ -0,0 +1,27 @@
|
||||
# Proposal
|
||||
|
||||
## Why
|
||||
|
||||
Evelyn Mission Control's Perps tab is empty. Issue #95 requests a small local prototype so the owner can evaluate the active-position hierarchy before connecting Evelyn services.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Display an expanded, collapsible wallet → venue → position tree table in the Perps tab.
|
||||
- Include hardcoded Jupiter and Phoenix examples with Long/Short text, readable USD sizes, and faint direction colors on position rows only.
|
||||
- Clearly identify sample data and illustrative Phoenix rows; add no Refresh button, service communication, or simulated updates.
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
- `evelyn-perps-overview`: EMC's hierarchical overview of perpetual positions, initially displayed with explicitly labeled sample data.
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
None.
|
||||
|
||||
## Impact
|
||||
|
||||
Only EMC implementation code under `com.r35157.evelyn.emc.impl.ref` and this OpenSpec change. Both Production and Test Perps tabs receive independent sample views. No public API, service, configuration, dependency, or network changes.
|
||||
|
||||
Source: https://git.r35157.com/r35157/com_r35157_nenjim-hubd-impl_ref/issues/95
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
# Spec Delta
|
||||
|
||||
## Purpose
|
||||
|
||||
Let the owner inspect Evelyn perpetual positions grouped by wallet and venue in Mission Control, beginning with a clearly labeled sample-data prototype.
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Perps overview displays a collapsible position hierarchy
|
||||
The Perps tab SHALL display a tree table with columns `Position`, `Direction`, and `Position size, USD`. The hierarchy SHALL be wallet → venue → position, expanded by default, with collapsible wallet and venue groups. Wallet and venue rows SHALL leave direction and size empty.
|
||||
|
||||
#### Scenario: Open either environment's Perps tab
|
||||
- **WHEN** the owner opens Perps in Production or Test
|
||||
- **THEN** the three named columns and the fully expanded hierarchy are visible
|
||||
- **AND** direction and size appear only on position rows
|
||||
|
||||
#### Scenario: Collapse and expand groups
|
||||
- **WHEN** the owner collapses and then expands a wallet or venue
|
||||
- **THEN** its descendants are hidden and then shown again
|
||||
|
||||
### Requirement: Sample positions communicate direction and USD size
|
||||
The overview SHALL include hardcoded Jupiter and Phoenix venues with multiple sample positions, including both Long and Short directions. Position rows SHALL show `Long` or `Short` text and USD sizes with grouping separators and two decimal places. Long rows SHALL have faint green backgrounds and Short rows faint red backgrounds with readable text; wallet and venue rows SHALL have no direction-based color.
|
||||
|
||||
#### Scenario: Inspect sample positions
|
||||
- **WHEN** the owner inspects Jupiter and Phoenix examples
|
||||
- **THEN** both venues have multiple positions and both directions are demonstrated
|
||||
- **AND** position sizes use readable USD formatting
|
||||
- **AND** only position rows use direction-based backgrounds, with direction also conveyed by text
|
||||
|
||||
### Requirement: Prototype is clearly labeled and entirely local
|
||||
The Perps view SHALL explicitly label its data as sample data and explain that Phoenix rows are illustrative without an existing integration. It SHALL remain entirely within EMC, using no network calls, service changes, service communication, Refresh button, or simulated live updates for the prototype.
|
||||
|
||||
#### Scenario: Inspect the prototype boundary
|
||||
- **WHEN** the Perps tab is displayed
|
||||
- **THEN** sample-data and illustrative-Phoenix labels are visible
|
||||
- **AND** there is no Refresh button or automated update of sample positions
|
||||
- **AND** displaying and interacting with the prototype uses only local EMC data
|
||||
@@ -0,0 +1,11 @@
|
||||
# Tasks
|
||||
|
||||
## 1. Local Perps prototype
|
||||
|
||||
- [x] 1.1 Implement the EMC-local expanded wallet/venue/position table, sample notice, USD formatting, and direction colors; verify source against issue #95 including blank group cells and row-style reset.
|
||||
- [x] 1.2 Replace both environments' Perps placeholders with independent sample views; verify integration and compile with the normal Gradle build without starting the operational Hub.
|
||||
|
||||
## 2. Integration verification
|
||||
|
||||
- [x] 2.1 Validate this OpenSpec change strictly and run existing Gradle checks; record results and a visual expand/collapse, selection, and row-reuse check or any unavailable graphical verification in verification.md.
|
||||
- [x] 2.2 Review the final diff for EMC-only implementation scope, absence of network/service changes and Refresh controls, and clean whitespace; leave all changes uncommitted for owner review.
|
||||
@@ -0,0 +1,28 @@
|
||||
# Verification
|
||||
|
||||
Verified 2026-10-19 against Gitea issue #95.
|
||||
|
||||
## Build and existing checks
|
||||
|
||||
- `JAVA_HOME=/usr/local/software/java/jfx-25 ./gradlew build` — passed, including normal Detag generation, compilation, packaging, and existing tests.
|
||||
- Existing suite: 42 tests across six suites, zero failures, errors, or skips. No new automated tests were added.
|
||||
- Repeated build after switching the display amount to the existing `ΩAmountΩ` tag — passed; generated Java remained identical and compilation/tests were up-to-date.
|
||||
- `openspec validate 95-display-perps-sample-positions --strict` — passed.
|
||||
- `git diff --check` — passed.
|
||||
|
||||
## Isolated JavaFX inspection
|
||||
|
||||
A temporary preview outside the repository constructed the actual `PerpsTab` in nested Production/Test tabs in a 600 × 400 JavaFX scene, rendered snapshots, changed expansion/selection, and scrolled the table. The operational Hub and its services were not started.
|
||||
|
||||
- Inspected expanded, selected, scrolled, collapsed-group, and Test snapshots. Column headings and USD values are readable; the notice wraps without clipping and identifies Phoenix as illustrative.
|
||||
- Eight positions appear under two wallets and four venue groups (14 visible tree rows when expanded). Both venues have multiple Long/Short samples.
|
||||
- Position rows are faint green/red. Selected rows retain native selection styling and readable direction text.
|
||||
- Collapsing wallet A reduces visible rows from 14 to eight; Test remains at 14 rows, confirming independent trees.
|
||||
- Collapsing all venues leaves six group rows with blank direction/size cells and no residual direction colors after row reuse.
|
||||
- Scrolling exposes the remaining positions with correct colors, directions, and sizes.
|
||||
|
||||
This verifies rendered scenes and programmatic control behavior. Mouse/keyboard operation in the running EMC application was not exercised.
|
||||
|
||||
## Scope review
|
||||
|
||||
Implementation consists of the new package-private EMC `PerpsTab` and one placeholder replacement in `EvelynMissionControlImpl`. Source review confirms no Refresh control, network calls, service changes, sample refresh timeline, public API changes, configuration changes, or dependency changes. Changes remain local and uncommitted for owner review; the OpenSpec change remains active.
|
||||
@@ -0,0 +1,37 @@
|
||||
# evelyn-perps-overview Specification
|
||||
|
||||
## Purpose
|
||||
|
||||
Let the owner inspect Evelyn perpetual positions grouped by wallet and venue in Mission Control, beginning with a clearly labeled sample-data prototype.
|
||||
|
||||
## Requirements
|
||||
|
||||
### Requirement: Perps overview displays a collapsible position hierarchy
|
||||
The Perps tab SHALL display a tree table with columns `Position`, `Direction`, and `Position size, USD`. The hierarchy SHALL be wallet → venue → position, expanded by default, with collapsible wallet and venue groups. Wallet and venue rows SHALL leave direction and size empty.
|
||||
|
||||
#### Scenario: Open either environment's Perps tab
|
||||
- **WHEN** the owner opens Perps in Production or Test
|
||||
- **THEN** the three named columns and the fully expanded hierarchy are visible
|
||||
- **AND** direction and size appear only on position rows
|
||||
|
||||
#### Scenario: Collapse and expand groups
|
||||
- **WHEN** the owner collapses and then expands a wallet or venue
|
||||
- **THEN** its descendants are hidden and then shown again
|
||||
|
||||
### Requirement: Sample positions communicate direction and USD size
|
||||
The overview SHALL include hardcoded Jupiter and Phoenix venues with multiple sample positions, including both Long and Short directions. Position rows SHALL show `Long` or `Short` text and USD sizes with grouping separators and two decimal places. Long rows SHALL have faint green backgrounds and Short rows faint red backgrounds with readable text; wallet and venue rows SHALL have no direction-based color.
|
||||
|
||||
#### Scenario: Inspect sample positions
|
||||
- **WHEN** the owner inspects Jupiter and Phoenix examples
|
||||
- **THEN** both venues have multiple positions and both directions are demonstrated
|
||||
- **AND** position sizes use readable USD formatting
|
||||
- **AND** only position rows use direction-based backgrounds, with direction also conveyed by text
|
||||
|
||||
### Requirement: Prototype is clearly labeled and entirely local
|
||||
The Perps view SHALL explicitly label its data as sample data and explain that Phoenix rows are illustrative without an existing integration. It SHALL remain entirely within EMC, using no network calls, service changes, service communication, Refresh button, or simulated live updates for the prototype.
|
||||
|
||||
#### Scenario: Inspect the prototype boundary
|
||||
- **WHEN** the Perps tab is displayed
|
||||
- **THEN** sample-data and illustrative-Phoenix labels are visible
|
||||
- **AND** there is no Refresh button or automated update of sample positions
|
||||
- **AND** displaying and interacting with the prototype uses only local EMC data
|
||||
Reference in New Issue
Block a user