Skip to content

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

fix([issue-710]): address claude+codex review on ProvenanceChip

[._.]/ Adam Eivy00c9fe2b14b6
diff --git a/client/src/components/meatspace/tabs/AgeTab.jsx b/client/src/components/meatspace/tabs/AgeTab.jsx
index 852c2df645..0418d4445d 100644
--- a/client/src/components/meatspace/tabs/AgeTab.jsx
+++ b/client/src/components/meatspace/tabs/AgeTab.jsx
@@ -69,14 +69,14 @@ function BirthDateSection({ birthDate, onUpdate }) {
<div>
<p className="text-2xl font-mono font-bold text-white">{birthDate}</p>
{age != null && (
- <p className="text-sm text-gray-500 mt-1 flex items-center gap-2">
- Chronological age: {age} years
+ <div className="text-sm text-gray-500 mt-1 flex items-center gap-2">
+ <span>Chronological age: {age} years</span>
<ProvenanceChip
level="data-backed"
explainer="Counted directly from the birth date on record — a fact, not an estimate."
whatWouldChange="Correcting the birth date above."
/>
- </p>
+ </div>
)}
</div>
<button
diff --git a/client/src/components/ui/ProvenanceChip.jsx b/client/src/components/ui/ProvenanceChip.jsx
index 8fb431c196..ffe64e6c35 100644
--- a/client/src/components/ui/ProvenanceChip.jsx
+++ b/client/src/components/ui/ProvenanceChip.jsx
@@ -67,7 +67,6 @@ export default function ProvenanceChip({
type="button"
onClick={() => setOpen((v) => !v)}
aria-expanded={open}
- aria-haspopup="dialog"
aria-controls={open ? popId : undefined}
title={`${meta.label} — tap for how this is derived`}
className={`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide transition-colors ${chipTone}`}
@@ -79,9 +78,7 @@ export default function ProvenanceChip({
{open && (
<div
id={popId}
- role="dialog"
- aria-label={`${meta.label} provenance`}
- className="absolute left-0 top-full z-30 mt-1.5 w-64 rounded-lg border border-port-border bg-port-card p-3 text-left shadow-xl"
+ className="absolute left-0 top-full z-30 mt-1.5 w-64 max-w-[calc(100vw-2rem)] rounded-lg border border-port-border bg-port-card p-3 text-left shadow-xl"
>
<p className="mb-1 flex items-center gap-1.5 text-xs font-semibold text-gray-200 normal-case tracking-normal">
<Icon size={12} aria-hidden="true" className={`shrink-0 ${iconTone}`} />
diff --git a/client/src/components/ui/ProvenanceChip.test.jsx b/client/src/components/ui/ProvenanceChip.test.jsx
index 581c840eff..371161b740 100644
--- a/client/src/components/ui/ProvenanceChip.test.jsx
+++ b/client/src/components/ui/ProvenanceChip.test.jsx
@@ -20,15 +20,14 @@ describe('ProvenanceChip', () => {
it('reveals the default explainer and "what would change this?" on click', () => {
render(<ProvenanceChip level="speculative" />);
const btn = screen.getByRole('button');
- expect(screen.queryByRole('dialog')).toBeNull();
+ expect(screen.queryByText('What would change this?')).toBeNull();
fireEvent.click(btn);
expect(btn).toHaveAttribute('aria-expanded', 'true');
- const dialog = screen.getByRole('dialog');
- expect(dialog.textContent).toContain(PROVENANCE_LEVELS.speculative.description);
- expect(dialog.textContent).toContain('What would change this?');
- expect(dialog.textContent).toContain(PROVENANCE_LEVELS.speculative.whatWouldChange);
+ expect(screen.getByText('What would change this?')).toBeTruthy();
+ expect(screen.getByText(PROVENANCE_LEVELS.speculative.description)).toBeTruthy();
+ expect(screen.getByText(PROVENANCE_LEVELS.speculative.whatWouldChange)).toBeTruthy();
});
it('prefers custom explainer / whatWouldChange copy over the level defaults', () => {
@@ -40,10 +39,9 @@ describe('ProvenanceChip', () => {
/>,
);
fireEvent.click(screen.getByRole('button'));
- const dialog = screen.getByRole('dialog');
- expect(dialog.textContent).toContain('Custom how-derived copy.');
- expect(dialog.textContent).toContain('Custom change copy.');
- expect(dialog.textContent).not.toContain(PROVENANCE_LEVELS.inferred.description);
+ expect(screen.getByText('Custom how-derived copy.')).toBeTruthy();
+ expect(screen.getByText('Custom change copy.')).toBeTruthy();
+ expect(screen.queryByText(PROVENANCE_LEVELS.inferred.description)).toBeNull();
});
it('overrides the chip label when label prop is set, keeping the resolved tone', () => {
@@ -60,17 +58,17 @@ describe('ProvenanceChip', () => {
</div>,
);
fireEvent.click(screen.getByRole('button', { name: /inferred/i }));
- expect(screen.getByRole('dialog')).toBeTruthy();
+ expect(screen.getByText('What would change this?')).toBeTruthy();
fireEvent.mouseDown(screen.getByRole('button', { name: 'elsewhere' }));
- expect(screen.queryByRole('dialog')).toBeNull();
+ expect(screen.queryByText('What would change this?')).toBeNull();
});
it('closes the popover on Escape', () => {
render(<ProvenanceChip level="inferred" />);
const btn = screen.getByRole('button');
fireEvent.click(btn);
- expect(screen.getByRole('dialog')).toBeTruthy();
+ expect(screen.getByText('What would change this?')).toBeTruthy();
fireEvent.keyDown(document, { key: 'Escape' });
- expect(screen.queryByRole('dialog')).toBeNull();
+ expect(screen.queryByText('What would change this?')).toBeNull();
});
});