Skip to content

Conversation

@sigmachirality
Copy link
Member

@sigmachirality sigmachirality commented Jan 7, 2026

Where zone/cluster information is available, we want to make sure to show it to the user to encourage them to think in terms of zones as much as possible.

@semanticdiff-com
Copy link

semanticdiff-com bot commented Jan 7, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  src/lib/orders/index.tsx  1% smaller
  deno.lock Unsupported file format
  src/lib/Quote.tsx  0% smaller
  src/lib/contracts/ContractDisplay.tsx  0% smaller
  src/lib/contracts/types.ts  0% smaller
  src/lib/nodes/create.ts  0% smaller
  src/lib/orders/OrderDisplay.tsx  0% smaller
  src/lib/orders/types.ts  0% smaller

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 7, 2026

Greptile Summary

This PR completes the zone information display by adding zone fields to read paths (contracts and orders) and ensuring the zone from quotes is used in node creation when no zone is explicitly specified.

Key Changes:

  • Added zone field to contract types and display
  • Added cluster field (which represents zone name) to order types and verbose display
  • Modified node creation to use zone from quote if available and no zone was specified
  • Added --verbose flag to sf orders ls command to show expanded details including zone

Technical Note:
The API returns zone information as cluster for orders (type market-api_ClusterName) and zone for contracts. Both represent the same concept - the zone/cluster where resources are located. The display layer correctly shows "zone" to users while respecting the underlying API field names.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward additions of zone information to display components and a defensive zone assignment in node creation. No existing logic is modified, only new fields and display elements are added. The code follows existing patterns and uses safe fallback values (N/A) for optional fields.
  • No files require special attention

Important Files Changed

Filename Overview
src/lib/contracts/ContractDisplay.tsx Added zone display row showing contract zone with N/A fallback
src/lib/nodes/create.ts Uses zone from quote to populate createParams.zone when not already specified
src/lib/orders/OrderDisplay.tsx Added zone row displaying order.cluster field (API returns cluster as zone name)

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI
    participant API
    participant Display

    Note over User,Display: Read Paths - Displaying Zone Information

    User->>CLI: sf orders ls --verbose
    CLI->>API: GET /orders
    API-->>CLI: orders[] with cluster field
    CLI->>Display: OrderDisplay (expanded=true)
    Display-->>User: Show zone row (from order.cluster)

    User->>CLI: sf contracts ls
    CLI->>API: GET /contracts
    API-->>CLI: contracts[] with zone field
    CLI->>Display: ContractDisplay
    Display-->>User: Show zone row (from contract.zone)

    Note over User,Display: Write Path - Using Zone from Quote

    User->>CLI: sf nodes create (no --zone specified)
    CLI->>API: GET /quote
    API-->>CLI: quote with zone field
    CLI->>CLI: createParams.zone ||= quote.zone
    CLI->>API: POST /nodes with zone
    API-->>User: Nodes created in zone
Loading

@sigmachirality sigmachirality self-assigned this Jan 7, 2026
@sigmachirality sigmachirality merged commit 9f9bd5a into main Jan 7, 2026
1 check passed
@sigmachirality sigmachirality deleted the dt/update-read-paths branch January 7, 2026 08:25
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