Repository navigation
feat(forecast): title a forecast by its period and its owner, "Q4 2026 · Nina Reyes" - #2348
Merged
Merged
Conversation
A forecast is one row per owner and period, so a title naming the period alone left two reps' Q4 rows reading the same in Recent items and in a lookup. The stored display_title now reads "Q4 2026 · Nina Reyes": the owner's name is read one hop through the owner_id lookup, and a row with no owner is titled by its period label alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAm8CmTiBvFKWqv9eZH
…ngeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAm8CmTiBvFKWqv9eZH
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Author
席位核对Verdict: ACCEPT ·
Generated by Claude Code |
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Irene · project thread
Fixes #2242
Clause-②: no
Metadata-protocol: none
维护者速读
owner_id查找字段读取,不复制成文本列。src/sales/objects/forecast.object.ts(display_title表达式及其注释),test/forecast-owner-title.test.ts。pnpm vitest run test/forecast-owner-title.test.ts,预期 3 个用例通过;或在控制台打开任一预测,标题显示「Q4 2026 · Dev Admin」。Type of Change
What changes
The title names the owner.
crm_forecast.display_title(stored since #2230) now computesthe guarded form from the blocked report on #2242 (comment 6385293263, Resume), as the dispatch ruling requires. Two owners' Q4 2026 forecasts now read
Q4 2026 · Nina ReyesandQ4 2026 · Omar Diaz; an ownerless one readsQ4 2026. The name is read one hop through theowner_idlookup when the engine computes the stored value, so reassigning a forecast re-titles it on that write. No text column copies the name.Two stale comments corrected.
forecast.object.tssaid twice that "an expression cannot dot-walk a lookup (ADR-0072)". That is false on 18.1.0 and 18.2.0 (measured, below). Both now describe what the title does, including that a user rename reaches a forecast's title only at that forecast's next write. The note aboutstring()versustext()is gone with thestring()call it explained.Docs.
content/docs/sales/forecasting(en, zh-Hans, zh-Hant) gains two sentences in How periods are derived: the title, the ownerless form, and when it changes.Changeset.
.changeset/2242-forecast-title-owner.md(minor), with FROM → TO.Tests
New
test/forecast-owner-title.test.ts, 3 cases on the booted app through@objectstack/verify:Q4 2026 · Nina Reyes,Q4 2026 · Omar Diaz): the pin from the card's Done when;Q4 2026;PATCHmovingowner_idfrom Nina to Omar re-titles the row, so the name comes from the lookup.Reverse check: the pin on the old title expression
The fix committed first (
34af0c4). The expression was then swapped back torecord.period_label + " (" + string(record.period_start) + ")"on disk (injected text counted present, the owner expression counted 0), the file restored withgit checkout HEAD -- src/sales/objects/forecast.object.tsunder atrap, and the restore proven bygit diff HEADempty and a blob-hash match.Verification
At
e41648a(after mergingorigin/main0f17c6c):pnpm validate,typecheck,lint(objectstack lint --strict),hygiene,hygiene:tokensandbuild, all exit 0, and the full suite:mainhas since moved tob65c403(#2346, #2338 items 1–4; no file in common with this diff), so CI's merge ref is the reading for that tip. Before the first merge, at6bf2397, the full suite read 230/230 files, 4447 passed, 1 skipped.Fresh-boot measurement on the installed 18.2.0 (dispatch assumption 1)
Dev server, fresh SQLite file,
--seed-admin, read after the seed-ownership claim settled:display_titlecrm_accountownerless (control)claimSeedOwnership failedlinesmainbbd375bQ2 2026 (2026-04-01)…Q2 2026 · Dev Admin…On 18.1.0 row B read 7 ownerless (the blocked report). objectstack#25668 (in 18.2.0) re-owns seeded rows by id, and that write titles each seeded forecast with the admin it hands it to.
Browser check (dev admin, fresh seed, branch head)
Two Q4 2026 forecasts created through REST, one owned by the dev admin and one by a user named Nina Reyes (created through
auth/admin/create-user):Q4 2026 · Nina ReyesandQ4 2026 · Dev Admin.Q4 2026 · Dev Admin,Q4 2026 · Nina Reyes, each tagged Forecast.Q4 2026: each hit is titled with its owner.Screenshots: project files
issue-2242/(01-nina-record,02-admin-record,04-search-recent,05-search-q4).Acceptance notes
PATCHofnotesalone on a database written before this change turnedQ2 2026 (2026-04-01)intoQ2 2026 · Dev Admin).scripts/backfill-record-titles.tsre-saves only rows with no stored title. Store the 9 formula record titles as stored computed fields and backfill them, so import can match them and sort and search can use them (objectstack#24981 ruling A) #2230's stored titles are not released yet (.changeset/2230-stored-record-titles.mdis still pending), so no released install holds the old stored form: an upgraded install's forecasts are untitled and that backfill titles them in the new form. Only a dev database created onmainsince Store the 9 formula record titles as stored computed fields and backfill them, so import can match them and sort and search can use them (objectstack#24981 ruling A) #2230 holdsQ4 2026 (2026-10-01); measured on a copy of run A's database, the backfill reportedcrm_forecast: 7 row(s), 0 without a stored display_title, and each row takes the new title at its next save or onpnpm demo:reset. The changeset says so.Nina Reyes-Park, the forecast still readQ4 2026 · Nina Reyes; the next by-idPATCH(commit_amountonly) re-titled it. This is a stored-field property, recorded in the object comment and the docs, not changed here.crm_forecast, so there is no lookup picker that lists forecasts. The search side was checked in the command palette instead.Generated by Claude Code