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

address review (claude): make POST drill toggles accessible switches

[._.]/ Adam Eivy3499e1574938
diff --git a/client/src/components/meatspace/post/PostDrillConfig.jsx b/client/src/components/meatspace/post/PostDrillConfig.jsx
index b25206194b..b61b7d97c2 100644
--- a/client/src/components/meatspace/post/PostDrillConfig.jsx
+++ b/client/src/components/meatspace/post/PostDrillConfig.jsx
@@ -121,6 +121,10 @@ function DrillCard({ meta, drillConfig, enabled, accent, onToggle, onUpdateField
<p className="text-gray-500 text-xs">{meta.desc}</p>
</div>
<button
+ type="button"
+ role="switch"
+ aria-checked={enabled}
+ aria-label={meta.label}
onClick={onToggle}
className={`shrink-0 w-10 h-5 rounded-full transition-colors relative ${
enabled ? toggleBg : 'bg-port-border'
@@ -281,6 +285,10 @@ export default function PostDrillConfig({ config, onSaved, onBack }) {
<h3 className="text-sm font-medium text-gray-500 uppercase tracking-wider">Wit &amp; Memory (LLM)</h3>
</div>
<button
+ type="button"
+ role="switch"
+ aria-checked={llmEnabled}
+ aria-label="Wit & Memory (LLM) drills"
onClick={() => setLlmEnabled(!llmEnabled)}
className={`shrink-0 w-10 h-5 rounded-full transition-colors relative ${
llmEnabled ? 'bg-port-accent-2' : 'bg-port-border'
diff --git a/client/src/components/meatspace/post/PostDrillConfig.test.jsx b/client/src/components/meatspace/post/PostDrillConfig.test.jsx
index c1fb9e9c7b..eccc68eb8a 100644
--- a/client/src/components/meatspace/post/PostDrillConfig.test.jsx
+++ b/client/src/components/meatspace/post/PostDrillConfig.test.jsx
@@ -84,4 +84,24 @@ describe('PostDrillConfig', () => {
expect(saved[t].enabled).toBe(false);
}
});
+
+ it('enabling a newly-exposed drill persists it as enabled', async () => {
+ render(<PostDrillConfig config={config} onSaved={vi.fn()} onBack={vi.fn()} />);
+ // Toggle the "What If?" card (a previously-inaccessible imagination drill) on.
+ fireEvent.click(screen.getByRole('switch', { name: 'What If?' }));
+ fireEvent.click(screen.getByText('Save'));
+ await waitFor(() => expect(updatePostConfig).toHaveBeenCalled());
+
+ const saved = updatePostConfig.mock.calls[0][0].llmDrills.drillTypes;
+ expect(saved['what-if'].enabled).toBe(true);
+ // A sibling imagination drill left untouched stays disabled.
+ expect(saved['reframe'].enabled).toBe(false);
+ });
+
+ it('exposes toggles as accessible switches reflecting on/off state', () => {
+ render(<PostDrillConfig config={config} onSaved={vi.fn()} onBack={vi.fn()} />);
+ // Legacy enabled drill → switch checked; newly-exposed drill → unchecked.
+ expect(screen.getByRole('switch', { name: 'Pun & Wordplay' }).getAttribute('aria-checked')).toBe('true');
+ expect(screen.getByRole('switch', { name: 'Reframe' }).getAttribute('aria-checked')).toBe('false');
+ });
});