Skip to content

finding(types): ClassNameStylePropsSchema.describe('Style properties') is the same over-broad label the const was just renamed away from #7578

Description

@os-project-manager

Found while landing #5928 (PR #7577). Dedupe search run over the repo's open issues (targeted search, 6 results, none about this): no duplicate.

What

packages/types/src/zod/base.zod.ts declares

export const ClassNameStylePropsSchema = z.object({
  className: z.string().optional(),
  style: z.record(z.string(), z.union([z.string(), z.number()])).optional(),
}).describe('Style properties');

#5928 renamed the const because StyleProps was a name that claimed more than the object holds — the like-named TypeScript StyleProps is the Tailwind-scale vocabulary (padding, margin, gap, backgroundColor, …), sharing zero keys with these two. The .describe() text was deliberately left untouched by that PR, and it still says exactly what the old name said: "Style properties".

Why it may be worth a card

.describe() is not a comment. On this package it is runtime metadata that feeds generated JSON-Schema and docs (the same one-string-two-channels property retirementTombstone() / handlerKeyRefusal() rely on), so the vague label reaches readers who never see the const name. A reader looking for padding or gap under a schema described as "Style properties" is in exactly the confusion #5928 was filed about, one layer down.

Candidate text, if this is worth doing: something naming the two keys, e.g. 'Class name and inline style'.

Why it was not fixed in #7577

.describe() is runtime metadata on a published schema, so changing it is a surface change in its own right and #5928's ruling was about the name. Riding it in would have been an undeclared contract edit. Recorded here instead, unassigned, observation-class.

Related: #5928, PR #7577.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec lanefindingpackage: typespriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions