From 63207bfb51478e46cefd53d6b3e06a7d0f01125b Mon Sep 17 00:00:00 2001 From: Ali HD <85040609+alihd-tech@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:23:40 +0330 Subject: [PATCH 1/4] Remove configurator scheduling and generate runnable CLI commands --- lib/privacy-config.ts | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/lib/privacy-config.ts b/lib/privacy-config.ts index 1a81ea4..9bcaeab 100644 --- a/lib/privacy-config.ts +++ b/lib/privacy-config.ts @@ -1,7 +1,6 @@ export type ReportFormat = "svg" | "json" | "markdown" export type ReportTheme = "dark" | "light" export type CardStyle = "detailed" | "compact" -export type SchedulePreset = "manual" | "daily" | "weekly" | "monthly" | "custom" export interface PrivacyConfig { username: string @@ -12,8 +11,6 @@ export interface PrivacyConfig { cardStyle: CardStyle formats: ReportFormat[] outputDir: string - schedule: SchedulePreset - customCron: string commit: boolean includePrivate: boolean } @@ -27,37 +24,22 @@ export const defaultPrivacyConfig: PrivacyConfig = { cardStyle: "detailed", formats: ["svg", "json", "markdown"], outputDir: "code-life-balance", - schedule: "weekly", - customCron: "17 3 * * 1", commit: true, includePrivate: false, } +const CLI_RELEASE_PACKAGE = + "https://github.com/alihd-tech/CodeLifeBalance/releases/download/v1.2.0/code-life-balance-1.2.0.tgz" + function quoted(value: string) { return JSON.stringify(value) } -function cronFor(config: PrivacyConfig) { - switch (config.schedule) { - case "daily": - return "17 3 * * *" - case "weekly": - return "17 3 * * 1" - case "monthly": - return "17 3 1 * *" - case "custom": - return config.customCron.trim() || "17 3 * * 1" - default: - return null - } -} - function workflowExpression(value: string) { return "$" + "{{ " + value + " }}" } export function generateWorkflow(config: PrivacyConfig) { - const cron = cronFor(config) const permissions = config.commit ? "write" : "read" const token = config.includePrivate ? workflowExpression("secrets.CODE_LIFE_TOKEN") @@ -65,14 +47,6 @@ export function generateWorkflow(config: PrivacyConfig) { const username = config.username.trim() || workflowExpression("github.repository_owner") const formats = config.formats.length ? config.formats.join(",") : "svg" - const triggers = cron - ? `on: - workflow_dispatch: - schedule: - - cron: ${quoted(cron)}` - : `on: - workflow_dispatch:` - const upload = config.commit ? "" : ` @@ -85,7 +59,8 @@ export function generateWorkflow(config: PrivacyConfig) { return `name: Code Life Balance -${triggers} +on: + workflow_dispatch: permissions: contents: ${permissions} @@ -117,7 +92,8 @@ jobs: export function generateCliCommand(config: PrivacyConfig) { const args = [ - "pnpm cli --", + "npx --yes", + CLI_RELEASE_PACKAGE, config.username.trim() ? `--username ${shellQuote(config.username.trim())}` : "", `--timezone ${shellQuote(config.timeZone)}`, `--workday-start ${config.workdayStartHour}`, From 96a115f70e60a6c9139278cdcd406b9857b98a66 Mon Sep 17 00:00:00 2001 From: Ali HD <85040609+alihd-tech@users.noreply.github.com> Date: Tue, 22 Sep 2026 00:23:42 +0330 Subject: [PATCH 2/4] Remove automation controls and clarify CLI credentials --- components/privacy-configurator.tsx | 63 +++++++---------------------- 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/components/privacy-configurator.tsx b/components/privacy-configurator.tsx index 32e8020..766d174 100644 --- a/components/privacy-configurator.tsx +++ b/components/privacy-configurator.tsx @@ -7,7 +7,6 @@ import { type ReactNode, } from "react" import { - CalendarClock, Check, Clock3, Code2, @@ -95,10 +94,6 @@ export function PrivacyConfigurator() { const currentPreview = previewMode === "workflow" ? workflow : cli const privateMode = config.includePrivate - const scheduleLabel = - config.schedule === "manual" - ? "Manual" - : config.schedule.charAt(0).toUpperCase() + config.schedule.slice(1) return (
CODE_LIFE_TOKEN.
+ {previewMode === "workflow" ? (
+ <>
+ Private mode expects a fine-grained GitHub token stored as{" "}
+ CODE_LIFE_TOKEN.
+ >
+ ) : (
+ <>
+ Private CLI mode uses{" "}
+ GITHUB_TOKEN or your
+ existing gh auth login{" "}
+ session.
+ >
+ )}