Finalize public Studio onboarding and editor polish#27
Conversation
…olish Add content-root detection, frontmatter inference, and server-side config generation while hardening auth, rate limits, and writer-facing Studio workflows.
Allow demo by default unless disabled, remove misleading unavailable copy, and wire Exit demo mode back to the login screen.
Add Underline to the editor toolbar (already-loaded extension that round-trips to <u> HTML passthrough), clarify the disabled file-link copy, and align editor docs with shipped behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c9e6560c7
ℹ️ 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".
| } | ||
|
|
||
| return !isPublisherConfigured(); | ||
| return true; |
There was a problem hiding this comment.
Do not let demo mode authenticate protected setup routes
When a configured Studio is reachable without SOURCEDRAFT_DEMO_MODE=false, this default true lets any visitor call /api/auth/demo and receive a valid session. requireAuth then accepts that demo session for non-demo-routed endpoints such as /api/setup/detect and /api/setup/generate-config, so an unauthenticated visitor can inspect the server project layout and, when no config exists, trigger config generation. Either keep demo unavailable once a publisher is configured, or ensure demo sessions are rejected from setup/diagnostic write routes.
Useful? React with 👍 / 👎.
| if (flag === "false") { | ||
| return false; |
There was a problem hiding this comment.
Honor demo-off flag in request routing
In instances with SOURCEDRAFT_DEMO_MODE=false and an incomplete publisher, this branch makes the sign-in screen report that demo mode is disabled, but after a password login isRequestDemoSession() still returns true from !isPublisherConfigured() and routes /api/config, /api/posts, and /api/publish to fixture data and simulated writes. The false flag needs to be consulted by the request-routing helpers too, otherwise operators cannot actually disable demo mode while finishing setup.
Useful? React with 👍 / 👎.
* fix: clear pre-existing Studio editor lint errors Drop unused initializers in insertFileLink and scope an eslint-disable around the intentional latest-ref slash-extension pattern. No behavior change; build, unit tests, and e2e all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix: close demo write hole and harden disabled toolbar controls P1: add requireNonDemo guard so demo sessions and forced-demo deployments cannot trigger real writes; apply it to /api/setup/generate-config (which writes sourcedraft.config.json). The guard blocks genuine demo only, so a real authenticated user can still generate config before a publisher is configured. Centralize client publish gating (canSubmitPublish/isRealPublish): a real publish requires a connected, non-demo Studio; demo only simulates. P2: route toolbar disabled state and click handling through a single isToolbarButtonEnabled predicate so a disabled control can never run its command even if the native disabled state is bypassed. Adds regression tests: requireNonDemo (server), publish gating and isToolbarButtonEnabled (unit), and source-mode/disabled toolbar e2e. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: bnz183 <bnz183@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Final public-readiness pass for SourceDraft Studio. Improves first-install demo access, protected publishing states, navigability, editor toolbar polish, setup clarity, and honest public docs.
Highlights
<u>passthrough) and clearer disabled file-link copy.docs/editor.md,docs/editor-parity.md): Underline shipped; text alignment and tables remain not-shipped/planned (no portable Markdown output).Validation
pnpm build✅pnpm test✅ (0 failures across all packages; studio 104)pnpm test:e2e✅ 14/14 (demo mode, no credentials)🤖 Generated with Claude Code