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

Replace window.confirm with inline confirmations

Adam Eivy950d14bf2574
diff --git a/PLAN.md b/PLAN.md
index f9eceb46f8..613a32d6f4 100644
--- a/PLAN.md
+++ b/PLAN.md
@@ -34,6 +34,11 @@ pm2 logs
- [x] M5: AI providers + headless executor
- [x] M6: Dev tools (history, command runner)
+### Code Guidelines
+- **No `window.alert` or `window.confirm`** - Use inline confirmation components or toast notifications for better UX
+- Favor functional components and hooks over class components
+- Use Tailwind for all styling
+
---
## M4: App Wizard (Detailed)
diff --git a/client/src/pages/Apps.jsx b/client/src/pages/Apps.jsx
index 4c2985c9a8..7760a98577 100644
--- a/client/src/pages/Apps.jsx
+++ b/client/src/pages/Apps.jsx
@@ -7,6 +7,7 @@ export default function Apps() {
const [apps, setApps] = useState([]);
const [loading, setLoading] = useState(true);
const [editingApp, setEditingApp] = useState(null);
+ const [confirmingDelete, setConfirmingDelete] = useState(null);
const fetchApps = async () => {
const data = await api.getApps().catch(() => []);
@@ -19,8 +20,8 @@ export default function Apps() {
}, []);
const handleDelete = async (app) => {
- if (!confirm(`Delete "${app.name}"? This only removes it from PortOS, not the actual files.`)) return;
await api.deleteApp(app.id);
+ setConfirmingDelete(null);
fetchApps();
};
@@ -97,18 +98,38 @@ export default function Apps() {
<StatusBadge status={app.overallStatus} size="sm" />
</td>
<td className="px-4 py-3 text-right">
- <button
- onClick={() => setEditingApp(app)}
- className="text-sm text-port-accent hover:text-port-accent/80 mr-3"
- >
- Edit
- </button>
- <button
- onClick={() => handleDelete(app)}
- className="text-sm text-port-error hover:text-port-error/80"
- >
- Delete
- </button>
+ {confirmingDelete === app.id ? (
+ <div className="flex items-center justify-end gap-2">
+ <span className="text-xs text-gray-400">Remove from PortOS?</span>
+ <button
+ onClick={() => handleDelete(app)}
+ className="text-sm px-2 py-1 bg-port-error/20 text-port-error hover:bg-port-error/30 rounded"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => setConfirmingDelete(null)}
+ className="text-sm px-2 py-1 text-gray-400 hover:text-white"
+ >
+ No
+ </button>
+ </div>
+ ) : (
+ <>
+ <button
+ onClick={() => setEditingApp(app)}
+ className="text-sm text-port-accent hover:text-port-accent/80 mr-3"
+ >
+ Edit
+ </button>
+ <button
+ onClick={() => setConfirmingDelete(app.id)}
+ className="text-sm text-port-error hover:text-port-error/80"
+ >
+ Delete
+ </button>
+ </>
+ )}
</td>
</tr>
))}
diff --git a/client/src/pages/DevTools.jsx b/client/src/pages/DevTools.jsx
index 7727dcb18d..eb7394a17c 100644
--- a/client/src/pages/DevTools.jsx
+++ b/client/src/pages/DevTools.jsx
@@ -48,6 +48,7 @@ function HistoryTab() {
const [loading, setLoading] = useState(true);
const [filter, setFilter] = useState({ action: '', success: '' });
const [actions, setActions] = useState([]);
+ const [confirmingClear, setConfirmingClear] = useState(false);
useEffect(() => {
loadData();
@@ -71,10 +72,9 @@ function HistoryTab() {
};
const handleClear = async () => {
- if (confirm('Clear all history?')) {
- await api.clearHistory();
- loadData();
- }
+ await api.clearHistory();
+ setConfirmingClear(false);
+ loadData();
};
const formatTime = (timestamp) => {
@@ -153,12 +153,30 @@ function HistoryTab() {
<div className="flex-1" />
- <button
- onClick={handleClear}
- className="px-4 py-2 bg-port-error/20 text-port-error hover:bg-port-error/30 rounded-lg transition-colors"
- >
- Clear History
- </button>
+ {confirmingClear ? (
+ <div className="flex items-center gap-2">
+ <span className="text-sm text-gray-400">Clear all history?</span>
+ <button
+ onClick={handleClear}
+ className="px-3 py-1.5 bg-port-error/20 text-port-error hover:bg-port-error/30 rounded-lg transition-colors"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => setConfirmingClear(false)}
+ className="px-3 py-1.5 text-gray-400 hover:text-white"
+ >
+ No
+ </button>
+ </div>
+ ) : (
+ <button
+ onClick={() => setConfirmingClear(true)}
+ className="px-4 py-2 bg-port-error/20 text-port-error hover:bg-port-error/30 rounded-lg transition-colors"
+ >
+ Clear History
+ </button>
+ )}
</div>
{/* History List */}