Skip to content

Handle NULL line, font and foreground attribute references (companion to AgIsoStack-rs#48) - #36

Open
Arjan-Woltjer wants to merge 1 commit into
Open-Agriculture:mainfrom
Arjan-Woltjer:fix/nullable-line-font-foreground-refs
Open

Arjan-Woltjer wants to merge 1 commit into
Open-Agriculture:mainfrom
Arjan-Woltjer:fix/nullable-line-font-foreground-refs

Conversation

@Arjan-Woltjer

Copy link
Copy Markdown

Companion to Open-Agriculture/AgIsoStack-rs#48; fixes #35.

Depends on the AgIsoStack-rs change landing on daan/terminal-designer-changes first — until then this does not build against the pinned dependency, which is why it is a draft. Cargo.toml is deliberately left pointing at upstream.

What

AgIsoStack-rs is making line_attributes (Output Line / Rectangle / Ellipse / Polygon), font_attributes (Input/Output String/Number) and Input Boolean foreground_colour NullableObjectId, because ISO 11783-6 allows NULL there and real pools (John Deere) use it. This adapts the Designer, following exactly how it already handles fill_attributes:

  • Configuring: the selectors for those fields gain a "None" entry and show "None" when NULL; the "(view)" link only appears when a reference is set.
  • Rendering:
    • NULL line attributes: an Output Line draws nothing; a Rectangle or Polygon keeps its fill and gets no outline.
    • NULL font attributes: text renders with the Designer's default font attributes instead of a red "Missing FontAttributes" error — NULL is legal, a dangling reference still shows the error.
    • NULL foreground colour on an Input Boolean: falls back to black, as a missing one already did.
  • Defaults: new objects start with these references at NULL rather than pointing at object 0, which normally does not exist.
  • default_font_attributes is made pub for the rendering fallback.

Verification

Built locally against the AgIsoStack-rs branch: cargo check --lib, cargo test --lib and cargo fmt --check clean; cargo check --lib warnings are unchanged from the base branch. Loading the John Deere StarFire pool then gives all 9 619 objects and its Working Set; the 31-byte reproducer from the issue gives 3 objects and a Working Set. Not run: the wasm32 check (no platform-specific code touched).

🤖 Generated with Claude Code

AgIsoStack-rs is making line_attributes, font_attributes and Input
Boolean foreground_colour NullableObjectId, because ISO 11783-6 allows
NULL there and real pools (John Deere) use it. Adapt the Designer the
same way it already treats fill_attributes: a "None" entry in the
selectors, and NULL-aware rendering -- a NULL-line shape keeps its fill
and gets no outline, NULL font attributes render with the default font
instead of a red error, NULL foreground colour falls back to black. New
objects start with these references at NULL instead of pointing at
object 0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Copilot AI 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.

🔵 Needs a closer look

The changes span configuration, defaults, and rendering behavior and warrant human review.

Pull request overview

Updates the Designer to support legal NULL line, font, and foreground attribute references.

Changes:

  • Adds NULL-aware selectors and conditional view links.
  • Implements rendering fallbacks for nullable references.
  • Initializes new references as NULL and exposes default font attributes.
File summaries
File Description
src/object_rendering.rs Handles nullable rendering references.
src/object_defaults.rs Initializes affected references as NULL.
src/object_configuring.rs Adds “None” options and conditional view links.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

No deployments
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.

Pools with NULL line/font attribute references load truncated and without a Working Set (John Deere StarFire)

2 participants