feat(logs): explicit add-a-column form in the column configurator - #69879
Conversation
The configurator's only add-path was the available-columns picker, which exposes just four of the six built-in column types (no Timestamp, no Source) and buries type selection behind attribute search. Add an "Add a column" section between the visible list and the picker: a column type dropdown covering every built-in plus Custom, an optional name override, and an expression input (shown for Custom, required to add). Type options derive from the column registry so new built-ins appear automatically. The taxonomic picker stays for attribute discovery. Generated-By: PostHog Code Task-Id: f8dab4c5-0df5-4e26-a33c-44065961a146
🦔 Hogbox preview · ✅ ready▶ Open the preview
commit |
|
Reviews (1): Last reviewed commit: "feat(logs): explicit add-a-column form i..." | Re-trigger Greptile |
|
Note 🤖 stamphog reviewed Verified in the diff: the taxonomic picker's onChange also dispatches addDraftColumn, and the new form's state resets on that same action, so a user filling in the new "Add a column" form loses their in-progress input if they instead click a picker entry — the greptile inline comment on this is correct and remains unaddressed on the current head.
Gate mechanics and policy version
|
|
The issue is confirmed. The The fix is to introduce a dedicated
Then in the And in the This keeps the reset-after-read ordering (the listener still reads |
🤖 CI report✅ Bundle size — no changeUncompressed size of every built Total: 70.09 MiB · no change No file changed by more than 1000 B. Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report ✅ Eager graph — within budgetHow much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy
🟢 Largest files eagerly shipped from
|
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 668 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 277.3 KiB | ../node_modules/.pnpm/posthog-js@1.399.1/node_modules/posthog-js/dist/rrweb.js |
| 266.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 224.6 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 221.5 KiB | ../node_modules/.pnpm/posthog-js@1.399.1/node_modules/posthog-js/dist/module.js |
| 164.0 KiB | src/queries/validators.js |
| 154.0 KiB | ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js |
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 105.9 KiB | src/lib/api.ts |
| 93.3 KiB | ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js |
| 90.6 KiB | ../node_modules/.pnpm/@tiptap+core@3.20.6_@tiptap+pm@3.20.6/node_modules/@tiptap/core/dist/index.js |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
⚠️ Dist folder size — 🔺 +21.0 KiB (+0.0%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1438.52 MiB · 🔺 +21.0 KiB (+0.0%)
The newColumn form reducer reset on addDraftColumn, but the available-columns picker dispatches that same action. Picking a column there wiped an in-progress add-column form. Reset only via a dedicated resetNewColumn action fired by the submit listener after it reads the form values. Generated-By: PostHog Code Task-Id: 811d9a61-3f2c-4538-ab25-3d392a6bea5b
Generated-By: PostHog Code Task-Id: 811d9a61-3f2c-4538-ab25-3d392a6bea5b
|
Iteration status:
Two remaining gates need a human and can't be resolved from here:
|
Generated-By: PostHog Code Task-Id: 3dab2bb7-b1e1-43fe-9915-5430f04dd670
Extract the custom-expression validation into one customColumnExpressionError helper shared by the add-form and draft error selectors, drop the redundant COLUMN_TYPE_OPTIONS casts, adopt LemonField.Pure for the form labels to match the sibling logs forms, and share the expression-input placeholder constant. Generated-By: PostHog Code Task-Id: f8dab4c5-0df5-4e26-a33c-44065961a146
…ithub.com/PostHog/posthog into posthog-code/logs-configurator-add-column
Generated-By: PostHog Code Task-Id: 3dab2bb7-b1e1-43fe-9915-5430f04dd670
|
Iteration status (updated):
Remaining gate: this needs an approving review from @PostHog/logs — a required human review that can't be satisfied automatically. Everything else is green. |
There was a problem hiding this comment.
Contained frontend feature (new add-column form in a logs product configurator, behind a feature flag), no risky territory touched; the one Greptile review concern was fixed with a regression test and resolved, author has strong familiarity and owns the files.
- Author wrote 100% of the modified lines and has 12 merged PRs in these paths (familiarity STRONG).
- 👍 on the PR from greptile-apps[bot], hex-security-app[bot].
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✓ | no deny categories matched |
| size | ✓ | 140L, 3F substantive, 172L/4F incl. docs/generated/snapshots — within ceiling |
| tier | ✓ | T1-agent / T1c-medium (172L, 4F, single-area, feat) |
| stamphog 2.0.0b3 | .stamphog/policy.yml @ f6aa24a · reviewed head 4a4e31b |
|
👋 Visual changes detected for this PR. Review and approve in PostHog Visual Review If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix. |
Generated-By: PostHog Code Task-Id: 9e17d727-cfb7-4839-8c23-61b226f87591
Problem
Follow-up to #69275/#69617. The configurator modal's only way to add a column is the "Available columns" taxonomic picker — which exposes only four of the six built-in column types (Timestamp and Source aren't in the Logs taxonomic group at all), and makes "I just want a Level column" a search exercise. There was no way to see the column type vocabulary and pick from it.
Changes
An "Add a column" section between the visible-columns list and the picker:
How did you test this code?
Automated: full logs frontend sweep, 447 tests across 24 suites, all passing. One new test covering the form path end-to-end: invalid custom (no expression) is blocked and adds nothing; a built-in with a name override lands in the draft and the form resets; a custom with an expression round-trips. The reset-on-add ordering matters — kea reducers run before listeners, so resetting the form on submit would wipe the values before the listener reads them; the test locks in the working order. I did not drive the modal in a browser; the branch is on Jon's preview stack.
Docs update
None — behind the same
logs-column-configurationflag.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Jon flagged that built-in column types weren't selectable anywhere in the configurator and provided reference designs for an add-a-column flow (type dropdown → name → expression-when-custom). I (Claude, via PostHog Code) implemented it as an inline section of the existing modal rather than a separate dialog, keeping the draft-commit semantics; form state lives in
logsColumnConfiguratorLogicper the kea conventions. One bug avoided during implementation: resetting the form in the same-action reducer would race the submit listener (reducers first), so the reset rides onaddDraftColumninstead.Created with PostHog Code