Suggest a new topic (proposedTopic field) - #13
Merged
Conversation
Topic dropdown gains a 'Propose a new topic' option that reveals a name input plus a closest-existing fallback picker (keeps the enum build valid). The suggestion is written to the post frontmatter as proposedTopic for a maintainer or automation to create the topic or remap topicId.
Deploying mlsystems with
|
| Latest commit: |
9b06401
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://99209907.mlsystems.pages.dev |
| Branch Preview URL: | https://feature-propose-topic.mlsystems.pages.dev |
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.
What
Lets writers propose a topic that isn't in the list yet, without breaking the enum-validated build.
proposedTopic;topicIdstays a valid existing topic so the build never fails.proposedTopicstraight from the post markdown and either creates the topic (remappingtopicId) or leaves it mapped to the closest.Why this shape
Topics are a build-time
z.enum(TOPIC_IDS), so a post'stopicIdmust be a known value. Rather than loosen the enum (losing typo-safety) or fail the build as a signal, the suggestion rides along as structured frontmatter — visible where maintainers actually look, and trivial for a future GitHub-Action/bot to act on.Files
src/content/config.ts— optionalproposedTopicschema fieldsrc/write/serialize/toMdx.ts—PostMeta.proposedTopic+ frontmatter emit (+ test)src/write/meta/MetaForm.tsx— dropdown option + reveal inputssrc/write/WritePortal.tsx—emptyMetaRebased onto main after #12. Not merging — for local review.