Improve onboarding with automatic detection and suggestions#26
Conversation
Use browser-safe default categories in the client, align e2e with demo fixtures and toolbar labels, and lock the underline extension dependency.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbedfeba63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const scanned = findMarkdownContentDirs(root, 5) | ||
| .filter((entry) => entry.postCount > 0) | ||
| .map((entry) => ({ | ||
| contentDir: entry.relativePath, | ||
| postCount: entry.postCount, | ||
| })); |
There was a problem hiding this comment.
Exclude non-content roots from detected content dirs
When a site repository has Markdown files at the repository root or shallow docs (for example README.md plus CHANGELOG.md), this unweighted scan is merged with the adapter-specific candidates and can rank "" or a docs folder above the real src/content/blog/content/posts folder. The generated config then writes that wrong contentDir, causing new posts to be published outside the actual content collection; prefer filtering the repo root/non-content docs or weighting known adapter candidates ahead of generic scan results.
Useful? React with 👍 / 👎.
| if (typeof value === "string" && value.trim().length > 0) { | ||
| return [value.trim()]; |
There was a problem hiding this comment.
Split YAML category arrays before suggesting categories
When existing posts use common YAML array syntax such as categories: [Tech, Life], the lightweight frontmatter parser returns the whole bracket expression as a string, and this branch records it as one suggested category. That suggestion flows into generateConfigFromDetection, so the generated config can contain "[Tech, Life]" instead of separate categories, making the onboarding-generated category list immediately wrong for those sites.
Useful? React with 👍 / 👎.
| if (marks.some((mark) => mark.type === "underline")) { | ||
| value = `<u>${value}</u>`; |
There was a problem hiding this comment.
Avoid serializing leading underline as an MDX block
When a user underlines text at the start of a paragraph, this emits a line like <u>Intro</u>. On the next load, splitMdxBlocks treats any line starting with an HTML tag as a raw MDX block, and because its collector does not notice the closing tag on the same first line, it can turn the underlined paragraph (and following lines) into an uneditable raw block instead of normal rich text.
Useful? React with 👍 / 👎.
| const root = resolveSetupDetectionRoot(); | ||
| const result = generateConfigFromDetection(root, detection.primary); |
There was a problem hiding this comment.
Avoid writing generated config under the Studio package
When the API is started from apps/studio (the normal package script cwd), resolveSetupDetectionRoot() stops at that package's package.json, so this writes apps/studio/sourcedraft.config.json rather than the project/root config that loadSourceDraftConfig() would otherwise find in a parent directory. Because app-local config is loaded first, clicking Generate config can silently shadow an existing root config and make Studio switch to the newly detected/wrong paths.
Useful? React with 👍 / 👎.
| const strikeMatch = text.slice(index).match(/^~~([^~]+)~~/u); | ||
| if (strikeMatch) { |
There was a problem hiding this comment.
Stop text scanning before strike and underline markers
When toolbar formatting is applied to a word after other text, the serializer writes Markdown like Hello ~~word~~ or Hello <u>word</u>, but on reload these new token branches are never reached because the fallback text scan below does not stop on ~ or <. The rich editor then shows the literal delimiters and loses the mark for common inline strike/underline usage unless the marker starts the paragraph.
Useful? React with 👍 / 👎.
Adds setup detection improvements (content-root detection, frontmatter schema inference, config suggestions from detection), onboarding copy aligned with AI-assisted publishing workflows, and editor/onboarding docs (including docs/editor-parity.md).
Also keeps the Studio browser bundle free of node:fs config imports.
Note: this branch overlaps with PR #25 on onboarding docs (roadmap/non-technical-overview/getting-started); whichever merges second may need a trivial docs conflict resolution.
🤖 Generated with Claude Code