Notebooks: editor, publish, upload, share polish#85
Merged
Conversation
- Sidebar: Notebooks link with Notebook icon
- /notebooks (index): list of personal + community notebooks via
aidbox.notebooks/notebooks RPC, fuzzy search, tag chips for cell
types (rest/sql/markdown), keyboard navigation
- /notebooks/$id (view): renders cells read-only.
- Markdown cells via react-markdown + remark-gfm
- REST cells: raw editor + Send + response with Body/Headers tabs,
status/duration; saved cell.result auto-populates response
- SQL cells: SQL editor + Send + results rendered via shared
ResultContent (db-console table); saved result auto-populates
- /notebooks/$id/edit placeholder
- /notebooks/new placeholder
- /notebooks parent layout for breadcrumb
- Search/tag UX consistency fix in Analytics and ResourceBrowser:
trailing-token isn't promoted to a chip until whitespace is typed
- Markdown code: treat fenced code without a language as a block (was rendered as inline pill); switch block style to typo-code so it matches the rest of the app. - Pre blocks: bleed -mx-3 like REST/SQL cells, add mb-4. - Page layout: drop gap-6 in favor of mt-7 between header and cells, bump container py to 8. - REST/SQL cell wrappers: replace mb-2 with mt-4 mb-4 for breathing room. - Breadcrumb: show notebook name (with id fallback) by reusing the same React Query key as the page; works for both personal and community notebooks via the optional search.path.
- New editor at /notebooks/new and /notebooks/$id/edit reusing the
view-mode REST/SQL/RPC cells with editable values plus a markdown
cell with Edit/Preview tabs. Insert dividers ("+") around every
cell, delete cell action overflows to the left.
- Toolbars (view + edit) match the resource editor: sticky strip with
ghost-style buttons (Edit/Save in link color, others default,
Share dropdown last).
- Run inside cells now saves cell.result back into the notebook and
triggers a background save when the notebook has an id.
- Publish: view-mode action triggers aidbox.notebooks/publish-notebook
on a fresh copy; updates happen automatically on Save when a
notebook is already published.
- Unpublish: extra cleanup save afterwards so publication-id and
edit-secret are cleared on the local notebook; auto-unpublish when
deleting a published notebook.
- Upload: dropdown with "as link" (dialog + import-notebook RPC) and
"as file" (parses the <data value=...> blob produced by Share→As file
and posts import-notebook-as-json).
- Share-as-file now wraps the page section with mx-auto max-w-[990px]
so the exported HTML matches the in-app layout.
- Breadcrumbs: edit route shows Notebooks / <name> / Edit by
injecting a middle crumb that resolves the notebook name.
- Markdown rendering: tighten code-block detection (block when fenced
with language OR multi-line), switch to typo-code, fix layout
spacing between view and edit.
- EDN pretty printer in src/utils/edn.ts (clojure.pprint style) used
for RPC responses with application/edn content type.
- ConfirmDialog primitive for Delete / Publish / Unpublish.
- List dedup: hide the community copy when its origin matches a local
personal notebook.
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.
Summary
/notebooks/newand/notebooks/$id/edit— reuses the view-mode REST/SQL/RPC cell components with editable values, adds a Markdown cell with Edit/Preview tabs,+dividers around every cell, and a left-side delete affordance.mx-auto max-w-[990px]) with ghost-style buttons that mirror Resource editor styling: Edit/Save in link color, Share dropdown last, Publish/Unpublish/Delete next to them.Sendnow persistscell.resultback into the notebook and triggers a background save when the notebook already has anid, so running cells survives reloads. Send/trash become hover-only inside cells; the+divider is always visible.aidbox.notebooks/publish-notebook. Saves on published notebooks automatically piggy-back anupdate-published-notebook. Unpublish clearspublication-id/edit-secretwith a follow-up save so the Publish button comes back. Deleting a published notebook auto-unpublishes first.import-notebook; "file" parses the<data value=…>blob produced by Share→As file and postsimport-notebook-as-json.Notebooks / <name> / Editby injecting a middle crumb that resolves the notebook name (uses the sameuseNotebookDisplayas the view crumb).typo-code, and tighten spacing so view ↔ edit do not shift.src/utils/edn.ts) inclojure.pprintstyle for RPC responses withapplication/edncontent type.ConfirmDialogprimitive backing Delete / Publish / Unpublish.originmatches a local personal notebook.Test plan
/notebooks/new, add cells of every type, run them, refresh — results are persisted and re-rendered.import-url; open another tab and import via Upload → As link./notebooks— Edit/Publish/Delete hidden, Share-as-file still works.Notebooks / <name> / Edit.