Skip to content

feat(zone-data): add binary viewers and editors - #22

Merged
cyberinferno merged 5 commits into
masterfrom
codex/zone-data-editors
Jul 22, 2026
Merged

feat(zone-data): add binary viewers and editors#22
cyberinferno merged 5 commits into
masterfrom
codex/zone-data-editors

Conversation

@cyberinferno

@cyberinferno cyberinferno commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Adds configured-root ZoneData detection, generic hash-safe field editing endpoints, revision/rollback integration, schema-driven tables, and the accessible 256x256 map editor. Supports every binary format in the coverage manifest through agonyl-utils-go v0.7.1 while preserving existing editor routes. Backend tests/lint and frontend format/TypeScript/lint/build pass.

Summary by CodeRabbit

  • New Features

    • Added viewing and editing support for zone data files.
    • View zone records in searchable, paginated tables or interactive maps.
    • Edit supported fields, map cells, warps, and other zone data values.
    • Changes are validated, saved as revisions, and protected against stale updates.
    • Added support across multiple zone data formats, including economy and quest-related files.
  • Bug Fixes

    • Improved error and loading handling for zone data file operations.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cyberinferno, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0933fd8d-925b-4b26-9f10-d95d0bd472ff

📥 Commits

Reviewing files that changed from the base of the PR and between 91ac351 and ae4ecf4.

📒 Files selected for processing (6)
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/file-edit.tsx
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-edit.tsx
  • internal/server/file_system_routes.go
  • internal/services/zone_data_remaining_apply.go
  • internal/services/zone_data_service.go
  • internal/services/zone_data_service_test.go
📝 Walkthrough

Walkthrough

Adds end-to-end support for a3_zone_data_file files, including binary format detection, decoding, validated updates, server routes, revision persistence, React viewing/editing interfaces, and coverage for permissions, conflicts, and byte preservation.

Changes

Zone data support

Layer / File(s) Summary
Zone-data contracts and decoding
internal/services/zone_data_service.go, internal/services/zone_data_*_decode.go, go.mod
Defines zone-data formats, schemas, rows, maps, operations, detection, hashing, validation, and decoders for standard, economy, and remaining formats.
Binary update application
internal/services/zone_data_apply.go, internal/services/zone_data_economy_apply.go, internal/services/zone_data_remaining_apply.go
Applies field-specific operations across supported binary formats, validates ranges and scopes, tracks editable byte ranges, and re-encodes files.
Server routes and persistence
internal/server/file_system_routes.go, internal/server/server.go, internal/services/file_editor_service.go
Classifies zone-data files, exposes GET/PUT endpoints, checks permissions and source hashes, applies updates, and persists revisions.
Server and service validation
internal/server/file_system_zone_data_test.go, internal/services/zone_data_service_test.go
Tests detection, successful updates, revision creation, stale-hash conflicts, permissions, and preservation of unaffected bytes.
Frontend API and query wiring
cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/lib/api.ts, cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/constants.ts
Adds zone-data schemas, API functions, file-type validation, and query keys.
Frontend viewing and editing
cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/file-view.tsx, file-edit.tsx, zone-data-file-view.tsx, zone-data-file-edit.tsx
Adds searchable tables, interactive maps, field editing, pending operations, save mutations, loading/error states, and cache invalidation.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant FileView
  participant FileSystemRoutes
  participant ZoneDataService
  participant FileEditor
  User->>FileView: Open zone-data file
  FileView->>FileSystemRoutes: GET /api/file-tree/zone-data-file
  FileSystemRoutes->>ZoneDataService: Read and decode file
  ZoneDataService->>FileEditor: Load binary content
  ZoneDataService-->>FileView: ZoneDataFile with schema and rows/map
  User->>FileView: Edit and save operations
  FileView->>FileSystemRoutes: PUT with source_hash and operations
  FileSystemRoutes->>ZoneDataService: Apply operations
  ZoneDataService->>FileEditor: Persist updated bytes
  FileSystemRoutes-->>FileView: revision_id
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 accurately summarizes the main change: adding zone-data binary viewers and editors.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/zone-data-editors

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-view.tsx (1)

310-311: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Inline style for canvas sizing vs. Tailwind-only guideline.

The zoom-driven width/height are dynamic px values that static Tailwind classes cannot express, so this inline style is a reasonable exception. Flagging only for awareness; a CSS variable + Tailwind arbitrary value is possible but not worth the churn here. As per path instructions "Always use Tailwind classes for styling HTML elements in Omnihance A3 Agent UI; avoid using CSS or tags".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-view.tsx`
around lines 310 - 311, No code change is required for the canvas sizing in the
zone data file view. Retain the inline style on the canvas element because width
and height depend on the runtime zoom value and cannot be expressed with static
Tailwind classes.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/file-edit.tsx`:
- Around line 482-487: Add key={filePath} to the ZoneDataFileEdit usage in the
zoneDataFileData rendering block so navigating between zone-data files remounts
the editor and clears its local operations state, matching the existing
QuestFileEdit and ItemFileEdit behavior.

In
`@cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-edit.tsx`:
- Around line 438-444: Guard numeric parsing in the field onChange handler, the
warp input handler, and LabeledNumber against empty or non-numeric values. After
converting input text with Number, detect NaN and use the established safe
numeric fallback before passing the value to onChange, while preserving normal
numeric input behavior.

In `@internal/server/file_system_routes.go`:
- Line 166: Optimize the file-tree path around createNodeFromEntry and
applyFileNodeMetadata by resolving zoneRoot once per request, then reuse that
cached value for metadata checks. Add an early check to skip
zoneDataService.Detect for entries that cannot match zone data, while preserving
detection for possible matches and existing node metadata behavior.

In `@internal/services/zone_data_remaining_apply.go`:
- Around line 202-213: Replace the if/else-if/else chain on op.Field in the
remaining treasure-field handling with a tagged switch on op.Field. Preserve the
existing item_code and weight validation, record updates, byte allowances, and
unknown-field error behavior.

---

Nitpick comments:
In
`@cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-view.tsx`:
- Around line 310-311: No code change is required for the canvas sizing in the
zone data file view. Retain the inline style on the canvas element because width
and height depend on the runtime zoom value and cannot be expressed with static
Tailwind classes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f892007c-acbb-40be-a4d3-6580b15f3638

📥 Commits

Reviewing files that changed from the base of the PR and between 688ca72 and 91ac351.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (19)
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/file-edit.tsx
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/file-view.tsx
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-edit.tsx
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-view.tsx
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/constants.ts
  • cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/lib/api.ts
  • go.mod
  • internal/server/file_system_routes.go
  • internal/server/file_system_zone_data_test.go
  • internal/server/server.go
  • internal/services/file_editor_service.go
  • internal/services/zone_data_apply.go
  • internal/services/zone_data_decode.go
  • internal/services/zone_data_economy_apply.go
  • internal/services/zone_data_economy_decode.go
  • internal/services/zone_data_remaining_apply.go
  • internal/services/zone_data_remaining_decode.go
  • internal/services/zone_data_service.go
  • internal/services/zone_data_service_test.go

Comment thread internal/server/file_system_routes.go
Comment thread internal/services/zone_data_remaining_apply.go Outdated
@cyberinferno
cyberinferno merged commit 2755e54 into master Jul 22, 2026
2 checks passed
@cyberinferno
cyberinferno deleted the codex/zone-data-editors branch July 22, 2026 05:01
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.

1 participant