Skip to content

fix(audit): singular counts and a stray period in the audit screens - #1334

Merged
gewenyu99 merged 2 commits into
mainfrom
posthog/fix-1327-audit-plurals
Sep 23, 2026
Merged

gewenyu99 merged 2 commits into
mainfrom
posthog/fix-1327-audit-plurals

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Problem

The audit screens print plural nouns for a count of one. The outro reads 1 warnings · 1 suggestions, and the checks viewer summary reads 1 errors or 1 passes. The "Write report" slide also has a stray period mid-sentence: at ./posthog-audit-report.md. that summarizes our findings.

Closes #1327

Changes

  • countNoun. New helper, picks the noun by count. Zero stays plural.
  • AuditChecksOutroSection. Count line uses it for checks, errors, warnings, suggestions.
  • Summary. Viewer summary uses it for errors, warnings, suggestions, passes.
  • WriteReportSlide. Drops the period after the file name.

Nothing flows here. Two render sites call one helper in count-noun.ts.

Zero stays plural, so the audit-outro-* frame snapshots, which show zero counts, don't change. total and pending stay as they are, since they read the same at one.

Test plan

audit-counts.test.tsx renders the outro section and the summary with one check per status, and checks the slide sentence. It failed on main on all three points and passes with the fix.

pnpm typecheck, pnpm lint (0 errors) and pnpm test (200 files, 3352 tests) pass.

LLM context

Written by Claude Code while triaging the real-TUI sweep issues.

Created with PostHog Desktop

The audit outro and the checks viewer summary always printed plural
nouns, so a count of one read "1 warnings" or "1 passes". Both lines now
pick the noun by count through a small countNoun helper. Zero stays
plural, so the existing zero-count frames do not change.

The "Write report" slide also had a period in the middle of its first
sentence, after the report file name.

Closes #1327

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@gewenyu99
gewenyu99 marked this pull request as ready for review September 23, 2026 22:23
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 23, 2026 22:23
Comment thread src/ui/tui/screens/audit/count-noun.ts Outdated
@@ -0,0 +1,3 @@
/** `1 error`, `2 errors`, `0 errors`. Zero stays plural. */
export const countNoun = (n: number, noun: string, plural = `${noun}s`) =>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Jesus this is a horrible place for it opus

countNoun is a plain text helper with nothing audit-specific in it, so it
belongs in shared utils where other screens can use it.

Part of #1327

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
@gewenyu99
gewenyu99 merged commit 140af5d into main Sep 23, 2026
18 checks passed
@gewenyu99
gewenyu99 deleted the posthog/fix-1327-audit-plurals branch September 23, 2026 22:37
gewenyu99 added a commit that referenced this pull request Sep 24, 2026
Release A landed on main as squash commits (#1293, #1297, #1299, #1303).
B1 already carries that content through the A3 branch, so the merge
keeps B1's tree and adds #1334, the one change main has beyond A3, with
B1 import paths.

Generated-By: PostHog Desktop
Task-Id: d14e92bb-6ee1-49b5-8502-39cb80079589
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.

Audit screens print "1 warnings" and a stray period in the report slide

2 participants