Skip to content

Add native schematic and symbol editors, datasheet attachments and fitted BOMs - #74

Draft
David-Bascom05 wants to merge 25 commits into
mainfrom
feature/electronics-editors
Draft

David-Bascom05 wants to merge 25 commits into
mainfrom
feature/electronics-editors

Conversation

@David-Bascom05

@David-Bascom05 David-Bascom05 commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #72. File → New Schematic and File → New Symbol Library open native .fg documents in ForgeCAD’s existing desktop and browser shell. The analog example shows a buffered sensor input and the pin roles for its supply decoupling.

The schematic editor supports placement, sub parts, wiring and branching, hierarchy, buses, net labels, electrical checks, signal flow and typed role assignment. The symbol editor supports graphics, pin numbering, electrical types and typed wants and gives. Both use checked source edits, save, undo and redo.

Purchasing data includes per-symbol defaults, per-occurrence custom fields, datasheet URLs and project-local PDF attachments. The fitted BOM groups physical occurrences across repeated sheets, counts sub parts of a package once and exports CSV. No build dependencies were added.

Reference designators and values have separate positions. Electrical Checks identifies both objects when printed text overlaps text, wires or symbol geometry. The Power tool places eight bundled global rail and ground symbols. Connected pins clear their open-tip markers. Local labels, global labels and hierarchical ports have distinct drawings.

The sheet navigator lists instances. The right dock searches library parts and power symbols. Selecting or right-clicking a pin opens its checklist, showing typed needs and provides and contributing reference designators. The VDD example highlights +3V3 and C2.P and dims the VSS return. The checklist distinguishes rail connectivity from an assigned power source. Arrows and moving dots toggle independently. The Draw ribbon places editable graphics and formatted text on a variable metric, mil or custom grid. Wiring still targets exact pins off grid.

The pin checklist has native Wants and Provides checkboxes. Checking an open role opens its assignment form. Selecting a checked role exposes its recorded assignments for removal. Changes are verified and undoable. Symbol authors can edit the two role directions independently in the Pin roles table.

A pin can want a datasheet operating range using voltage_range_v. The TLV9001 VDD pin accepts 1.8–5.5 V inclusive. It verifies a connected 3.3 V provider, reports a 12 V provider as out of range, and reports unknown voltage when a source is missing. Symbol libraries also support peripheral membership, reference prefixes, pin renaming and fractional pin angles. A rename preserves existing wire connections through pin aliases.

The powered-amplifier example places one generic two-contact connector, J1. Its P1 contact provides the external 3.3 V supply through a role declared on this placement. Designers can edit local wants and provides in the schematic pin inspector. Purpose-built library symbols can also supply inherited roles. J1 placement roles

Screenshots

Schematic with U1 selected · Symbol with VDD selected · Compact browser window

Note crossing the output wire

Drawing tools and 50 mil grid · Pin checklist · Signal animation · Parts search

3.3 V on VDD · 12 V on VDD · Pin editor · Reference prefix

Verification

The 23 schematic tests, nine language coverage tests and eight native editor UI tests passed. Chromium also exercised both voltages on the same VDD pin. Lean proves inclusive interval containment and the project axiom audit passed.

Selected the 50 mil preset in both native and Chromium builds. Editor tests cover custom pitches on both sides of the origin, off-grid pin anchors, independent arrow and dot switches, and drawing edits and undo. The annotated two-channel filter example retains the same connectivity when its graphics are removed.

Exercised save and reopen, undo and redo, branching into an existing wire, hierarchical BOM grouping, PDF byte persistence, and the language coverage ledger. Captured both editors from the desktop renderer and Chromium, including 1024 × 700. The schematic and language coverage suites passed, including scope and power-net connectivity, independent field placement and geometry collisions. Clippy passed for both the language and renderer libraries with warnings denied.

The design document records the proposed linked board document and remaining work on pin-to-pad mapping, layout, reannotation, managed libraries and variants. Editor boundaries and backend readiness

Nested libraries and schematic checks

Libraries can now contain symbols and child libraries. The Parts browser can create or link a child, find its symbols, and open the file that owns each definition. The two-channel load-switch example uses a custom MOSFET at components.discrete.switches.PowerFET. Its declared terminals participate in pin-to-pin ERC checks across repeated sheets. Example project · Native Parts browser

Schematic workspaces also support custom sheet frames, multi-page PDF export, scoped ERC waivers with reasons, occurrence-specific reference designators, variant BOMs, block duplication with wire remapping, and physical pin-to-pad net export. The guide describes how to author and review these in the editor and in .fg. Schematic guide

Copy link
Copy Markdown
Owner Author

@codex review the exact stacked editor head, focusing on save/undo, attachments, schematic connectivity, repeated-sheet BOM counts and native/browser behavior.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T12:15:25.303747Z 8b89433 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Owner Author

@codex review the editor head including the WASI PDF-test fix and the current #72 integration.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb3453f759

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +408 to +409
let before = if self.tool == Tool::Role {
self.doc.symbols.keys().find(|k| !k.contains('.')).cloned()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Insert new roles before the earliest symbol in source order

If a library declares symbols in non-alphabetical order, creating a role can insert it after symbols that need to use it: doc.symbols is a BTreeMap, so this chooses the alphabetically first symbol rather than the first declaration. For example, with Z declared before A, a newly created role is inserted between them, and assigning that role to a pin of Z then fails with UnknownRole because the reader resolves pin roles while reading each symbol. Choose the insertion point from source order so newly created roles can be assigned to every existing symbol.

Useful? React with 👍 / 👎.

if !self.library() {
for (k, v) in [
("value", quote(&f.value)),
("footprint", quote(&f.footprint)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve an absent footprint when applying unrelated properties

For a placement without a footprint argument, applying properties—even without changing any values—writes footprint: "". The reader preserves that as Some(""), whereas untouched placements retain None, and PartSpec includes this distinction in its BOM grouping key. Consequently, inspecting and applying one of two otherwise identical components splits their purchasing line into two visually identical CSV rows. Normalize empty footprints to None when reading, or preserve the absent argument when saving an empty field.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

@codex review the source-order insertion and the empty-footprint grouping fixes. All eleven schematic tests pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 6b6b2014e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

Coordinator UI review requested for the native and browser schematic and symbol editors under docs/ux/STANDARD.md. The PR description links the desktop and compact-browser captures. Please record UI sign-off or concrete revisions for the editor candidate. The PR also depends on #72 and its current-main gates.

Copy link
Copy Markdown
Owner Author

@codex review Please independently review the updated editor and schematic changes, including the latest backend integration. Coordinator UI sign-off is requested for the revised native and web captures in research/electronics/shots.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b36b571865

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +535 to +537
} else if let Some(k) = near {
let (id, pin) = k.split_once('.').unwrap_or((k, ""));
self.select(id, pin);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resolve the displayed gate before applying geometric edits

For a multi-unit component, clicking a pin on an additional gate selects the primary placement instead of the gate under the pointer. Circuit::expand names every unit’s terminals using the component owner (for example, U1.pinB), so splitting this endpoint selects U1 even when the clicked pin belongs to a separate gate(..., unit: "B") row. Subsequent Move, Rotate, or Mirror actions modify unit A while leaving the clicked unit B unchanged. Resolve the terminal’s displayed gate for geometric actions while retaining its component identity for part properties.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

@codex review Please re-review the current exact editor head. Terminal geometry now resolves through its recorded source row, while component properties retain the electrical owner. A regression on unit B separately moves, rotates and mirrors the additional gate and verifies unit A is stationary. Empty footprints already normalize to None in the schematic reader.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 73c5ac6374

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

@codex review Please independently review head 5f4a913, including the new pin inspector, overlays and grid drawing tools. Coordinator UI disposition is still needed on the editor intended to land. Please identify that head when posting sign-off.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 5f4a91361b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

@codex review f8e55d6. The GPU job found that the bundled font renders the schematic inspector's warning icon as a box. The warning now displays its count and existing text. The exact regression, every_character_the_app_shows_is_in_its_fonts, passed on this head in the merge VM. This remains stacked on #72 and awaits the coordinator's UI sign-off.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: f8e55d694b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@David-Bascom05
David-Bascom05 changed the base branch from feature/schematic-backend to main November 26, 2026 11:57

Copy link
Copy Markdown
Owner Author

@codex review bc28101 in an independent Codex Cloud session following retarget to main.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc281011da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

),
)
}
NoConnect => ("nc", format!("no_connect(sheet: {sheet}, on: {})", need()?)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow existing no-connect markers to be removed

After marking a pin as intentionally unconnected, the editor provides no way to remove that marker without undoing back to its creation or editing the source externally. Repeating this tool only adds another no_connect row, while clicking the cross selects the underlying component: the selection branch prioritizes terminal anchors, and picked() does not handle Item::NoConnect. If the user subsequently wires that pin, the inaccessible marker leaves a persistent ConnectedNoConnect error. Toggle an existing marker off here, or make markers independently selectable and deletable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

@codex review 8b89433 in a separate Codex Cloud session. The no-connect tool now removes existing markers on the same sheet and pin in one undoable edit. The focused editor test passed.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 8b89433aa2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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