feat(zone-data): add binary viewers and editors - #22
Conversation
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds end-to-end support for ChangesZone data support
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
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 valueInline
stylefor canvas sizing vs. Tailwind-only guideline.The zoom-driven
width/heightare 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
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (19)
cmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/file-edit.tsxcmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/file-view.tsxcmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-edit.tsxcmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/components/zone-data-file-view.tsxcmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/constants.tscmd/omnihance-a3-agent/omnihance-a3-agent-ui/src/lib/api.tsgo.modinternal/server/file_system_routes.gointernal/server/file_system_zone_data_test.gointernal/server/server.gointernal/services/file_editor_service.gointernal/services/zone_data_apply.gointernal/services/zone_data_decode.gointernal/services/zone_data_economy_apply.gointernal/services/zone_data_economy_decode.gointernal/services/zone_data_remaining_apply.gointernal/services/zone_data_remaining_decode.gointernal/services/zone_data_service.gointernal/services/zone_data_service_test.go
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
Bug Fixes