Repository navigation
feat(quote): show the discount ceiling on the quote-generation screen - #1711
Merged
Merged
Conversation
The Generate Quote screen asked for a Discount % and said nothing about the 60% ceiling, a hard block with no override, so the only way to learn the number was to enter one, submit, and read the rejection. The field's label and placeholder now interpolate QUOTE_DISCOUNT_CEILING -- the same constant the crm_quote and crm_quote_line_item validation rules interpolate, imported rather than retyped -- so the hint cannot drift from the rule it describes. The ceiling and its hard-block behaviour are unchanged. No client-side max ships with it: ScreenFieldConfigSchema is strict at 17.3.0 and rejects the key by name, so it would fail validation rather than quietly do nothing, and the executor forwards no such key into the ScreenSpec the client renders. The comment beside the field records that measurement. Co-authored-by: Claude
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
os-steve
marked this pull request as ready for review
September 6, 2026 12:57
This was referenced Sep 6, 2026
15 of 21 tasks
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.
Part of #1214 — item 4 only. The card stays open: item 2's owner half is routed
upstream (objectstack#16290) and has not landed here.
Description
The Generate Quote screen asks for a Discount % and said nothing about
the 60% ceiling. That ceiling is a hard block with no override — the
discount_within_ceilingscript validations oncrm_quoteandcrm_quote_line_item— so the only way for a rep to learn the number was toenter one, submit, and read the rejection.
The screen field now reads
Discount % (≤ 60)and carries0-60as itsplaceholder. Both strings interpolate
QUOTE_DISCOUNT_CEILINGfromsrc/objects/_thresholds.ts, imported rather than retyped, matching what thetwo validation rules already do.
_thresholds.tsitself is untouched.⛔ The ceiling is unchanged and it still blocks. This PR only makes the rule
visible where it applies.
Type of Change
Related Issues
Part of #1214 (item 4). Unblocked by #1206, whose fix shipped in PR #1700.
This PR does not address #1214's remaining item, which stays open.
Changes Made
src/flows/quote-generation.flow.ts— importQUOTE_DISCOUNT_CEILING; thediscountscreen field gains an interpolatedlabelandplaceholder, plusa comment recording why there is no
max..changeset/discount-ceiling-is-visible-where-it-applies.md—hotcrm: patch.What was measured, and what could not ship
The card asked for a hint plus a client-side
max. Themaxhalf is notauthorable at platform 17.3.0, measured rather than assumed:
max/minScreenFieldConfigSchemais strict;Unrecognized key(s) on this screen fieldhelpText/descriptionlabelplaceholderScreenFieldConfigSchema's entire key set isname/label/type/required/options/defaultValue/placeholder/visibleWhen, andthe executor forwards exactly those into the
ScreenSpecthe client renders.So
maxfailspnpm validaterather than quietly doing nothing — it is not akey that could have been authored and left inert. The browser still lets a rep
type 70; the difference is the field now told them it will be refused.
Two further measurements shaped the result:
seeds its form state from
defaultValue, and this field hasdefaultValue: 0,so the input is never empty on open and the placeholder surfaces only for the
moment the rep clears the box to type. Useful, but it cannot be the only hint.
descriptionwas set. It is authorable, but the dialogalready falls back to a fully localized platform subtitle in all four locales.
Overriding it would have traded localized text for an English-only string.
i18n
No translation entry was added, and this is deliberate. The
flowstranslationgroup ships
status: plannedwithauthorWarn: truein the platform livenessledger, verified against the installed packages. Two consequences:
i18n/missing-flowis suppressed, solint:i18n-gatereports 0 issuesboth before and after this change — it could not have caught a miss here.
flows.quote_generation.screens.screen_1.fields.discount.labelwould store a string no shipped runner reads, and would raise
liveness-planned-property. The console bundle resolves no flow translationkeys at all.
That is why the six existing screen dialogs in this app already render English
in every locale. This field is now consistent with them, not a new gap. When the
screen-flow runner lands upstream and the ledger row flips to
live, this labelbecomes translatable along with the rest of that surface.
Testing
pnpm verify— exit 0, the full chain greenpnpm test— 161 files, 3408 passed, 1 skippedpnpm validate,pnpm typecheck,pnpm lint,pnpm lint:i18n-gate,pnpm hygiene,pnpm hygiene:tokens,pnpm build— each exit 0dist/objectstack.jsonships"label": "Discount % (≤ 60)", "placeholder": "0-60"on thediscountscreen field
60appears nowhere inquote-generation.flow.ts, so therendered number can only have come from the import
Checklist
hotcrm: patch, matching the precedent set bythe sibling PR for items 1/3/5/6 of this card)
Additional Notes
Item 4's premise was re-verified on current
mainbefore any edit: the fieldwas still
label: 'Discount %'with no ceiling hint, and #1206's rounding fixis present in the same file, so the serial fence really is released.
Generated by Claude Code