A Loxone-style working aids: named signals, inverted inputs, a project check, values on cables, search, printable sheets; wire ends move by dragging
- Send signal / Use signal: name a signal (CLK, RESET) once and use it anywhere in the circuit without a wire; selecting one lights up all of them, a use with no sender shows dashed
- Inverted inputs: Alt + click an input (or the menu/settings) puts a bubble on it; it reads the signal inverted through one NAND, counted in every transistor total
- Check (Circuit tab): open inputs, parts that drive nothing, duplicate pin names, unsent or doubly sent signals, loops that never settle; click one to show it. Open inputs get an orange marker on the canvas. Components no other circuit uses are listed with a delete
- Cables show the number they carry (= 13 · 0x0D); hovering a wire tells where it runs and its value
- Ctrl+F finds parts, signals, panel rows, notes and components in every circuit, with where each component is used
- Ctrl+P prints the circuit as a sheet with a title block on white paper (or save as PDF); also as an SVG file
- + and − under a selected gate change its number of inputs; swaps keep bubbles in place
- Drag a wire by its end to move that end to another pin; drop a dragged wire on another wire to tap its signal or feed what it fed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:26:59 +00:00
// Checking a circuit for mistakes that still simulate but rarely mean what
// was intended: inputs left open (they read 0), parts that drive nothing,
// pins that share a name, and signals nothing sends or two parts send.
import { chipPins , shapeOf , type DefLookup } from './geometry'
import { KIND_NAMES } from './progress'
import type { CircuitNode , ComponentDef , Project } from './types'
export type IssueLevel = 'error' | 'warn' | 'info'
export interface Issue {
level : IssueLevel
text : string
/** Parts to show for it; the first one is centred. */
nodes : string [ ]
}
/** Parts whose open inputs are worth a warning (a cable bundle's spare wires are not). */
2026-10-21 12:38:59 +00:00
export const CHECKED_INPUTS = new Set ( [ 'nand' , 'chip' , 'output' , 'lamp' , 'hex' , 'pixel' , 'tag' , 'outpanel' ] )
A Loxone-style working aids: named signals, inverted inputs, a project check, values on cables, search, printable sheets; wire ends move by dragging
- Send signal / Use signal: name a signal (CLK, RESET) once and use it anywhere in the circuit without a wire; selecting one lights up all of them, a use with no sender shows dashed
- Inverted inputs: Alt + click an input (or the menu/settings) puts a bubble on it; it reads the signal inverted through one NAND, counted in every transistor total
- Check (Circuit tab): open inputs, parts that drive nothing, duplicate pin names, unsent or doubly sent signals, loops that never settle; click one to show it. Open inputs get an orange marker on the canvas. Components no other circuit uses are listed with a delete
- Cables show the number they carry (= 13 · 0x0D); hovering a wire tells where it runs and its value
- Ctrl+F finds parts, signals, panel rows, notes and components in every circuit, with where each component is used
- Ctrl+P prints the circuit as a sheet with a title block on white paper (or save as PDF); also as an SVG file
- + and − under a selected gate change its number of inputs; swaps keep bubbles in place
- Drag a wire by its end to move that end to another pin; drop a dragged wire on another wire to tap its signal or feed what it fed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:26:59 +00:00
function partName ( n : CircuitNode , get : DefLookup ) : string {
const own = ! n . autoLabel && n . label ? . trim ( )
const kind = n . kind === 'chip' ? ( ( n . chip && get ( n . chip ) ? . name ) ? ? 'Missing component' ) : ( KIND_NAMES [ n . kind ] ? ? n . kind )
if ( n . kind === 'tag' || n . kind === 'ref' ) return ` ${ kind } " ${ n . label ? . trim ( ) || '?' } " `
return own ? ` ${ kind } ${ own } ` : ( n . label ? . trim ( ) ? ` ${ kind } ${ n . label . trim ( ) } ` : kind )
}
BF split ports: no wire against the cable, pins that stay put, lines kept on unpack
A wire dropped on a socket with a cable in it only takes a line coming
out; the lines going in are the cable's, so it no longer drives one
against the cable. Wired by hand anyway, the check calls that an error,
like a signal sent by two parts. A line going in with neither a wire nor
a cable gets the usual "not connected (reads 0)" warning and marker.
While a wire is drawn over a socket it ends on the socket, where it goes
when let go, not on the pin below. Splitting or joining a port no longer
moves the pins on the other side of the box. Pins on their usual edge
come first, so a wire dropped on the box body takes those, and the cable
button only offers pins whose cable end sits outside the box.
Unpacking a component joins wires on its split lines to the parts that
used the line inside; wires that had nowhere to go are counted in a
notice. Docked panels line up with the moved ports when a project is
opened, not at the next edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:38:32 +00:00
/** Pins of a part with a wire or cable, coming in or going out. */
const linkedPins = ( def : ComponentDef , n : CircuitNode ) = > new Set ( def . wires . flatMap ( w = > [ w . to . node === n . id ? w . to . pin : '' , w . from . node === n . id ? w . from . pin : '' ] ) )
/** Input pins of a part that have no wire (a line of a split port is fed by the cable when one is in its socket). */
A Loxone-style working aids: named signals, inverted inputs, a project check, values on cables, search, printable sheets; wire ends move by dragging
- Send signal / Use signal: name a signal (CLK, RESET) once and use it anywhere in the circuit without a wire; selecting one lights up all of them, a use with no sender shows dashed
- Inverted inputs: Alt + click an input (or the menu/settings) puts a bubble on it; it reads the signal inverted through one NAND, counted in every transistor total
- Check (Circuit tab): open inputs, parts that drive nothing, duplicate pin names, unsent or doubly sent signals, loops that never settle; click one to show it. Open inputs get an orange marker on the canvas. Components no other circuit uses are listed with a delete
- Cables show the number they carry (= 13 · 0x0D); hovering a wire tells where it runs and its value
- Ctrl+F finds parts, signals, panel rows, notes and components in every circuit, with where each component is used
- Ctrl+P prints the circuit as a sheet with a title block on white paper (or save as PDF); also as an SVG file
- + and − under a selected gate change its number of inputs; swaps keep bubbles in place
- Drag a wire by its end to move that end to another pin; drop a dragged wire on another wire to tap its signal or feed what it fed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:26:59 +00:00
export function openInputs ( def : ComponentDef , n : CircuitNode , get : DefLookup ) : string [ ] {
if ( ! CHECKED_INPUTS . has ( n . kind ) ) return [ ]
BF split ports: no wire against the cable, pins that stay put, lines kept on unpack
A wire dropped on a socket with a cable in it only takes a line coming
out; the lines going in are the cable's, so it no longer drives one
against the cable. Wired by hand anyway, the check calls that an error,
like a signal sent by two parts. A line going in with neither a wire nor
a cable gets the usual "not connected (reads 0)" warning and marker.
While a wire is drawn over a socket it ends on the socket, where it goes
when let go, not on the pin below. Splitting or joining a port no longer
moves the pins on the other side of the box. Pins on their usual edge
come first, so a wire dropped on the box body takes those, and the cable
button only offers pins whose cable end sits outside the box.
Unpacking a component joins wires on its split lines to the parts that
used the line inside; wires that had nowhere to go are counted in a
notice. Docked panels line up with the moved ports when a project is
opened, not at the next edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:38:32 +00:00
const linked = linkedPins ( def , n )
A Loxone-style working aids: named signals, inverted inputs, a project check, values on cables, search, printable sheets; wire ends move by dragging
- Send signal / Use signal: name a signal (CLK, RESET) once and use it anywhere in the circuit without a wire; selecting one lights up all of them, a use with no sender shows dashed
- Inverted inputs: Alt + click an input (or the menu/settings) puts a bubble on it; it reads the signal inverted through one NAND, counted in every transistor total
- Check (Circuit tab): open inputs, parts that drive nothing, duplicate pin names, unsent or doubly sent signals, loops that never settle; click one to show it. Open inputs get an orange marker on the canvas. Components no other circuit uses are listed with a delete
- Cables show the number they carry (= 13 · 0x0D); hovering a wire tells where it runs and its value
- Ctrl+F finds parts, signals, panel rows, notes and components in every circuit, with where each component is used
- Ctrl+P prints the circuit as a sheet with a title block on white paper (or save as PDF); also as an SVG file
- + and − under a selected gate change its number of inputs; swaps keep bubbles in place
- Drag a wire by its end to move that end to another pin; drop a dragged wire on another wire to tap its signal or feed what it fed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:26:59 +00:00
const wired = new Set ( def . wires . filter ( w = > w . to . node === n . id ) . map ( w = > w . to . pin ) )
2026-10-28 11:51:09 +00:00
// An RGB pixel may use only some of its colours.
if ( n . kind === 'pixel' && n . rgb && wired . size ) return [ ]
BF split ports: no wire against the cable, pins that stay put, lines kept on unpack
A wire dropped on a socket with a cable in it only takes a line coming
out; the lines going in are the cable's, so it no longer drives one
against the cable. Wired by hand anyway, the check calls that an error,
like a signal sent by two parts. A line going in with neither a wire nor
a cable gets the usual "not connected (reads 0)" warning and marker.
While a wire is drawn over a socket it ends on the socket, where it goes
when let go, not on the pin below. Splitting or joining a port no longer
moves the pins on the other side of the box. Pins on their usual edge
come first, so a wire dropped on the box body takes those, and the cable
button only offers pins whose cable end sits outside the box.
Unpacking a component joins wires on its split lines to the parts that
used the line inside; wires that had nowhere to go are counted in a
notice. Docked panels line up with the moved ports when a project is
opened, not at the next edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:38:32 +00:00
return shapeOf ( n , get ) . inputs . filter ( p = > ! p . bus && ! ( p . port && linked . has ( p . port ) ) && ! wired . has ( p . key ) ) . map ( p = > p . key )
A ports on top of the box, split into lines to wire by hand
On a component's box every connector port now sits at the very top of its
side, above the single pins, in auto and hand-drawn boxes alike. A port
can be split on one placed component (its settings or right click: Split
… into lines): right below the socket the box then gets a pin per line,
named after the line, so lines can be wired by hand without an adapter.
Lines going into the component are inputs, lines coming out outputs, each
facing out of its side; a bar in the type's colour ties them to the
socket. A cable still plugs into the socket at the same time. Dropping a
single wire on a socket (or clicking one while connecting) splits the
port and takes the first free line that runs that way. Join … lines
takes the line pins and their wires away again, as one undo step.
A line wired by hand joins the same net the cable's line reaches inside;
a wire and a cable on one line both drive it, and the check says so.
Line pins are left out of the open-input warning, docked panels and
bubbles; docked panels no longer get a row for a port's socket either.
Saved as an optional list on the placed component (splitPorts); without
it a box only has its ports moved to the top.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:08:27 +00:00
}
/** Lines of split ports on a component's box that are wired by hand while a cable is plugged into their port. */
export function doublyFedLines ( def : ComponentDef , n : CircuitNode , get : DefLookup ) : string [ ] {
if ( n . kind !== 'chip' || ! n . splitPorts ? . length ) return [ ]
BF split ports: no wire against the cable, pins that stay put, lines kept on unpack
A wire dropped on a socket with a cable in it only takes a line coming
out; the lines going in are the cable's, so it no longer drives one
against the cable. Wired by hand anyway, the check calls that an error,
like a signal sent by two parts. A line going in with neither a wire nor
a cable gets the usual "not connected (reads 0)" warning and marker.
While a wire is drawn over a socket it ends on the socket, where it goes
when let go, not on the pin below. Splitting or joining a port no longer
moves the pins on the other side of the box. Pins on their usual edge
come first, so a wire dropped on the box body takes those, and the cable
button only offers pins whose cable end sits outside the box.
Unpacking a component joins wires on its split lines to the parts that
used the line inside; wires that had nowhere to go are counted in a
notice. Docked panels line up with the moved ports when a project is
opened, not at the next edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:38:32 +00:00
const linked = linkedPins ( def , n )
A ports on top of the box, split into lines to wire by hand
On a component's box every connector port now sits at the very top of its
side, above the single pins, in auto and hand-drawn boxes alike. A port
can be split on one placed component (its settings or right click: Split
… into lines): right below the socket the box then gets a pin per line,
named after the line, so lines can be wired by hand without an adapter.
Lines going into the component are inputs, lines coming out outputs, each
facing out of its side; a bar in the type's colour ties them to the
socket. A cable still plugs into the socket at the same time. Dropping a
single wire on a socket (or clicking one while connecting) splits the
port and takes the first free line that runs that way. Join … lines
takes the line pins and their wires away again, as one undo step.
A line wired by hand joins the same net the cable's line reaches inside;
a wire and a cable on one line both drive it, and the check says so.
Line pins are left out of the open-input warning, docked panels and
bubbles; docked panels no longer get a row for a port's socket either.
Saved as an optional list on the placed component (splitPorts); without
it a box only has its ports moved to the top.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:08:27 +00:00
return shapeOf ( n , get ) . inputs . filter ( p = > p . port && linked . has ( p . key ) && linked . has ( p . port ) ) . map ( p = > p . key )
A Loxone-style working aids: named signals, inverted inputs, a project check, values on cables, search, printable sheets; wire ends move by dragging
- Send signal / Use signal: name a signal (CLK, RESET) once and use it anywhere in the circuit without a wire; selecting one lights up all of them, a use with no sender shows dashed
- Inverted inputs: Alt + click an input (or the menu/settings) puts a bubble on it; it reads the signal inverted through one NAND, counted in every transistor total
- Check (Circuit tab): open inputs, parts that drive nothing, duplicate pin names, unsent or doubly sent signals, loops that never settle; click one to show it. Open inputs get an orange marker on the canvas. Components no other circuit uses are listed with a delete
- Cables show the number they carry (= 13 · 0x0D); hovering a wire tells where it runs and its value
- Ctrl+F finds parts, signals, panel rows, notes and components in every circuit, with where each component is used
- Ctrl+P prints the circuit as a sheet with a title block on white paper (or save as PDF); also as an SVG file
- + and − under a selected gate change its number of inputs; swaps keep bubbles in place
- Drag a wire by its end to move that end to another pin; drop a dragged wire on another wire to tap its signal or feed what it fed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:26:59 +00:00
}
export function checkCircuit ( def : ComponentDef , get : DefLookup ) : Issue [ ] {
const issues : Issue [ ] = [ ]
const fed = new Set ( def . wires . map ( w = > ` ${ w . from . node } : ${ w . from . pin } ` ) )
const name = ( n : CircuitNode ) = > partName ( n , get )
for ( const n of def . nodes ) {
if ( n . kind === 'chip' && ( ! n . chip || ! get ( n . chip ) ) ) {
issues . push ( { level : 'error' , text : 'A placed component no longer exists' , nodes : [ n . id ] } )
continue
}
const open = openInputs ( def , n , get )
if ( open . length ) {
const shape = shapeOf ( n , get )
const labels = open . map ( k = > shape . inputs . find ( p = > p . key === k ) ? . label || k )
const all = open . length === shape . inputs . length
const text =
n . kind === 'chip' || n . kind === 'nand' || n . kind === 'hex'
? ` ${ name ( n ) } : ${ all ? 'no input connected' : ` ${ labels . join ( ', ' ) } not connected ` } (reads 0) `
: ` ${ name ( n ) } : nothing connected `
issues . push ( { level : 'warn' , text , nodes : [ n . id ] } )
}
if ( n . kind === 'split' && ! def . wires . some ( w = > w . to . node === n . id ) ) issues . push ( { level : 'warn' , text : 'Cable split without a cable' , nodes : [ n . id ] } )
A ports on top of the box, split into lines to wire by hand
On a component's box every connector port now sits at the very top of its
side, above the single pins, in auto and hand-drawn boxes alike. A port
can be split on one placed component (its settings or right click: Split
… into lines): right below the socket the box then gets a pin per line,
named after the line, so lines can be wired by hand without an adapter.
Lines going into the component are inputs, lines coming out outputs, each
facing out of its side; a bar in the type's colour ties them to the
socket. A cable still plugs into the socket at the same time. Dropping a
single wire on a socket (or clicking one while connecting) splits the
port and takes the first free line that runs that way. Join … lines
takes the line pins and their wires away again, as one undo step.
A line wired by hand joins the same net the cable's line reaches inside;
a wire and a cable on one line both drive it, and the check says so.
Line pins are left out of the open-input warning, docked panels and
bubbles; docked panels no longer get a row for a port's socket either.
Saved as an optional list on the placed component (splitPorts); without
it a box only has its ports moved to the top.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:08:27 +00:00
const twice = doublyFedLines ( def , n , get )
if ( twice . length ) {
const shape = shapeOf ( n , get )
const labels = twice . map ( k = > shape . inputs . find ( p = > p . key === k ) ? . label || k )
BF split ports: no wire against the cable, pins that stay put, lines kept on unpack
A wire dropped on a socket with a cable in it only takes a line coming
out; the lines going in are the cable's, so it no longer drives one
against the cable. Wired by hand anyway, the check calls that an error,
like a signal sent by two parts. A line going in with neither a wire nor
a cable gets the usual "not connected (reads 0)" warning and marker.
While a wire is drawn over a socket it ends on the socket, where it goes
when let go, not on the pin below. Splitting or joining a port no longer
moves the pins on the other side of the box. Pins on their usual edge
come first, so a wire dropped on the box body takes those, and the cable
button only offers pins whose cable end sits outside the box.
Unpacking a component joins wires on its split lines to the parts that
used the line inside; wires that had nowhere to go are counted in a
notice. Docked panels line up with the moved ports when a project is
opened, not at the next edit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:38:32 +00:00
issues . push ( { level : 'error' , text : ` ${ name ( n ) } : ${ labels . join ( ', ' ) } wired and fed by the cable as well: they drive ${ twice . length === 1 ? 'it' : 'them' } against each other ` , nodes : [ n . id ] } )
A ports on top of the box, split into lines to wire by hand
On a component's box every connector port now sits at the very top of its
side, above the single pins, in auto and hand-drawn boxes alike. A port
can be split on one placed component (its settings or right click: Split
… into lines): right below the socket the box then gets a pin per line,
named after the line, so lines can be wired by hand without an adapter.
Lines going into the component are inputs, lines coming out outputs, each
facing out of its side; a bar in the type's colour ties them to the
socket. A cable still plugs into the socket at the same time. Dropping a
single wire on a socket (or clicking one while connecting) splits the
port and takes the first free line that runs that way. Join … lines
takes the line pins and their wires away again, as one undo step.
A line wired by hand joins the same net the cable's line reaches inside;
a wire and a cable on one line both drive it, and the check says so.
Line pins are left out of the open-input warning, docked panels and
bubbles; docked panels no longer get a row for a port's socket either.
Saved as an optional list on the placed component (splitPorts); without
it a box only has its ports moved to the top.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:08:27 +00:00
}
A Loxone-style working aids: named signals, inverted inputs, a project check, values on cables, search, printable sheets; wire ends move by dragging
- Send signal / Use signal: name a signal (CLK, RESET) once and use it anywhere in the circuit without a wire; selecting one lights up all of them, a use with no sender shows dashed
- Inverted inputs: Alt + click an input (or the menu/settings) puts a bubble on it; it reads the signal inverted through one NAND, counted in every transistor total
- Check (Circuit tab): open inputs, parts that drive nothing, duplicate pin names, unsent or doubly sent signals, loops that never settle; click one to show it. Open inputs get an orange marker on the canvas. Components no other circuit uses are listed with a delete
- Cables show the number they carry (= 13 · 0x0D); hovering a wire tells where it runs and its value
- Ctrl+F finds parts, signals, panel rows, notes and components in every circuit, with where each component is used
- Ctrl+P prints the circuit as a sheet with a title block on white paper (or save as PDF); also as an SVG file
- + and − under a selected gate change its number of inputs; swaps keep bubbles in place
- Drag a wire by its end to move that end to another pin; drop a dragged wire on another wire to tap its signal or feed what it fed
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-21 11:26:59 +00:00
// Parts that drive nothing.
if ( ( n . kind === 'input' || n . kind === 'button' || n . kind === 'clock' || n . kind === 'nand' ) && ! fed . has ( ` ${ n . id } :q ` ) ) {
issues . push ( { level : 'info' , text : n.kind === 'nand' ? 'NAND gate: its output goes nowhere' : ` ${ name ( n ) } : goes nowhere ` , nodes : [ n . id ] } )
}
if ( n . kind === 'chip' && n . chip ) {
const outs = chipPins ( get ( n . chip ) ! ) . outputs
if ( outs . length && ! outs . some ( p = > fed . has ( ` ${ n . id } : ${ p . key } ` ) ) ) issues . push ( { level : 'info' , text : ` ${ name ( n ) } : none of its outputs is used ` , nodes : [ n . id ] } )
}
}
// Pins of the same name can't be told apart from outside.
for ( const kind of [ 'input' , 'output' ] as const ) {
const by = new Map < string , CircuitNode [ ] > ( )
for ( const n of def . nodes ) {
const l = n . kind === kind ? n . label ? . trim ( ) : ''
if ( l ) by . set ( l . toLowerCase ( ) , [ . . . ( by . get ( l . toLowerCase ( ) ) ? ? [ ] ) , n ] )
}
for ( const list of by . values ( ) ) {
if ( list . length > 1 ) issues . push ( { level : 'warn' , text : ` ${ list . length } ${ kind } pins are called ${ list [ 0 ] ! . label ! . trim ( ) } ` , nodes : list.map ( n = > n . id ) } )
}
}
// Signals: sent once, used somewhere.
const tags = new Map < string , CircuitNode [ ] > ( )
const refs = new Map < string , CircuitNode [ ] > ( )
for ( const n of def . nodes ) {
const l = n . label ? . trim ( ) ? ? ''
if ( n . kind === 'tag' ) tags . set ( l , [ . . . ( tags . get ( l ) ? ? [ ] ) , n ] )
if ( n . kind === 'ref' ) refs . set ( l , [ . . . ( refs . get ( l ) ? ? [ ] ) , n ] )
}
for ( const [ l , list ] of tags ) {
if ( ! l ) issues . push ( { level : 'warn' , text : 'A "Send signal" has no name' , nodes : list.map ( n = > n . id ) } )
else if ( list . length > 1 ) issues . push ( { level : 'error' , text : ` Signal " ${ l } " is sent by ${ list . length } parts: they drive it against each other ` , nodes : list.map ( n = > n . id ) } )
else if ( ! refs . has ( l ) ) issues . push ( { level : 'info' , text : ` Signal " ${ l } " is sent but not used ` , nodes : list.map ( n = > n . id ) } )
}
for ( const [ l , list ] of refs ) {
if ( ! tags . has ( l ) ) issues . push ( { level : 'error' , text : l ? ` Nothing sends signal " ${ l } " (reads 0) ` : 'A "Use signal" has no name' , nodes : list.map ( n = > n . id ) } )
}
const rank : Record < IssueLevel , number > = { error : 0 , warn : 1 , info : 2 }
return issues . sort ( ( a , b ) = > rank [ a . level ] - rank [ b . level ] )
}
/ * *
* Components made in this project that no other circuit places . Some are
* circuits you work in directly ; the rest can go . The examples are left out .
* /
export function unusedComponents ( project : Project ) : ComponentDef [ ] {
const used = new Set < string > ( )
for ( const d of project . components ) for ( const n of d . nodes ) if ( n . kind === 'chip' && n . chip && n . chip !== d . id ) used . add ( n . chip )
return project . components . filter ( d = > ! used . has ( d . id ) && ! d . id . startsWith ( 'ex-' ) && ! d . challenge )
}