Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (codex): scope catalog DOM ids by section for fanned dual-scope checks
[._.]/ Adam Eivy416b7a2b7315
diff --git a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx b/client/src/components/pipeline/editorial/EditorialCheckCard.jsxindex 2ea5b044f8..74f1e2eb8f 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.jsx@@ -88,8 +88,15 @@ function ConfigField({ checkId, field, value, disabled, onCommit, resetNonce = 0function EditorialCheckCard({check, saving = false, onToggle, onConfigSave, onSeveritySave, onEdit, onDelete,seriesId = '', seriesConfig = null, seriesSaving = false, seriesResetNonce = 0, onSeriesConfigSave,+ idScope = '',}) {const [expanded, setExpanded] = useState(false);+ // Base for this card's DOM ids. A dual-scope check (#1628) is fanned into more+ // than one catalog section, so deriving ids from `check.id` alone would render+ // duplicate `sev-`/`cfg-` ids (breaking every `htmlFor`/`id` pairing). The+ // section scope makes each fanned copy's ids unique; single-scope cards (no+ // `idScope`) keep their original ids. The API callbacks still use `check.id`.+ const domBase = idScope ? `${idScope}-${check.id}` : check.id;const [seriesExpanded, setSeriesExpanded] = useState(false);const [confirmDelete, setConfirmDelete] = useState(false);const hasConfig = Array.isArray(check.configFields) && check.configFields.length > 0;@@ -138,9 +145,9 @@ function EditorialCheckCard({{canSetSeverity ? (<div className="flex items-center gap-2">- <label htmlFor={`sev-${check.id}`} className="text-[11px] text-gray-400">Severity</label>+ <label htmlFor={`sev-${domBase}`} className="text-[11px] text-gray-400">Severity</label><select- id={`sev-${check.id}`}+ id={`sev-${domBase}`}value={check.severityOverride || ''}disabled={saving}aria-label={`Severity for ${check.label}`}@@ -172,7 +179,7 @@ function EditorialCheckCard({{check.configFields.map((field) => (<ConfigFieldkey={field.key}- checkId={check.id}+ checkId={domBase}field={field}value={check.config?.[field.key]}disabled={saving}@@ -207,9 +214,11 @@ function EditorialCheckCard({{check.configFields.map((field) => (<ConfigField// Prefix the checkId so the per-series input ids never collide- // with the global form's (`cfg-<checkId>-<key>`).+ // with the global form's (`cfg-<checkId>-<key>`). `domBase` already+ // folds in the section scope (#1628) so a fanned dual-scope check+ // stays unique here too.key={field.key}- checkId={`series-${check.id}`}+ checkId={`series-${domBase}`}field={field}value={seriesConfig?.[field.key] ?? check.config?.[field.key]}disabled={seriesSaving}diff --git a/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx b/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsxindex bc64408a7f..6904180db6 100644--- a/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx+++ b/client/src/components/pipeline/editorial/EditorialCheckCard.test.jsx@@ -24,6 +24,24 @@ describe('EditorialCheckCard', () => {expect(onToggle).toHaveBeenCalledWith('naming.dissimilar-names', false);});+ it('scopes its DOM ids by idScope so a fanned dual-scope check stays unique (#1628)', () => {+ const onSeveritySave = vi.fn();+ const { container } = render(+ <EditorialCheckCard check={check} idScope="issue" onToggle={vi.fn()} onConfigSave={vi.fn()} onSeveritySave={onSeveritySave} />,+ );+ // The severity control's id folds in the section scope; the label still pairs.+ const select = screen.getByRole('combobox', { name: /severity for/i });+ expect(select.id).toBe('sev-issue-naming.dissimilar-names');+ expect(container.querySelector('label[for="sev-issue-naming.dissimilar-names"]')).not.toBeNull();+ // The config input id is scoped too.+ fireEvent.click(screen.getByRole('button', { name: /configure/i }));+ expect(screen.getByLabelText('Minimum shared signals to flag').id)+ .toBe('cfg-issue-naming.dissimilar-names-minSharedSignals');+ // The API callback still uses the bare check id, not the scoped DOM id.+ fireEvent.change(select, { target: { value: 'high' } });+ expect(onSeveritySave).toHaveBeenCalledWith('naming.dissimilar-names', 'high');+ });+it('commits a clamped config value on blur, merged onto the existing config', () => {const onConfigSave = vi.fn();render(<EditorialCheckCard check={check} onToggle={vi.fn()} onConfigSave={onConfigSave} />);diff --git a/client/src/pages/PipelineEditorialChecks.jsx b/client/src/pages/PipelineEditorialChecks.jsxindex 9f09111faf..36d683cbe3 100644--- a/client/src/pages/PipelineEditorialChecks.jsx+++ b/client/src/pages/PipelineEditorialChecks.jsx@@ -654,10 +654,14 @@ export default function PipelineEditorialChecks() {<div key={group.scope} className="space-y-2"><h3 className="text-[11px] font-medium uppercase tracking-wider text-gray-500">{group.label}</h3>{group.checks.map((check) => (- <div key={check.id} className="flex items-start gap-2">+ // A dual-scope check (#1628) is fanned into multiple sections, so+ // scope the per-row DOM ids (selection checkbox + the card's ids,+ // via `idScope`) by the section to keep them unique. The React key+ // and all state/selection keys stay `check.id` (the check identity).+ <div key={`${group.scope}-${check.id}`} className="flex items-start gap-2"><inputtype="checkbox"- id={`sel-${check.id}`}+ id={`sel-${group.scope}-${check.id}`}checked={selectedIds.has(check.id)}disabled={!check.enabled}onChange={() => toggleSelected(check.id)}@@ -668,6 +672,7 @@ export default function PipelineEditorialChecks() {<div className="min-w-0 flex-1"><EditorialCheckCardcheck={check}+ idScope={group.scope}saving={savingIds.has(check.id)}onToggle={handleToggle}onConfigSave={handleConfigSave}