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: fix unreviewed count, memoize DayView, escape CDP injections

Adam Eivy7b7d51ad4dcf
diff --git a/client/src/components/calendar/ConfigTab.jsx b/client/src/components/calendar/ConfigTab.jsx
index 8ce1110e1a..4f3f3e1c4a 100644
--- a/client/src/components/calendar/ConfigTab.jsx
+++ b/client/src/components/calendar/ConfigTab.jsx
@@ -15,7 +15,6 @@ export default function ConfigTab({ accounts, setAccounts }) {
const [savingSubcals, setSavingSubcals] = useState(null);
const [discovering, setDiscovering] = useState(null);
const [googleAuth, setGoogleAuth] = useState(null);
- const [showOAuthSetup, setShowOAuthSetup] = useState(null);
const [oauthForm, setOauthForm] = useState({ clientId: '', clientSecret: '' });
const [savingOAuth, setSavingOAuth] = useState(false);
const [autoConfigStep, setAutoConfigStep] = useState(null); // null | 'launching' | 'login' | 'project' | 'api' | 'consent' | 'credentials' | 'capturing' | 'done'
diff --git a/client/src/components/calendar/DayView.jsx b/client/src/components/calendar/DayView.jsx
index cb62ea41cd..2b89acda9c 100644
--- a/client/src/components/calendar/DayView.jsx
+++ b/client/src/components/calendar/DayView.jsx
@@ -7,8 +7,8 @@ import EventDetail from './EventDetail';
const START_HOUR = 6;
const END_HOUR = 23;
const HOURS = Array.from({ length: END_HOUR - START_HOUR }, (_, i) => i + START_HOUR); // 6am to 10pm
-const PX_PER_HOUR = 64;
-const PX_PER_15MIN = PX_PER_HOUR / 4; // 16px per 15-min block
+const PX_PER_HOUR = 80;
+const PX_PER_15MIN = PX_PER_HOUR / 4; // 20px per 15-min block
const START_MINUTES = START_HOUR * 60;
function formatHour(hour) {
@@ -137,8 +137,8 @@ export default function DayView() {
setLoading(true);
};
- const allDayEvents = events.filter(e => e.isAllDay);
- const timedEvents = events.filter(e => !e.isAllDay);
+ const allDayEvents = useMemo(() => events.filter(e => e.isAllDay), [events]);
+ const timedEvents = useMemo(() => events.filter(e => !e.isAllDay), [events]);
const layout = useMemo(() => layoutEvents(timedEvents), [timedEvents]);
// Current time indicator
@@ -229,7 +229,7 @@ export default function DayView() {
width: `calc(${widthPercent}% - 4px)`
}}
>
- <div className="text-xs font-medium text-white truncate">{event.title}</div>
+ <div className="text-xs leading-tight font-medium text-white truncate">{event.title}</div>
{height > 32 && event.location && (
<div className="flex items-center gap-1 text-[10px] text-gray-400 truncate">
<MapPin size={10} /> {event.location}
diff --git a/package.json b/package.json
index f5a11a7131..cb1dc32717 100644
--- a/package.json
+++ b/package.json
@@ -30,8 +30,5 @@
},
"devDependencies": {
"pm2": "^6.0.14"
- },
- "dependencies": {
- "googleapis": "^171.4.0"
}
}
diff --git a/server/services/dailyReview.js b/server/services/dailyReview.js
index 6a99530466..9997ecb317 100644
--- a/server/services/dailyReview.js
+++ b/server/services/dailyReview.js
@@ -92,7 +92,7 @@ export async function getDailyReview(date) {
totalEvents: enrichedEvents.length,
confirmed: Object.values(existing.confirmations).filter(c => c.happened).length,
skipped: Object.values(existing.confirmations).filter(c => c.happened === false).length,
- unreviewed: enrichedEvents.length - Object.keys(existing.confirmations).length
+ unreviewed: enrichedEvents.filter(e => !existing.confirmations[e.id]).length
},
updatedAt: existing.updatedAt
};
diff --git a/server/services/googleOAuthAutoConfig.js b/server/services/googleOAuthAutoConfig.js
index 9da62990e4..6a6eda2cdf 100644
--- a/server/services/googleOAuthAutoConfig.js
+++ b/server/services/googleOAuthAutoConfig.js
@@ -216,8 +216,10 @@ export async function runAutomatedSetup(userEmail, io) {
// Step 3/4: Contact Information — fill email
emit('consent', 'Filling contact email...');
const email = userEmail || 'portos@localhost';
+ const safeEmail = JSON.stringify(email);
await evaluateOnPage(page, `
(function() {
+ const emailVal = ${safeEmail};
const inputs = document.querySelectorAll('input[type="text"], input:not([type])');
const emailInput = [...inputs].find(i => {
const ph = i.placeholder || '';
@@ -227,8 +229,8 @@ export async function runAutomatedSetup(userEmail, io) {
if (emailInput) {
emailInput.focus();
const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
- if (setter) setter.call(emailInput, '${email}');
- else emailInput.value = '${email}';
+ if (setter) setter.call(emailInput, emailVal);
+ else emailInput.value = emailVal;
emailInput.dispatchEvent(new Event('input', { bubbles: true }));
emailInput.dispatchEvent(new Event('change', { bubbles: true }));
return true;
@@ -267,8 +269,9 @@ export async function runAutomatedSetup(userEmail, io) {
emit('test-user', 'Adding test user...');
page = await navAndWait(`https://console.cloud.google.com/auth/audience${projectParam}`, 5000);
if (page) {
+ const safeUserEmail = JSON.stringify(userEmail || '');
const hasUser = await evaluateOnPage(page, `
- document.body.innerText.includes('${userEmail || ''}') && !'${userEmail}'.includes('portos')
+ document.body.innerText.includes(${safeUserEmail}) && !${safeUserEmail}.includes('portos')
`);
if (!hasUser && userEmail) {
await clickByText(page, ['Add users']);
@@ -276,14 +279,15 @@ export async function runAutomatedSetup(userEmail, io) {
// Fill email in the dialog
await evaluateOnPage(page, `
(function() {
+ const emailVal = ${safeUserEmail};
const dialog = document.querySelector('[role="dialog"]');
if (!dialog) return false;
const input = dialog.querySelector('input[type="text"], input:not([type])');
if (!input) return false;
input.focus();
const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
- if (setter) setter.call(input, '${userEmail}');
- else input.value = '${userEmail}';
+ if (setter) setter.call(input, emailVal);
+ else input.value = emailVal;
input.dispatchEvent(new Event('input', { bubbles: true }));
input.dispatchEvent(new Event('change', { bubbles: true }));
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Enter', bubbles: true }));