Skip to content

Copilot/add copilot cli hooks#74

Open
atulmgupta wants to merge 3 commits into
ev-dev-labs:mainfrom
atulmgupta:copilot/add-copilot-cli-hooks
Open

Copilot/add copilot cli hooks#74
atulmgupta wants to merge 3 commits into
ev-dev-labs:mainfrom
atulmgupta:copilot/add-copilot-cli-hooks

Conversation

@atulmgupta

Copy link
Copy Markdown
Contributor

Description

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would break existing functionality)
  • Documentation update
  • Infrastructure / CI change

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing tests pass locally
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Screenshots (if applicable)

atulmgupta and others added 3 commits June 12, 2026 12:25
Co-authored-by: atulmgupta <12709019+atulmgupta@users.noreply.github.com>
Co-authored-by: atulmgupta <12709019+atulmgupta@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 20:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces repository-scoped GitHub Copilot CLI/cloud-agent hooks to enforce TeslaSync’s working agreement during automated editing sessions, along with a small workflow adjustment and a set of related frontend/doc touch-ups.

Changes:

  • Add Copilot hook configuration + Node scripts for preToolUse command guarding, postToolUse guideline auditing, and sessionStart context injection.
  • Update the Copilot setup workflow runner default for non-manual runs.
  • Misc. System Status UI/test and changelog edits (likely formatting/content alignment).

Reviewed changes

Copilot reviewed 8 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
web/src/features/system/components/status/UpdateAvailableCallout.tsx System Status update-available callout component (needs i18n).
web/src/features/system/components/status/TeslaAuthCard.tsx Tesla auth status card (needs i18n).
web/src/features/system/components/status/StatusPageSkeleton.tsx Status page skeleton loader (a11y label should be localized).
web/src/features/system/components/status/tests/UpdateAvailableCallout.test.tsx Tests for update callout.
web/src/features/system/components/status/tests/TeslaAuthCard.test.tsx Tests for Tesla auth card.
web/src/features/system/components/status/tests/BackupActionsCard.test.tsx Tests for backup actions card.
web/src/features/system/components/status/tests/AnomalyInlineRow.test.tsx Tests for anomaly inline row.
web/src/features/admin/components/devtools/FleetApiSection.tsx Devtools Fleet API section; contains a stray CR character in an import line.
web/src/components/layout/Layout.tsx Minor import formatting touch-up.
web/src/components/data-display/PlaybackControls.tsx Minor comment formatting touch-up.
CHANGELOG.md Changelog edits; one entry conflicts with actual callout link behavior.
.github/workflows/copilot-setup-steps.yml Runner default adjusted to ubuntu-latest for non-manual runs.
.github/hooks/scripts/session-context.js Hook script that injects working-agreement context at session start.
.github/hooks/scripts/guidelines-audit.js Hook script that audits edited files for prohibited patterns (advisory).
.github/hooks/scripts/command-guard.js Hook script that blocks forbidden/destructive shell commands.
.github/hooks/README.md Documentation for hooks (contains an incorrect link path).
.github/hooks/20-session-context.json Hook wiring for sessionStart.
.github/hooks/10-guidelines-audit.json Hook wiring for postToolUse.
.github/hooks/00-command-guard.json Hook wiring for preToolUse.

Comment on lines +37 to +41
<p className="text-sm font-semibold text-[var(--text-primary)]">
Update available{latest ? ` β€” v${latest}` : ''}
</p>
<p className="text-xs text-[var(--text-secondary)] mt-0.5">
{current ? `You're running v${current}. ` : ''}Review the release notes before upgrading your deployment.
Comment on lines +42 to +48
const TONE: Record<Severity, { bar: string; icon: string; Icon: typeof ShieldCheck; label: string; badge: 'success' | 'warning' | 'danger' | 'neutral' }> = {
ok: { bar: 'bg-green-500/40', icon: 'text-green-400', Icon: ShieldCheck, label: 'Connected', badge: 'success' },
warn: { bar: 'bg-amber-500/50', icon: 'text-amber-300', Icon: ShieldAlert, label: 'Expires soon', badge: 'warning' },
expired: { bar: 'bg-red-500/60', icon: 'text-red-400', Icon: ShieldX, label: 'Token expired', badge: 'danger' },
disconnected: { bar: 'bg-red-500/60', icon: 'text-red-400', Icon: ShieldX, label: 'Not connected', badge: 'danger' },
unknown: { bar: 'bg-zinc-500/40', icon: 'text-zinc-400', Icon: ShieldAlert, label: 'Unknown', badge: 'neutral' },
}
Comment on lines +12 to +27
import { Skeleton } from '@/components/feedback/Skeleton'
import { GlassPanel } from '@/components/ui'

function SkeletonRow({ height = 44 }: { height?: number }) {
return <Skeleton height={height} className="w-full" />
}

export function StatusPageSkeleton() {
return (
<div
className="space-y-5 max-w-3xl mx-auto"
role="status"
aria-busy="true"
aria-label="Loading system status"
data-testid="status-page-skeleton"
>
Comment on lines +18 to 19
import { ICON_COLOR_MAP, ONBOARDING_STEPS, TELEMETRY_FIELDS } from './constants'
import { Icons } from '@/lib/icons';
Comment thread .github/hooks/README.md
Comment on lines +7 to +10
The hook commands use the cross-platform `command` field (Node.js), so they work on
Linux, macOS, Windows (PowerShell), and the cloud-agent Linux sandbox. Node 20 is already
provisioned by [`.github/copilot-setup-steps.yml`](../copilot-setup-steps.yml).

Comment thread CHANGELOG.md
Comment on lines +80 to +83
- **Tesla auth dedicated card** β€” Promotes account auth from a single health row to a fuller card with token-expiry countdown (healthy / expiring within 7 days / expired / disconnected) and a primary "Re-authenticate" CTA
- **Inline anomaly row** β€” New `<AnomalyInlineRow>` surfaces the most recent anomaly detected for the primary vehicle as a Health row (links to `/anomaly-detection`); renders nothing when there are no anomalies in the last 24h
- **Update-available callout** β€” Prominent in-page callout above the chip bar when `/system/update-check` reports a new release; links to `/changelog` (distinct from the global `<NewVersionBanner>` for client bundle reloads)
- **Run quick backup** β€” New "Run quick backup now" button inside the Backups accordion (mutation via `POST /backup/quick`); disables-while-pending, surfaces success/failure via toasts, and invalidates `backup-runs` queries on settle
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.

3 participants