Skip to content

Add CLI features, dashboard preferences, and npm release preparation#2

Merged
tyl3r-ch merged 14 commits intomainfrom
new-ideas
Apr 11, 2026
Merged

Add CLI features, dashboard preferences, and npm release preparation#2
tyl3r-ch merged 14 commits intomainfrom
new-ideas

Conversation

@tyl3r-ch
Copy link
Copy Markdown
Contributor

@tyl3r-ch tyl3r-ch commented Apr 10, 2026

Summary by CodeRabbit

  • New Features

    • Background server mode (start/stop), new Settings modal, persisted dashboard preferences, section ordering/visibility, and settings/data export/import; CLI flags for background runs.
  • Bug Fixes

    • Corrected provider day counting and average-models metric; safer backup import/merge with conflict reporting; PDF/report language handling improved.
  • Documentation

    • New release/contributing/security/code-of-conduct guides; README and installers updated to English with registry/run guidance.
  • Tests & CI

    • CI/release workflow updated (artifact verification, publish checks); expanded unit, integration, and e2e tests.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 52322ba7-daf4-4b12-adca-da15d3f4a561

📥 Commits

Reviewing files that changed from the base of the PR and between bd425ff and 5224613.

📒 Files selected for processing (2)
  • server.js
  • tests/integration/server.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/integration/server.test.ts
  • server.js

📝 Walkthrough

Walkthrough

Adds v6.1.0: background server/CLI with lifecycle and registry, settings backup/import/export and dashboard customization, packaged-artifact verification and scoped npm publish, many UI/component API updates, new server import endpoints, extensive tests, and documentation/policy updates.

Changes

Cohort / File(s) Summary
CI & Release
/.github/workflows/ci.yml, /.github/workflows/release.yml, scripts/verify-package.js, package.json
Bump Node 22→24; add verify:package verification step; add OIDC id-token: write and preflight tag/version check; add Bun setup and publish flow for scoped @roastcodes/ttdash@6.1.0; poll npm propagation and smoke-check npx/bunx.
Installers & Gitignore
install.sh, install.bat, /.gitignore
Translate installer output German→English, default version string → unknown, add background run/stop instructions, and ignore .tmp-smoke-*/ temp dirs.
Background Server & CLI
server.js, scripts/start-test-server.js
Add --background/stop commands, spawn detached child with per-start logs, implement lock-backed background-instances.json registry with pruning and stop semantics, add TTDASH_*_DIR overrides and improved port probing/EADDRINUSE bounds.
Settings UI & Dashboard
src/components/Dashboard.tsx, src/components/features/settings/SettingsModal.tsx, src/components/features/limits/LimitsModal.tsx (removed), src/components/EmptyState.tsx, src/components/features/command-palette/CommandPalette.tsx, src/components/layout/Header.tsx
Replace Limits modal with SettingsModal; add settings/data export/import and JSON download helpers; integrate defaultFilters, sectionVisibility, sectionOrder; dynamic ordered section rendering; command-palette/header prop changes and EmptyState settings button.
Dashboard Preferences & Types
src/lib/dashboard-preferences.ts, src/types/index.ts, src/lib/app-settings.ts
New dashboard-preferences module with presets, section defs, normalization and defaults; add Dashboard-related types; extend AppSettings with defaultFilters, sectionVisibility, sectionOrder and normalization.
Hooks & API
src/hooks/use-dashboard-filters.ts, src/hooks/use-app-settings.ts, src/lib/api.ts
useDashboardFilters accepts defaultFilters and exposes applyDefaultFilters; useAppSettings adds setters for defaults/visibility/order and saveSettings; API adds importUsageData and importSettings and extends UpdateSettingsRequest.
Calculations & Reports
src/lib/calculations.ts, server/report/utils.js, server/report/index.js
Rename avgModelsPerDayavgModelsPerEntry; add provider date deduplication for days; validate date format in week-over-week logic; translate Typst/report error messages to English.
Playwright & Tests
playwright.config.ts, scripts/start-test-server.js, tests/e2e/dashboard.spec.ts, tests/integration/server.test.ts, tests/frontend/*, tests/unit/*
Make Playwright host/port env-driven; add e2e/integration tests for settings/import/export, background orchestration, CLI background lifecycle, import conflict accounting, and new unit/frontend tests for filter behavior and metrics changes.
Server API & Verify Script
server.js, src/lib/api.ts, scripts/verify-package.js
Add endpoints POST /api/settings/import and POST /api/usage/import with normalization/merge and usage-import summary; add scripts/verify-package.js to build, pack, install tarball, smoke-run CLI, and validate server startup.
Docs & Policy
README.md, RELEASING.md, CONTRIBUTING.md, CHANGELOG.md, SECURITY.md, CODE_OF_CONDUCT.md, AGENTS.md
Add release/process docs, contributor guidelines, changelog v6.1.0, security reporting guidance, code of conduct, README updates for CLI/background usage and pack verification, and contributor/test expectations.

Sequence Diagrams

sequenceDiagram
    participant User
    participant CLI
    participant Server
    participant FS as FileSystem

    rect rgba(52, 211, 153, 0.5)
    Note over User,Server: Background start and registration
    User->>CLI: run `ttdash --background`
    CLI->>Server: spawn detached child (no --background)
    Server->>FS: create lock, write background-instances.json entry (PID, port, log)
    Server-->>CLI: child started (PID, port)
    CLI->>User: print running info and `ttdash stop` instruction
    end
Loading
sequenceDiagram
    participant User
    participant UI
    participant API
    participant DB as Storage

    rect rgba(59, 130, 246, 0.5)
    Note over User,DB: Settings import with conservative merge
    User->>UI: Upload settings backup → Import
    UI->>API: POST /api/settings/import
    API->>DB: read current settings, normalize incoming settings
    API->>DB: merge (preserve local when conflicting)
    API-->>UI: return merged settings
    UI->>User: refresh UI and show import summary
    end
Loading
sequenceDiagram
    participant User
    participant UI
    participant API
    participant DB as Storage

    rect rgba(168, 85, 247, 0.5)
    Note over User,DB: Usage backup import with conflict accounting
    User->>UI: Upload usage backup → Import
    UI->>API: POST /api/usage/import
    API->>DB: fetch existing daily usage
    loop per backup day
      alt day missing
        API->>DB: insert day (added)
      else exact match
        API-->>API: mark unchanged
      else conflict
        API-->>API: mark conflict, skip write
      end
    end
    API-->>UI: return UsageImportSummary (added/unchanged/conflicts/total)
    UI->>User: display summary toast
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Poem

🐰
I hopped through code to make things bright,
Spawned a child that runs by night.
Settings saved and backups spun,
Sections ordered, imports done.
TTDash hums — v6.1 — delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main changes: CLI features (--background, stop command), dashboard preferences (section visibility/ordering, default filters), and npm release preparation (packaging verification, scoped package publishing).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch new-ideas

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread server.js Fixed
Comment thread tests/e2e/dashboard.spec.ts Fixed
Comment thread tests/e2e/dashboard.spec.ts Fixed
tyl3r-ch and others added 2 commits April 11, 2026 02:01
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Comment thread tests/e2e/dashboard.spec.ts Fixed
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (4)
src/components/layout/FilterBar.tsx (1)

56-98: Extract preset matching into shared logic to avoid drift.

resolveActivePreset duplicates the same preset date math already used in src/hooks/use-dashboard-filters.ts. If one changes later, applied filters and highlighted preset can diverge.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/layout/FilterBar.tsx` around lines 56 - 98,
resolveActivePreset duplicates date-range calculations from
use-dashboard-filters.ts; extract the preset-range logic into a shared helper
(e.g., getPresetRange or computePresetRange) that returns { startDate, endDate }
for a DashboardDatePreset, import and use that helper inside resolveActivePreset
(replace matchesPreset with a comparison against the helper's output) and update
use-dashboard-filters.ts to use the same helper so preset math is centralized
and cannot drift.
src/components/Dashboard.tsx (2)

424-441: Consider wrapping JSON.parse in more specific error handling.

When JSON.parse fails, the error message may not be user-friendly. The current catch block re-throws parse errors to the outer handler, which displays error.message directly. This works but could show technical JSON syntax errors to users.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Dashboard.tsx` around lines 424 - 441, The JSON.parse call
inside handleSettingsImportChange can produce unfriendly SyntaxError messages;
update the catch logic to detect parse errors (error instanceof SyntaxError) and
show a localized, user-friendly toast (e.g., t('toasts.invalidJsonFile'))
instead of error.message, while still handling other errors by showing their
message or a generic t('toasts.fileReadFailed'); optionally log the original
error for debugging. Make this change in the handleSettingsImportChange function
where JSON.parse(await file.text()) is used and where the current catch block
calls addToast, so parse failures are handled specifically and other errors fall
back to the existing behavior.

483-715: Large renderSection callback has an extensive dependency array.

The function and its dependency array are quite large. While this is functionally correct, consider whether some of the dependencies could be stabilized or memoized at a higher level to reduce potential re-renders.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Dashboard.tsx` around lines 483 - 715, The renderSection
useCallback has a very large dependency array causing frequent re-creations;
stabilize it by memoizing or hoisting volatile inputs (e.g. filteredData,
filteredDailyData, metrics, modelCostChartData, modelPieData, costChartData,
tokenChartData, requestChartData, providerMetrics, providerLimits,
visibleLimitProviders, todayData, allModels, modelCosts, comparisonData,
weekdayData) with useMemo/useRef at a higher level or by splitting renderSection
into smaller components (e.g. InsightsSection, MetricsSection,
CostAnalysisSection) so each component only depends on the data it needs; update
renderSection to reference these stabilized/memoized values (or render the new
child components directly) and then shrink the useCallback dependency list
accordingly.
scripts/verify-package.js (1)

66-68: Silent catch on JSON parse may hide issues.

The empty catch {} block silently swallows JSON parse errors during line-by-line fallback parsing. Consider logging a debug message or continuing iteration more explicitly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/verify-package.js` around lines 66 - 68, The empty catch after trying
to parse each line (try { return JSON.parse(line); } catch {}) hides JSON parse
errors; update the catch to capture the error (e.g., catch (err)) and either log
a debug message including the offending line and the error (console.debug or
existing logger) before continuing iteration, or explicitly continue to the next
line so failures are visible during troubleshooting in the fallback line-by-line
parsing logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@install.bat`:
- Around line 89-90: The script uses unquoted file:%cd% in the Bun
global-install command which breaks on paths with spaces and can enable CMD
parsing injection; update both the echo and the call that reference file:%cd%
(the lines printing and running bun add -g file:%cd%) to wrap the value in
quotes so they use "file:%cd%" (i.e., quote the entire file:... argument)
ensuring safe handling of spaces and special characters.

In `@README.md`:
- Line 243: Update the README example command that currently uses an unquoted
path token (bun add -g file:$(pwd)) so it works with repo paths containing
spaces: wrap the file:$(pwd) argument in quotes (i.e., change to bun add -g
"file:$(pwd)") in the code block on the noted line.

In `@scripts/start-test-server.js`:
- Around line 15-19: The server start script sets process.env.PORT to a default
'3015' but ignores Playwright's override; update scripts/start-test-server.js to
map PLAYWRIGHT_TEST_PORT into process.env.PORT (and PLAYWRIGHT_TEST_HOST into
process.env.HOST if present) before the existing defaults so that
process.env.PORT and process.env.HOST reflect Playwright's values when present;
locate the code around process.env.PORT and process.env.HOST and conditionally
assign from process.env.PLAYWRIGHT_TEST_PORT / process.env.PLAYWRIGHT_TEST_HOST
prior to falling back to '3015' / '127.0.0.1'.

In `@server.js`:
- Around line 852-857: The thrown error message when detecting a settings backup
file is in German; update the Error thrown in the block that checks payload.kind
and SETTINGS_BACKUP_KIND (the throw in the same conditional using payload.kind
and SETTINGS_BACKUP_KIND) to use an English message (e.g., "This is a settings
backup file and not a data file.") so messaging is consistent across the
codebase; keep the existing conditional and throw behavior unchanged.
- Around line 833-838: The thrown Error message for the payload.kind check uses
German text; change the message to an English, project-consistent phrasing
(e.g., replace 'Dies ist eine Daten-Backup-Datei und keine Settings-Datei.' in
the throw new Error at the payload.kind === USAGE_BACKUP_KIND check with an
English message like "This is a data backup file and not a settings file.") so
the error thrown when detecting USAGE_BACKUP_KIND matches the rest of the
codebase.

---

Nitpick comments:
In `@scripts/verify-package.js`:
- Around line 66-68: The empty catch after trying to parse each line (try {
return JSON.parse(line); } catch {}) hides JSON parse errors; update the catch
to capture the error (e.g., catch (err)) and either log a debug message
including the offending line and the error (console.debug or existing logger)
before continuing iteration, or explicitly continue to the next line so failures
are visible during troubleshooting in the fallback line-by-line parsing logic.

In `@src/components/Dashboard.tsx`:
- Around line 424-441: The JSON.parse call inside handleSettingsImportChange can
produce unfriendly SyntaxError messages; update the catch logic to detect parse
errors (error instanceof SyntaxError) and show a localized, user-friendly toast
(e.g., t('toasts.invalidJsonFile')) instead of error.message, while still
handling other errors by showing their message or a generic
t('toasts.fileReadFailed'); optionally log the original error for debugging.
Make this change in the handleSettingsImportChange function where
JSON.parse(await file.text()) is used and where the current catch block calls
addToast, so parse failures are handled specifically and other errors fall back
to the existing behavior.
- Around line 483-715: The renderSection useCallback has a very large dependency
array causing frequent re-creations; stabilize it by memoizing or hoisting
volatile inputs (e.g. filteredData, filteredDailyData, metrics,
modelCostChartData, modelPieData, costChartData, tokenChartData,
requestChartData, providerMetrics, providerLimits, visibleLimitProviders,
todayData, allModels, modelCosts, comparisonData, weekdayData) with
useMemo/useRef at a higher level or by splitting renderSection into smaller
components (e.g. InsightsSection, MetricsSection, CostAnalysisSection) so each
component only depends on the data it needs; update renderSection to reference
these stabilized/memoized values (or render the new child components directly)
and then shrink the useCallback dependency list accordingly.

In `@src/components/layout/FilterBar.tsx`:
- Around line 56-98: resolveActivePreset duplicates date-range calculations from
use-dashboard-filters.ts; extract the preset-range logic into a shared helper
(e.g., getPresetRange or computePresetRange) that returns { startDate, endDate }
for a DashboardDatePreset, import and use that helper inside resolveActivePreset
(replace matchesPreset with a comparison against the helper's output) and update
use-dashboard-filters.ts to use the same helper so preset math is centralized
and cannot drift.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 33f3ea03-2060-492e-9883-d0c108f8c009

📥 Commits

Reviewing files that changed from the base of the PR and between 32350e0 and 6ea2e3e.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (42)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .gitignore
  • AGENTS.md
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • README.md
  • RELEASING.md
  • SECURITY.md
  • install.bat
  • install.sh
  • package.json
  • playwright.config.ts
  • scripts/start-test-server.js
  • scripts/verify-package.js
  • server.js
  • server/report/index.js
  • server/report/utils.js
  • src/components/Dashboard.tsx
  • src/components/EmptyState.tsx
  • src/components/features/command-palette/CommandPalette.tsx
  • src/components/features/insights/UsageInsights.tsx
  • src/components/features/limits/LimitsModal.tsx
  • src/components/features/settings/SettingsModal.tsx
  • src/components/layout/FilterBar.tsx
  • src/components/layout/Header.tsx
  • src/hooks/use-app-settings.ts
  • src/hooks/use-dashboard-filters.ts
  • src/lib/api.ts
  • src/lib/app-settings.ts
  • src/lib/calculations.ts
  • src/lib/dashboard-preferences.ts
  • src/locales/de/common.json
  • src/locales/en/common.json
  • src/types/index.ts
  • tests/e2e/dashboard.spec.ts
  • tests/frontend/filter-bar.test.tsx
  • tests/frontend/use-dashboard-filters.test.tsx
  • tests/integration/server.test.ts
  • tests/unit/analytics.test.ts
  • tests/unit/report-utils.test.ts
💤 Files with no reviewable changes (1)
  • src/components/features/limits/LimitsModal.tsx

Comment thread install.bat Outdated
Comment thread README.md Outdated
Comment thread scripts/start-test-server.js Outdated
Comment thread server.js
Comment thread server.js
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@server.js`:
- Around line 1711-1720: The retry logic in tryListen allows port to increment
past MAX_PORT (65535) causing server.listen to throw before the 'error' handler;
update tryListen/onError so before calling resolve(tryListen(port+1)) you check
port >= MAX_PORT (or port+1 > MAX_PORT) and reject with a clear Error (e.g., "No
free port found (START_PORT-MAX_PORT)") instead of recursing, and ensure
MAX_PORT is set to 65535; reference tryListen, onError, MAX_PORT, START_PORT,
and the server.listen call when applying the guard.
- Around line 209-214: The current return builds fallback chains so setting one
explicitPaths value overrides all three dirs; instead, only assign each output
field when its matching explicitPaths property is present and otherwise leave it
undefined (so platform defaults apply). Update the object returned (dataDir,
configDir, cacheDir) to use explicitPaths.dataDir only for dataDir,
explicitPaths.configDir only for configDir, and explicitPaths.cacheDir only for
cacheDir rather than chaining values across them.
- Around line 820-836: extractSettingsImportPayload currently lets arbitrary
plain objects through which later become defaults via normalizeSettings; change
it to reject any plain object that is not explicitly a settings backup: inside
extractSettingsImportPayload (referencing SETTINGS_BACKUP_KIND and
USAGE_BACKUP_KIND) if payload.kind is not a string or is missing, throw a
descriptive error (e.g. "Uploaded JSON is not a settings backup file"); keep the
existing special-case for USAGE_BACKUP_KIND that throws the usage-specific
message, and only return payload.settings when payload.kind ===
SETTINGS_BACKUP_KIND.

In `@tests/e2e/dashboard.spec.ts`:
- Around line 59-60: The test "manages settings and backup imports through the
settings dialog using isolated test storage" currently only clears /api/usage;
also reset settings to a known baseline by deleting or POSTing a default to
/api/settings before running the UI flow (e.g., call
page.request.delete('/api/settings') or POST default settings), or alternatively
ensure the server for this test uses per-test TTDASH_* dirs so server.js's
SETTINGS_FILE cannot leak prior runs; update the test to perform that reset
(reference the test name and server.js SETTINGS_FILE / TTDASH_* env).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 87290d74-42d6-494d-93c6-01c2f1fcd7d2

📥 Commits

Reviewing files that changed from the base of the PR and between 6ea2e3e and 35792c8.

📒 Files selected for processing (2)
  • server.js
  • tests/e2e/dashboard.spec.ts

Comment thread server.js Outdated
Comment thread server.js Outdated
Comment thread server.js
Comment thread tests/e2e/dashboard.spec.ts
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
tests/e2e/dashboard.spec.ts (1)

400-422: ⚠️ Potential issue | 🟡 Minor

Reset persisted settings before asserting the locale switch.

This test only clears usage. Earlier scenarios in this file persist language: 'en', so Line 421 can pass even if the click on Line 416 stops working. Reset /api/settings here, or assert the initial locale is German before switching.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/dashboard.spec.ts` around lines 400 - 422, The test relies on
clearing usage but not persisted settings so the locale may already be 'en';
before simulating the locale switch (the page.getByTitle(...).click() call in
this test) clear persisted settings by issuing a request to reset settings
(e.g., call page.request.delete('/api/settings') or equivalent) so the click
actually changes the locale; keep the existing reportRequest handling and
uploadSampleUsage usage unchanged and place the settings reset after clearing
usage and before the getByTitle click.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@server.js`:
- Around line 821-825: The current SETTINGS_BACKUP_KIND branch only checks for
the presence of the settings key but accepts invalid shapes (e.g., an array)
which can reset user prefs; update the guard to validate payload.settings is a
non-null plain object (typeof payload.settings === 'object', payload.settings
!== null, !Array.isArray(payload.settings)) and optionally require
Object.keys(payload.settings).length > 0, throwing an Error if the validation
fails; apply the same validation change to the other SETTINGS_BACKUP_KIND
handling (the second occurrence that currently mirrors this logic) and ensure
normalizeSettings() only receives a properly shaped settings object.
- Around line 293-304: isProcessRunning currently treats any live PID as a valid
TTDash instance which risks signaling unrelated processes; change
isProcessRunning to perform an instance-specific ownership check (not just
process.kill(pid,0)). For example, after verifying the PID exists, read the
target process identity (on Linux via /proc/<pid>/cmdline or on other platforms
via an equivalent) and compare it to the expected TTDash binary/command or an
instance-specific token (e.g., an exported env var, unique socket path, or
lockfile content) that your registry writes when starting an instance; if the
identity/token does not match, return false. Update all call sites that rely on
PID existence (including the stop/prune logic referenced by isProcessRunning and
the other locations noted in the comment) to rely on the new ownership-aware
isProcessRunning so that stop only sends SIGTERM to verified TTDash instances.
Ensure any platform-specific checks degrade safely (return false) if the
identity cannot be verified.

In `@tests/integration/server.test.ts`:
- Around line 128-137: createCliEnv currently only overrides HOME and XDG_* vars
so Windows runs still resolve real profile paths via APPDATA/LOCALAPPDATA;
update createCliEnv (in tests/integration/server.test.ts) to also set APPDATA
and LOCALAPPDATA (and optionally USERPROFILE) to directories under the provided
root (e.g., path.join(root, 'AppData', 'Roaming') and path.join(root, 'AppData',
'Local')) so server.js resolves profiles into the test root and prevents writes
to the real user profile during Windows test runs.

---

Duplicate comments:
In `@tests/e2e/dashboard.spec.ts`:
- Around line 400-422: The test relies on clearing usage but not persisted
settings so the locale may already be 'en'; before simulating the locale switch
(the page.getByTitle(...).click() call in this test) clear persisted settings by
issuing a request to reset settings (e.g., call
page.request.delete('/api/settings') or equivalent) so the click actually
changes the locale; keep the existing reportRequest handling and
uploadSampleUsage usage unchanged and place the settings reset after clearing
usage and before the getByTitle click.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 12c76071-7160-4044-ab59-75e7e729695a

📥 Commits

Reviewing files that changed from the base of the PR and between 35792c8 and bd425ff.

📒 Files selected for processing (7)
  • README.md
  • install.bat
  • scripts/start-test-server.js
  • scripts/verify-package.js
  • server.js
  • tests/e2e/dashboard.spec.ts
  • tests/integration/server.test.ts
✅ Files skipped from review due to trivial changes (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/start-test-server.js
  • scripts/verify-package.js

Comment thread server.js
Comment thread server.js
Comment thread tests/integration/server.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant