Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/src/app/w/[workspaceId]/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default async function WorkspaceSettingsPage({ params }: PageProps<"/w/[w
{data && github.ok && docRepos.length > 0 && (
<Card className="space-y-4">
<h2 className="font-medium">Docs folders</h2>
<p className="text-sm text-muted-foreground">Empty shows the whole repo. Enter a folder, such as docs, to show only that folder.</p>
<p className="text-sm text-muted-foreground">Each repo shows its docs folder. Enter another folder, or leave it empty to show the whole repo.</p>
<DocFoldersPanel
workspaceId={workspaceId}
repos={docRepos.map((r) => ({ nodeId: r.repoNodeId, fullName: r.fullName, path: r.path, branch: r.branch, defaultBranch: r.defaultBranch }))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export function VisibilityPanel(props: { workspaceId: string; hideLabel: string;
<Label htmlFor="hide-folder">Hide docs in this folder</Label>
<Input id="hide-folder" value={hideFolder} placeholder="e.g. internal" maxLength={200} onChange={(e) => setHideFolder(e.target.value)} />
<p className="mt-1 text-xs text-muted-foreground">
From the top of each repo (or its docs folder, if one is set): &ldquo;internal&rdquo; hides internal/. Read Only members never see these files. Empty hides nothing.
Inside each repo&apos;s docs folder: &ldquo;internal&rdquo; hides docs/internal/. Read Only members never see these files. Empty hides nothing.
</p>
</div>
<div className="flex items-center gap-2 text-sm">
Expand Down
5 changes: 3 additions & 2 deletions docs/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
| 035 | [Docs cache: tree by folder oid, text by blob sha](decisions/035-docs-cache.md) |
| 036 | [Doc writes: one signed commit, conflict check, pull request fallback](decisions/036-doc-writes.md) |
| 037 | ["Rich text" is a live preview over the source, not WYSIWYG](decisions/037-rich-text-view.md) |
| 038 | [Docs show each repo's whole tree, loaded automatically](decisions/038-whole-repo-tree.md) |
| 038 | [Docs show each repo's whole tree, loaded automatically](decisions/038-whole-repo-tree.md) (default superseded by 039) |
| 039 | [Each repo shows its docs/ folder by default](decisions/039-docs-folder-default.md) |

## Features

Expand All @@ -61,4 +62,4 @@
| [features/speed.md](features/speed.md) | Client store, /sync with ETag, optimistic edits, side panel, measured budgets. |
| [features/keyboard.md](features/keyboard.md) | Shared keymap, command menu, pickers, bulk edit with undo, shortcut sheet. |
| [features/shell.md](features/shell.md) | Workspace layout and sidebar, grouped virtualized list, dense cards, write-path line, dark mode. |
| [features/docs.md](features/docs.md) | Repo trees (whole repo by default), rich-text editor, frontmatter panel, images, commits, PR fallback, conflicts, presence. |
| [features/docs.md](features/docs.md) | Repo folders with each docs/ tree, rich-text editor, frontmatter panel, images, commits, PR fallback, conflicts, presence. |
4 changes: 2 additions & 2 deletions docs/STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Last updated: 2026-11-19

## In Progress

Docs show each repo's whole tree, loaded automatically (decision 038): `feature/docs-repo-tree`, PR
open, waiting for the owner's merge. Production runs PR #16 (deployed 2026-11-19).
Docs show each repo's `docs/` folder by default (decision 039): `feature/docs-default-folder`, PR open,
waiting for the owner's merge. Production runs PR #17 (whole repo by default, deployed 2026-11-19).

First Cloudflare deploy (blocked on the owner's account steps, above).

Expand Down
3 changes: 2 additions & 1 deletion docs/decisions/038-whole-repo-tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Date: 2026-11-19 · Status: Accepted (owner: "I want the repos to have folders. Then I want to see the
regular structure that's in the repo itself.") · Supersedes the "files outside the folder are not
shown" part of 011, and the default folder in 035
shown" part of 011, and the default folder in 035 · **Default superseded by 039** (docs/ again; the
whole repo stays an option)

## Context
Phase 4 showed only each repo's `docs/` folder, and a repo that had not synced yet waited for a
Expand Down
26 changes: 26 additions & 0 deletions docs/decisions/039-docs-folder-default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 039 — Each repo shows its docs/ folder by default

Date: 2026-11-19 · Status: Accepted (owner: "show only docs by default.") · Supersedes the default in 038

## Context
Decision 038 made the whole repo the default root. The owner wants only each repo's `docs/` folder
shown and the rest of the files hidden.

## Decision
- **A newly linked repo shows `docs/`.** The tree keeps 038's shape: the repo is the top folder, with
`docs/`'s own folders inside it. Files outside `docs/` are not in the tree, the API, or reachable
by URL (`isDocVisible`).
- **"Whole repo" stays an option per repo.** An Admin clears the folder in Settings → Docs folders.
Any other folder also works.
- **Migration 0007** moves rows on the 0006 default (`""`) back to `docs`. Production had no linked
repos, so no one had chosen the whole repo on purpose.
- Everything else in 038 stays: automatic loading, relinking keeps settings, images go to `assets/`
next to the doc. The hide folder counts from the docs folder again (`internal` hides
`docs/internal/`).

## Alternatives considered
- **Markdown files only in the tree:** offered; not chosen. Every file under `docs/` shows, images
included.

## Consequences
- A repo without a `docs/` folder shows "Nothing on this branch yet. Create a doc to start it."
11 changes: 6 additions & 5 deletions docs/features/docs.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Docs on web — tree, rich-text editor, commits

Shipped 2026-11-19 (Phase 4, PR #16; whole-repo trees in `feature/docs-repo-tree`). Decisions 008, 011, 012, 035, 036, 037, 038.
Shipped 2026-11-19 (Phase 4, PR #16; whole-repo trees in `feature/docs-repo-tree`). Decisions 008, 011, 012, 035, 036, 037, 038, 039.

## What it does
- **Docs** in the workspace sidebar shows each linked repo as a folder holding the repo's own
structure: every tracked file (decision 038). An Admin can narrow a repo to one folder and pick
its branch in Settings → Docs folders. Markdown files open in the editor; images and other files
- **Docs** in the workspace sidebar shows each linked repo as a folder holding its `docs/` folder's
own structure (decisions 038, 039). Files outside `docs/` are hidden. An Admin can pick another
folder, or the whole repo (empty), and the branch in Settings → Docs folders. Markdown files open in the editor; images and other files
open through an access-checked proxy. Repos load on their own, with no button.
- The editor opens in **Rich text**: formatted text with markdown marks hidden off the cursor's
line (decision 037). **Markdown** shows the plain source. A toolbar and ⌘B / ⌘I / ⌘S format and
Expand Down Expand Up @@ -61,7 +61,8 @@ against `gh_doc_files`. Text is fetched on first open and cached by blob sha.
`workspace_repos.docs_path`, `.docs_branch`; `workspaces.hide_folder`, `.review_bot_doc_edits`;
`gh_doc_roots`, `gh_doc_files`, `gh_doc_blobs` (cache, rebuilt from GitHub); `doc_pending_prs`;
`doc_presence` (45-second heartbeat rows). Migration `0005_docs.sql`, additive only.
`0006_docs_whole_repo.sql` moves rows on the old `docs` default to `""` (the whole repo).
`0006_docs_whole_repo.sql` moved rows to `""` (whole repo); `0007_docs_default_folder.sql` moves them
back to `docs` (decision 039). Linking writes `docs` for new repos.

## External services
GitHub App permissions already in the manifest: Contents (rw), Pull requests (rw). Webhooks
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/docs/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
export const MAX_PATH_LENGTH = 400;
/** The whole repo (decision 038). A root is "" or a folder path. */
export const REPO_ROOT = "";
/** What a newly linked repo shows (decision 039). */
export const DEFAULT_DOCS_ROOT = "docs";

// Control characters and backslashes never appear in a path we accept.
const BAD_CHARS = /[\u0000-\u001f\u007f\\]/;
Expand Down
3 changes: 3 additions & 0 deletions packages/db/migrations/0007_docs_default_folder.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Decision 039: newly linked repos show docs/ by default. Rows on the 0006 default ("" = whole repo)
-- go back to docs; production had no linked repos when 0006 ran, so no one chose "" on purpose.
UPDATE `workspace_repos` SET `docs_path` = 'docs' WHERE `docs_path` = '';
Loading
Loading