Skip to content

feat: unified docs space, wizard with remote repo form, image fixes#23

Draft
nsheaps wants to merge 24 commits intomainfrom
claude/preview-deploy-live-docs-cnjBq
Draft

feat: unified docs space, wizard with remote repo form, image fixes#23
nsheaps wants to merge 24 commits intomainfrom
claude/preview-deploy-live-docs-cnjBq

Conversation

@nsheaps
Copy link
Owner

@nsheaps nsheaps commented Mar 8, 2026

Summary

  • Unified docs space: Merged separate "Docs (PR)" and "Docs (Live)" spaces into a single "Cept Docs" space with an in-editor dropdown to switch between PR and live (main branch) versions for preview deploys
  • Add-space wizard: Extracted space creation into a standalone modal wizard with type chooser (empty/remote). The "Add from remote" step now shows a form with repository URL, branch, and sub-path fields pre-populated with the Cept Docs repo defaults, plus a quick-add button for docs
  • Space metadata: SpaceInfo now carries remoteUrl, branch, and subPath fields. The Spaces tab shows a branch badge on each space listing, and the detail view displays remote URL, branch, and path
  • Image rendering fixes: Images now render at natural size (Notion-style) instead of 100% width, with proper <figure> wrapping via TipTap parseHTML rules. Fixed import.meta.env.BASE_URL usage for asset paths in docs
  • Preview deploy improvements: Live docs comparison from main branch, preview-specific banner, fixed gh-pages checkout race condition, added __IS_PREVIEW__ build flag
  • Docs branch-aware source links: GitHub source links and branch metadata in the docs space now use the PR's head branch instead of hardcoded main, so preview deploys correctly link to the PR branch
  • Screenshot automation: Updated feature screenshots via E2E capture pipeline

Test plan

  • All 1647 unit tests pass (bun run test)
  • TypeScript strict mode passes (bun run typecheck)
  • Lint passes (0 errors)
  • Verify docs space source links point to PR branch in preview deploy
  • Verify branch badge appears next to docs space in Settings > Spaces
  • Verify remote form in wizard is pre-populated with docs repo URL/branch/path
  • Verify quick-add "Cept Docs" button still works below the form
  • Verify space detail view shows Remote, Branch, and Path fields
  • E2E screenshots for visual verification

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW

@nsheaps nsheaps self-assigned this Mar 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

Release Version Check

🟡 MINOR version bump

Version
Current 0.3.1
Next 0.4.0

This version will be released automatically when this PR is merged to main.

Changelog preview

0.4.0 (2026-03-15)

Features

  • add branch/remote metadata to spaces and remote repo form to wizard (f007288)
  • add live docs comparison space on preview deploys (3f39bf9)
  • extract add-space wizard into standalone modal (f99f1b6)

Bug Fixes

  • add IS_PREVIEW to vitest globals and fix gh-pages checkout race (32e5e89)
  • add min-height to image blocks so they're visible before load (25a9a82)
  • discard generated file changes before gh-pages checkout in preview deploy (edd88b6)
  • enable markdown image rendering in docs by adding img[src] parseHTML rule (d676d86)
  • render images at natural size (Notion-style) and clean up screenshots (1109763)
  • resolve stuck "Loading..." state on page refresh (740a381)
  • use import.meta.env.BASE_URL instead of document.baseURI for image paths (a783f47)
  • use literal import.meta.env.BASE_URL so Vite replaces it at build time (556ad37)
  • use parse.updateDOM to transform to for markdown images (aeda5eb)
  • use PR branch for docs space source links instead of hardcoded main (ac1127c)

Refactoring

  • replace separate create/remote buttons with unified wizard flow (60be8fd)
  • unify docs into single space with dropdown switching (b695869)

Documentation

  • add image and formatting preference sections to Markdown Extensions (2366dc3)
  • add PR-specific banner and image to docs index for visual diff (d78f51b)
  • screenshots: update feature screenshots (9d71ea1)
  • screenshots: update feature screenshots (1670811)
  • screenshots: update feature screenshots (627ef3d)
  • screenshots: update feature screenshots (8aaa87c)
  • screenshots: update feature screenshots (52ffa8c)

Chores

  • broaden image rules into general content-formatting rules (45f7f4c)
  • clean up getBaseUrl comment to trigger rebuild (0bf87e3)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

Preview Deployment

The web app for this PR has been deployed:

Open Preview

Use this to verify the app works correctly, especially for dependency updates.

github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
github-actions bot added a commit that referenced this pull request Mar 8, 2026
@nsheaps nsheaps closed this Mar 10, 2026
@nsheaps nsheaps reopened this Mar 10, 2026
@nsheaps nsheaps force-pushed the claude/preview-deploy-live-docs-cnjBq branch from c85919a to cceb29d Compare March 10, 2026 20:54
github-actions bot added a commit that referenced this pull request Mar 10, 2026
@nsheaps nsheaps force-pushed the claude/preview-deploy-live-docs-cnjBq branch from cceb29d to a566eff Compare March 11, 2026 01:11
github-actions bot added a commit that referenced this pull request Mar 11, 2026
github-actions bot added a commit that referenced this pull request Mar 11, 2026
github-actions bot added a commit that referenced this pull request Mar 11, 2026
github-actions bot added a commit that referenced this pull request Mar 11, 2026
@nsheaps nsheaps force-pushed the claude/preview-deploy-live-docs-cnjBq branch from 7d6fa34 to eb5a3c1 Compare March 11, 2026 02:45
github-actions bot added a commit that referenced this pull request Mar 11, 2026
github-actions bot added a commit that referenced this pull request Mar 11, 2026
@nsheaps nsheaps changed the title feat: live docs comparison on preview deploys feat: live docs, image rendering, and loading fix Mar 11, 2026
github-actions bot added a commit that referenced this pull request Mar 11, 2026
@nsheaps nsheaps changed the title feat: live docs, image rendering, and loading fix refactor: single docs space, loading fix, image rendering Mar 11, 2026
@nsheaps nsheaps changed the title refactor: unified docs space, wizard space creation, image fixes feat: unified docs space, wizard with remote repo form, image fixes Mar 15, 2026
claude and others added 23 commits March 15, 2026 20:35
On preview deploys, the app now shows two documentation spaces in the
space switcher: "Docs (This PR)" with docs from the PR branch, and
"Docs (Live)" with docs fetched from the main branch at build time.
This lets reviewers compare documentation changes side by side.

- Add live-docs-content.ts stub (replaced at build time by generate-live-docs.sh)
- Extend router to support /live-docs routes
- Update App.tsx to conditionally show both docs spaces when __IS_PREVIEW__
- Update preview-deploy workflow to run the live docs generator and set VITE_IS_PREVIEW

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
- Unit tests failed because __IS_PREVIEW__ global was not defined in
  vitest.config.ts define block (added as false for test env)
- Preview deploy failed with non-fast-forward because git checkout
  gh-pages didn't reset to origin/gh-pages; use -B flag to force-reset

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…ew deploy

The generate-live-docs.sh script modifies live-docs-content.ts during
build. This uncommitted change blocks the checkout to gh-pages branch.
Add git checkout -- . to discard working tree changes after the build
is complete.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…HTML rule

ImageBlock only matched <figure data-type="image"> tags, but tiptap-markdown
renders ![alt](src) as bare <img> elements via markdown-it. Added img[src]
as a second parseHTML rule so markdown images are properly parsed into
imageBlock nodes. Also added markdown serialization support.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
Adds a callout banner and a test image to the docs index page so the
PR preview docs can be visually distinguished from the main branch docs.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…images

The previous img[src] parseHTML approach didn't work because tiptap-markdown
registers its own built-in 'image' node with the same img[src] selector,
which wins the match. Instead, use the markdown parse.updateDOM hook to
transform bare <img> elements into <figure data-type="image"> elements
before ProseMirror parsing, so they match imageBlock's parseHTML rule.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…ge paths

document.baseURI changes with pushState navigation, so when the user
navigates to /cept/pr-23/docs/docs-index the image URLs resolve to the
wrong path. Using Vite's build-time BASE_URL gives a stable base path
regardless of client-side routing.

Also updated the live-docs wrapper generator to use its own resolver
instead of re-exporting main's (which has the old baseURI approach).

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…d time

The previous approach cast import.meta to unknown, which defeated Vite's
build-time replacement of import.meta.env.BASE_URL — leaving it undefined
at runtime and falling back to '/'. Now uses the literal expression directly.
Added ImportMeta/ImportMetaEnv type declarations to @cept/ui globals.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…shots

- Change ImageBlock width default from 100% to null so images render at
  their natural size, centered, capped at max-width: 100%
- Update CSS to use flexbox centering, rounded corners (6px), and subtle
  hover shadow matching Notion's image presentation
- Remove 4 unused/duplicate screenshots (features-page, text-formatting,
  getting-started, sidebar)
- Add .claude/rules/images-and-screenshots.md with conventions for image
  syntax (prefer standard markdown), styling (natural size by default),
  and screenshot management

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
Renamed .claude/rules/images-and-screenshots.md to content-formatting.md
and expanded to cover all content formatting conventions: markdown syntax
preferences (standard MD, fallback to GFM, avoid raw HTML), images,
screenshots, asset references, links, and code blocks.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…ions

Added an Images section documenting standard markdown image syntax,
natural-size rendering, and alt text requirements. Updated Design
Principles to clarify the preference hierarchy: standard Markdown first,
GFM fallback, HTML as last resort. Updated both docs/content/ source
and bundled docs-content.ts.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
Four related bugs caused the app to get permanently stuck on "Loading...":

1. Race condition in ensureDir/ensureParentDir: concurrent mkdir calls
   (from backend.initialize() and loadPersistedState) could throw EEXIST,
   propagating up and preventing ready state. Fixed by catching mkdir errors.

2. No error handling in useWorkspacePersistence: if loadPersistedState threw,
   ready never became true. Added try/catch to fall back to defaults.

3. Missing page content = infinite loading: when readPageContent returned null
   (file missing), contentLoaded stayed false forever. Now sets empty string
   so the page renders instead of showing "Loading..." permanently.

4. Race condition in clearAllData: deletes and writes ran concurrently, so
   freshly-written page files could be deleted by the still-running clear.
   Fixed by awaiting clearAllData before writing new content.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
Image blocks with unloaded/broken images had 0 dimensions, causing
them to be hidden. Adding min-height: 2rem ensures the block is
visible even when the image hasn't loaded yet (e.g., in CI or with
broken URLs).

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
- Remove live-docs space entirely (no more dual docs spaces)
- Remove __IS_PREVIEW__ flag and live-docs content generation
- Docs space is now a regular space in the dropdown switcher (no back
  arrow, same UX as switching between user spaces)
- Remove "Back to my space" button from docs banner
- Add "Add Cept Docs (from main)" option in Settings > Spaces for
  future remote docs space support
- Clean up preview-deploy workflow (no more generate-live-docs.sh step)
- Simplify router to remove live-docs route type

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…flow

"Create new space" now opens a type chooser (empty local vs. add from
remote) instead of immediately showing a name input. The separate
"Remote Spaces" section is removed — remote sources are accessed through
the same wizard. Back navigation lets users step through the flow.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
Move the space creation wizard flow out of SettingsModal into a new
AddSpaceWizardModal component that opens as a separate overlay (z-index
300) on top of the settings dialog. The "Create new space" button in
Settings > Spaces now triggers the external wizard modal instead of
modifying content inline.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
…zard

- SpaceInfo now includes remoteUrl, branch, and subPath fields
- Space listing in Settings shows branch badge when available
- SpaceDetails view shows remote URL, branch, and path in detail grid
- Docs space source split into structured fields instead of one string
- Add-from-remote wizard step now shows a form with URL, branch, and
  sub-path inputs pre-populated with the Cept Docs repo defaults
- Quick-add button for Cept Docs preserved below the form
- Tests updated for new wizard form behavior and branch display

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
@nsheaps nsheaps force-pushed the claude/preview-deploy-live-docs-cnjBq branch from 46c1cc4 to f007288 Compare March 15, 2026 20:36
github-actions bot added a commit that referenced this pull request Mar 15, 2026
The docs space metadata (GitHub source URLs and branch label) was
hardcoded to 'main', so preview deploys showed docs sourced from main
even though the content was built from the PR branch. Now the branch
is injected at build time via HEAD_BRANCH env var.

https://claude.ai/code/session_01CTseT41ruGN2oiFgwW53gW
github-actions bot added a commit that referenced this pull request Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants