Commit History
17 days ago
-
fix: fall back to the description in the hero when there is no subtitle
Matches the template's index.astro (subtitle || description). The editor shows the description as a full-strength placeholder that typing replaces. Co-authored-by: Cursor <cursoragent@cursor.com>170c4a2
18 days ago
-
feat: port the template's new page layout to the editor and published articles
The editor view and the published page now use the research-article-template layout mirrored in frontend/src/styles/template-layout/: one CSS grid with named lines (screen, page, toc, outset, body, margin) and the 1280+ / 1101-1279 / <=1100 tiers, for both the "article" and "paper" templates. Published page (backend/src/publisher): - layout-chrome.ts renders the template markup: centered hero (title, subtitle, then banner), meta columns (authors, affiliations, published + reading time + DOI, Resources with PDF/Cite buttons and the links row), line TOC rail with slim top bar and drawer, paper hero with link pills, footer without citation/DOI blocks for "paper" - <main class="tiptap"> is the page grid; wide, full-width and sidenote wrappers get the template classes, wide embeds get html-embed--wide - the generated layout runtime replaces the old inline TOC/hash scripts: heading anchors, scroll-spy, margin sidenote placement, Cite popover, debug grid on ?grid - <html data-t…eab9566 -
build: mirror the research-article-template page layout
Add `npm run sync:template-layout` (backend/scripts/sync-template-layout.mjs). It copies the template's grid tokens and layout stylesheets into frontend/src/styles/template-layout/ with @custom-media resolved (neither Vite nor the publisher runs PostCSS), lifts the paper hero styles out of HeroPaper.astro, copies the link icons, and bundles the layout scripts (TOC, heading anchors, sidenotes, meta columns, debug grid on ?grid) into backend/src/publisher/layout-runtime.generated.ts. `--check` reports drift. Co-authored-by: Cursor <cursoragent@cursor.com>e5e073b -
feat(demo): open the live demo on the template showcase article
The demo now loads demo-assets/showcase/article.json (made by npm run import:showcase) and falls back to the built-in sample article. build:demo copies demo-assets next to the bundle; regular builds do not. The simulated session takes its anchors from a script: on the showcase, Alice extends the welcome paragraph, Bob swaps a word in the audience list and the agent rewrites a sentence, then adds a chart of the article's own word count per section. Co-authored-by: Cursor <cursoragent@cursor.com>b37d969 -
perf(frontend): mount embed iframes and load images only near the viewport
Charts boot when they come within 800px of the viewport and then stay mounted, so long articles no longer start every iframe at once. Co-authored-by: Cursor <cursoragent@cursor.com>6d7d323 -
perf(frontend): load Mermaid, Shiki grammars and language detection on demand
- Mermaid is imported when a diagram renders - the editor uses shiki/core with the JavaScript regex engine and fetches each grammar the first time a block needs it; only SHIKI_LANGS ship - highlight.js language detection loads with the first language-less block - the chat panel and Embed Studio are lazy components - shiki-langs.ts holds the shared language/theme constants without a runtime Shiki import; the publisher keeps the eager highlighter Entry chunk: 2.79 MB -> 1.60 MB (813 KB -> 492 KB gzip). Co-authored-by: Cursor <cursoragent@cursor.com>d840d7c -
feat(frontend): browser-only live demo mode
VITE_DEMO=1 builds (or ?demo in dev) run the editor with no backend: - a local Y.Doc behind a LocalProvider, no IndexedDB, fresh on every load - scripted co-authors (Alice, Bob and Alice's agent) editing the sample article through Yjs awareness, pausing while the visitor types, replaying in a loop, and toned down for prefers-reduced-motion - AI chat, embed chat, publish, history, preview, DOI lookups and the embed check switched off with clear UI states; uploads stay inline - a network guard that fails any request to backend routes locally - Download .mdx built in the browser with the shared Markdown renderer - build:demo script and y-protocols as a direct dependency Co-authored-by: Cursor <cursoragent@cursor.com>6e392fe
19 days ago
-
feat(frontend): static refined flat mark and favicons
Co-authored-by: Cursor <cursoragent@cursor.com>dd04bb6 -
feat(frontend): animated Weave logo and orbit loader
Co-authored-by: Cursor <cursoragent@cursor.com>eb6b368
20 days ago
-
feat(mcp): chart and publish tools, structured errors, JSON 404s
- Chart tools for external agents: create_embed (contract validation, data files, version 1, rendering check), insert_embed (after a block with expected_rev, caption, also in apply_edits), update_embed (html, patch or config values, expected_version, Studio draft guard), restore_embed_version, get_embed, list_embeds, check_embed. Every write is a version attributed to the agent; session undo and "Undo its changes" also revert charts. - publish and get_publish_status run the Publish button's flow (now a shared publish service): idempotent while a publish runs, absolute URLs, agent-attributed version. get_article_info states that a Space hosts a single article. - Errors carry a stable code and details in structuredContent (rev_conflict, version_conflict, draft_in_progress, invalid_embed...). - Unknown /.well-known, /mcp and /api paths answer a JSON 404 instead of the editor page, so MCP OAuth discovery falls back to the bearer token. - One headless Chromium job at a…2525af6 -
feat(embed-studio): tweak panel, inspect, automatic check, launcher, inline edit
- Tweak panel: embeds declare 2 to 6 settings in a data-embed-config JSON block (contract + agent prompt updated, runtime 1.2.0 exposes them as ctx.config and applies embedConfig messages live). Sliders, colors, selects, toggles and text update the preview instantly with no model call and are saved back as "manual tweak" versions. - Inspect: a point-and-click inspector in the studio preview; the picked element becomes an @this pointer for the next message, and a label held by a text setting can be edited without the AI. - Automatic check after each iteration: POST /api/embed-check renders the chart in headless Chromium (light/dark, 360/680 px, CDN-only network, one at a time) with the embed checker, now in src/embed-check, and the studio shows "N checks passed, 1 warning [Fix]". - Launcher for new figures (description, CSV drop, 4 gallery starters from GET /api/embed-starters, existing charts) from the top bar and the slash menu, instead of opening a random chart.…4953bfd -
feat(embed-studio): drafts with Apply to article, compare, data drawer
- The studio edits a shared draft (Y.Map("embed-drafts")); the article keeps the applied chart until "Apply to article". New charts from the slash menu or the top bar get their node only on Apply, at the cursor position kept as a Yjs relative position: no more empty nodes. - Closing with unapplied changes offers apply, keep draft or discard; the node shows "X is editing this chart" (awareness) or "Unapplied draft by X". Charts already in the article are not renamed. - Before/after compare reuses the two preview iframes side by side, with a line diff in the Code tab. - Docked data drawer with typed columns and a "used by this chart" flag; files dropped on the chat and tables pasted into it become data files attached to the next message. - "Writing chart... N lines" while the tool input streams. - The conversation of each chart is shared in Y.Map("embed-chats") (readable text only) instead of localStorage. Co-authored-by: Cursor <cursoragent@cursor.com>f7733a1 -
feat(embed-studio): error loop, versions, chips and preview controls
- Preview errors reach the agent: a studio-only reporter in the srcdoc relays uncaught errors, rejections, failed loads and embed:error to the parent; the studio shows "The chart threw ... [Fix it]" and sends one automatic fix per user message. - Versions per agent turn in Y.Map("embed-versions") (shared, capped at 20): vN / Restore / Compare under each reply, Undo last change; restore appends a copy so history stays linear. - Starter and follow-up prompt chips, preview width presets (Article, Wide, 360) and a local light/dark toggle pushed with setTheme. - The agent's title and source land on the node; Shiki code view with Copy and Download. - Provider errors keep their HTTP status; 401/402/429 become actionable messages with Retry; model name in the header; Done replaces Save & Close; no more fake "Generating chart..." banner. - Minimal mobile layout: files drawer and Chat / Preview tabs under 900px. Co-authored-by: Cursor <cursoragent@cursor.com>461e15a -
feat(safety): rescue text removed by someone else's change, with real-life scenario tests
Deleting a paragraph in Yjs deletes everything inside it, so an agent revert, a version restore, a stale tab's delete or offline edits into a paragraph removed meanwhile silently dropped other people's words. - The server copies text deleted by someone other than its author into the doc's "rescued" map (authorship learned per Yjs client from the authenticated connection and kept in the doc). - Each tab copies its own text when a remote change removes it, the only place text typed into an already-deleted paragraph still exists. - History panel lists removed text with Put back / Copy / Dismiss; the author gets a banner pointing there. - tests/scenarios: real server process, browser-equivalent tabs and a chaos proxy (freeze, offline, server death) covering stale tabs, deploys, crashes, offline work and bulk removals. Co-authored-by: Cursor <cursoragent@cursor.com>9175180 -
feat(versions): version history, agent revert and safer MCP edits
- Checkpoints (local + dataset versions/<doc>/) every ~15 min of editing, before and after each agent session, on publish, on demand and before any restore, attributed to the humans and agents who edited. - History panel: versions grouped by day, block-level diff against the current text, restore applied as a minimal new change. - Agent avatars offer "Undo its changes", reverting everything the live session wrote while keeping other people's edits. - MCP: block rev in read_article with expected_rev checks, atomic apply_edits batches, save_version, and structuredContent results. Co-authored-by: Cursor <cursoragent@cursor.com>62809b0 -
feat(storage): keep the live document in an HF Storage Bucket, alert on failing saves
The live Yjs state is saved every few seconds; as git commits on the dataset that bloats history and hits commit rate limits. It now goes to an overwrite-in-place Storage Bucket (HF_BUCKET_ID, default <SPACE_ID>-live). A live-store.json marker in the dataset records the move so a stale dataset copy is never loaded or written again; before the marker exists both copies are merged as CRDT updates. Tokens that can't use buckets fall back to the dataset. Cloud save failures lasting over 2 minutes show a banner to everyone editing with a backup download, and ALERT_WEBHOOK_URL is posted to after 5 minutes and on recovery. Co-authored-by: Cursor <cursoragent@cursor.com>529800c -
feat(editor): open the author form directly on an empty byline
Co-authored-by: Cursor <cursoragent@cursor.com>33cd7bc -
feat(editor): preserve shared content the schema can't display
Use y-tiptap onInvalidContent so unknown nodes written by a newer client or an agent stay in the Y.Doc instead of being deleted. Editing pauses with a banner until the content fits again. enableContentCheck is avoided on purpose: it would make setContent and insertContent throw on unknown HTML. Co-authored-by: Cursor <cursoragent@cursor.com>f05b589 -
fix(editor): sanitize peer colors and avatars from awareness
Any client, including an external agent, can broadcast arbitrary identity fields. Colors are restricted to hex before reaching style attributes and avatars to https URLs (HF-relative paths resolved). Also adapts the cursor user type to y-tiptap 3.2. Co-authored-by: Cursor <cursoragent@cursor.com>7ee8dc5 -
feat(embeds): shared Embed.mount runtime, checker, gallery and evals
- Own the embed runtime and authoring guides in embed-kit/ and generate the runtime and agent skill into backend/src from them. - Embed Studio prompts and tools target the Embed.mount contract; seed embeds are migrated to it. - Add a headless checker (check:embeds), an eval harness with comparison report, and a gallery of showcase embeds and banners. Co-authored-by: Cursor <cursoragent@cursor.com>4e112fd -
feat(collab)!: migrate to Hocuspocus v4 and harden persistence
- Upgrade Hocuspocus 3 -> 4.8, Tiptap 3.33, @tiptap/y-tiptap 3.2, Yjs 13.6.33 and require Node 22 (Docker images and README). - Wire Hocuspocus v4 custom integration (web Request, forwarded messages and close events) and freeze inbound edits before the final shutdown snapshot. - Fail-closed document loading, atomic local writes, ordered HF pushes with retry, and a cloud-pull error stage in the sync indicator. - Run typecheck and tests as blocking steps in the Docker build, the only CI gate for a Space that deploys on push. - Add data-safety, storage-ordering, shutdown-flush and auth-guard suites, plus an opt-in Playwright collab-sync E2E test. BREAKING CHANGE: Node 22+ is required; y-tiptap 3.2 drops position migrations, so every collaborating client must reload after deploy. Co-authored-by: Cursor <cursoragent@cursor.com>3557a6a
-
fix(highlight): auto-detect language for code blocks without explicit lang
Code blocks authored without a language rendered as plain text in both the editor and the published output (Shiki falls back to "text"). Add a shared lowlight-based detector and use it as a fallback in the editor decorations and the publish transformer, so language-less blocks get highlighted identically everywhere - including in already-written articles. Co-authored-by: Cursor <cursoragent@cursor.com>700adac
-
feat(editor): inline author editor with affiliation typeahead and DnD
Simplify the Authors & affiliations modal UX without changing the data schema: - Add/edit authors inline (drop the separate AuthorInlineForm modal). - Attach affiliations via a single typeahead that matches an existing one or creates a new one in one gesture. - Collapse the affiliations list (reorder + rename + URL) behind a disclosure since it is rarely touched. - Replace up/down chevrons with a grip handle and native drag-and-drop reordering for both authors and affiliations. Store gains atomic addAuthor/updateAuthor (create + attach new affiliations in one transaction) and auto-prunes orphan affiliations with 1-based index remapping. The agent tooling and system prompt follow the new author-driven affiliation model. Co-authored-by: Cursor <cursoragent@cursor.com>53c7a9e -
fix(editor): use explicit class for multi-count avatar z-index
Replace the :has() selector with an explicit --multi modifier class for reliable cross-browser support of the overlapping collaborator avatars. Co-authored-by: Cursor <cursoragent@cursor.com>6b2bf82
-
feat(editor): dedupe connected collaborators by identity
The presence avatars were keyed by Yjs awareness clientId, so the same person showed up once per connection: every extra tab/device, and every lingering pre-timeout socket left behind by a reconnect (amplified by the refocus re-sync), rendered the same circle again. Collapse awareness clients sharing an identity (HF username, falling back to avatar URL then clientId) into a single avatar, with a "xN" badge + tooltip when a person has multiple live sessions. Co-authored-by: Cursor <cursoragent@cursor.com>a0b96b1 -
feat(editor): authors & affiliations manager modal
Replace the undiscoverable inline drag with a single, discoverable modal for the whole byline. From the hero (pencil button, clicking an author, or clicking an affiliation) users open AuthorsManager to add/edit/remove authors and affiliations and reorder both lists via explicit up/down controls. - store: add updateAffiliation/removeAffiliation; removeAffiliation reconciles every author's 1-based references (drop + shift) like moveAffiliation does - extract AuthorInlineForm into its own file, reused as the add/edit form (stacked dialog) inside the manager - affiliations get inline name/URL editing with debounced commits - drop the inline drag-and-drop handlers/styles from the displayed header Co-authored-by: Cursor <cursoragent@cursor.com>005eeff -
fix(editor): preview the banner correctly in the Embed Studio
The studio built every preview srcdoc without fullBleed and let the iframe fill the whole preview pane, so the banner (an edge-to-edge 5:2 embed) was rendered like a height-reporting chart and looked nothing like the hero. When editing banner.html, build the srcdoc with `fullBleed: true` and render it inside a centered 5:2 stage (matching .hero-banner dimensions), so the studio preview is a true WYSIWYG of the published header. Regular charts are unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>3d7f9ad -
feat(editor): Embed Studio button in the top bar
Adds a chart button to the TopBar that opens the Embed Studio. Smart entry point: when charts already exist it opens the studio on one of them (prefers a real chart over the always-present banner) without mutating the document; only when there is no chart does it fall back to inserting a fresh one, mirroring the slash menu's "New Chart" flow. Both paths route through the existing `open-embed-studio` event so session/key handling stays in one place. Co-authored-by: Cursor <cursoragent@cursor.com>2dfb335 -
feat(editor): drag-and-drop reordering for authors and affiliations
Authors and affiliations in the hero meta header can now be reordered by dragging. Reordering affiliations remaps every author's 1-based affiliation indices in the same Yjs transaction, so superscripts keep pointing at the right institution. Drop affordances (grab cursor + primary-color edge marker) live in the editor-only _hero-editable.css and never leak into the published HTML. Co-authored-by: Cursor <cursoragent@cursor.com>a2d6d01
-
test(editor): extract refocus re-sync into a unit-tested module
Pull the tab-refocus liveness/lock logic out of the Editor effect into a pure createRefocusSync() so it can be exercised without a browser. Add vitest coverage for the four cases it must distinguish: healthy (no lock), disconnected (lock + unlock on synced), dead readyState, half-open socket (lock after the post-forceSync probe), and the offline grace release. The effect now only wires the visibilitychange trigger. Co-authored-by: Cursor <cursoragent@cursor.com>45d6656 -
feat(editor): local-first persistence + robust refocus re-sync
Prevents a stale never-closed tab from clobbering a collaborator's newer content (the core data-loss incident): - Mesh y-indexeddb onto the shared Y.Doc so edits survive refresh / offline, and a client can re-sync its durable local copy back up if the server ever loses or resurrects a stale document. - On tab refocus, force a sync round-trip and hold the editor read-only until it completes, so the user can't type onto a visibly-stale buffer. Detect dead sockets via websocket status, readyState and last-message timestamp (incl. half-open sockets via a post-forceSync probe). Always release after a 4s grace window so offline editing is never trapped (local-first). Co-authored-by: Cursor <cursoragent@cursor.com>fe9b487
-
feat(hero): persistent Edit + Delete buttons on the banner
A filled banner now exposes two buttons in a top-right action cluster: - Edit (PencilLine icon) - opens the Embed Studio on the banner key so authors can iterate on the HTML via the AI agent, just like any other htmlEmbed. Works whether the banner is an image upload, a chart placeholder, or a custom fragment. - Remove (Trash2 icon, danger hover) - same behavior as before. Both buttons are constantly visible instead of fading in on hover: the banner is a first-class authoring surface and a hidden mutation affordance was confusing once you'd seeded the placeholder content. CSS shifts from .hero-banner-remove (single button, opacity-gated) to .hero-banner-actions (cluster) + .hero-banner-action (per-button styling, always opacity:1). Danger variant tints the Remove button red on hover/focus so the destructive action is still distinguishable from the Edit one. Co-authored-by: Cursor <cursoragent@cursor.com>55f5851 -
feat(auth): surface canEdit in the topbar with an access badge
`/api/auth/status` already returned a `canEdit` flag derived from the HF whoami roleInOrg (Space owner, or org write/admin/contributor with a write resource group), but the frontend was ignoring it. Result: read-only users saw an enabled Publish button + the regular user chip, then hit a confusing 403 from the backend on every mutating action. - App.tsx plumbs `canEdit` from /api/auth/status into a new state and forwards it to TopBar. - TopBar renders a small badge next to the user chip: "Editor" (green outline + PencilLine icon) when canEdit, "Read-only" (muted + Lock icon) otherwise, both with a tooltip explaining the state. - Publish button is disabled when !canEdit with a matching tooltip, so the read-only restriction is visible up front instead of after a failed network round-trip. - `.chip--editor` and `.chip--readonly` variants added to _ui.css. Co-authored-by: Cursor <cursoragent@cursor.com>0e7d2a3 -
feat(editor): Iframe embed component for remote URLs
Adds a new atomic component `Iframe` (slash menu icon 🔗) that embeds an arbitrary remote URL via `<iframe src=...>` instead of inlining HTML from the embed store. Use case: integrating widget Spaces (e.g. carbon- tokenization-widgets) without having to download and adapt their HTML to the strict create-html-embed conventions. - Shared component def (atomic, fields: src, title, desc, height, wide) - Custom NodeView with live iframe preview, Settings + Reload buttons, auto-resize when the remote page emits postMessage({type:"embedResize"}) - Publisher transformer emits <figure class="html-embed"> reusing the existing iframe/figcaption markup so styling and figure numbering carry over for free - llms.txt renderer surfaces the URL as a Markdown link - 3 publisher tests covering happy path, empty-src drop, and wide flag Co-authored-by: Cursor <cursoragent@cursor.com>0c69852
-
fix(toc): scope the hide-on-mobile rule to the desktop TOC only
The previous rule hid every `.table-of-contents` on narrow viewports, which also matched the React component re-rendered inside `.toc-mobile-sidebar` (the hamburger drawer). Result: the drawer opened to an empty body. Scope the hide to `.content-grid .table-of-contents` so the drawer copy of the same component stays visible. Co-authored-by: Cursor <cursoragent@cursor.com>bf08f85 -
feat(editor): code block button in the bubble toolbar
Code block was reachable only via the slash menu (`/code`). The bubble toolbar already exposes Bold / Italic / Strike / inline Code / Heading / Quote / Link, so a code block button fits naturally alongside Quote (the other block-level toggle in that row). - Uses lucide `Code2` (chevrons with a slash) to keep it visually distinct from the existing inline `Code` icon next to it. - Active state mirrors the slash-menu behaviour: lights up when the caret is inside an existing `codeBlock` node, so a second click toggles back to a regular paragraph. - Placed between Quote and Link to mirror the slash menu's own order (Quote -> Code block -> Divider). Co-authored-by: Cursor <cursoragent@cursor.com>add3959 -
feat(storage): first-class data - no silent failures in the persistence pipeline
The "Saved" label in the top bar used to be a comforting lie: several failure modes (createRepo 403 on a missing manage-repos scope, writeFileSync on a readonly FS, uploadFile mid-debounce network blip) all collapsed into a console.error that the editor never surfaced. A user could type for an hour, see "Saved" the whole time, lose their tab, and discover only after the container rebuilt that nothing had ever made it to the dataset. Make every link in the chain observable, and make the worst signal always win in the UI. Backend ------- - In-memory `StorageStatus` tracker in hf-storage.ts: - `datasetReady` (createRepo succeeded or returned 409) - `lastLocalSaveAt` / `lastCloudPushAt` epoch ms - `pendingPush` (a debounce timer is armed) - `lastError {stage, message, statusCode, at, docName}` where `stage` is one of `dataset-create | local-save | cloud-push` Every write path records success; every error path records the failure. Success on one stage clears the error for …7a42df5
-
feat(editor): show connected collaborators in the top bar
The collab cursors already render inline next to each peer's selection, but if no one's actively editing right now you have no way to see who else is in the room. Surface that in the top bar as an overlapping row of small avatars (24px circles, -6px overlap, max 4 visible + "+N" badge for the tail), placed just before the SyncIndicator. Data source: the same Y.js awareness states that CollaborationC ursorV3 already populates with \`{ name, color, avatarUrl }\` for every client. We listen to awareness "change" events and re-derive the list on each tick, excluding our own clientID so the user doesn't show up to themselves (they already see their own chip on the far right). Implementation notes: - Border color of each avatar mirrors the user's collab color (same hue as their cursor caret in the doc) so it's obvious at a glance which avatar maps to which inline cursor. - Fallback to a colored initial when avatarUrl is missing (Anonymous sessions before HF OAuth resolves). - Sort by…aa09c01 -
fix(editor): footer credit links to the editor Space too
The editor's own footer (EditorFooter.tsx) still pointed at the legacy Astro-only static template. Mirror the publisher-side fix and link to the editor Space instead, so authors see the same canonical entry point whether they're editing or reading the published page. Co-authored-by: Cursor <cursoragent@cursor.com>2bed071 -
fix(hero): live-commit on every keystroke, not only on blur
EditableText (the inline text field used for the title, subtitle, description and link labels in the hero) used to maintain a local React draft and only push the value to Yjs on blur or Enter. Net effect from the user's POV: the sync indicator stayed on "Saved" while typing, the doc didn't actually update until focus left the field, and on a slow tab-out or a browser crash mid-edit the work was lost. Felt unsaved. Switch to a 300ms debounce model: - Every onChange schedules a commit. If the user keeps typing, the timer resets - so we still get one Yjs update per "pause" instead of one per keypress. - onBlur and Enter flush immediately (no laggy "wait for the debounce" feel when committing the field by leaving it). - Escape cancels the pending commit and reverts the on-screen draft to the last server-confirmed value. Note that anything already committed during typing is still in the doc - the user gets it back with Yjs undo (Ctrl+Z), same as Notion / Linear. - las…82e43b6 -
fix(editor): SyncIndicator now reflects hero/settings/citation edits
The "Saving..." / "Saved" badge in the topbar used to listen only to TipTap's editor.on('update') event. That event fires solely for prosemirror document changes - i.e. when the article BODY is edited. The hero (title/subtitle/authors/links/...), the per-article settings, citations, embeds and the comment store all live in sibling Y.Maps on the same Yjs document. Edits there don't round-trip through TipTap, so they never triggered the indicator. Net effect for users: editing the hero felt like a no-op - no "Saving..." feedback - and the natural conclusion was "this isn't being saved", even though the backend's Hocuspocus onChange handler was happily persisting the full ydoc on every Yjs update. Subscribe one layer lower, on ydoc.on('update', ...). That callback fires for any Y.Map / Y.Array / Y.XmlFragment change in the document, which exactly mirrors what the backend persists. The indicator now flashes "Saving..." for every kind of edit and settles back to "Saved" once the write deb…adb1aa1 -
feat(auth): sign-out button in the editor topbar
Wraps the user chip in the topbar with a dropdown that exposes a "Sign out" action. Matches the visual + interaction pattern of the adjacent "More actions" menu so the two feel like a coherent toolbar element rather than a one-off. Backend (routes/auth.ts + auth.ts): - New POST /api/auth/logout (with a GET alias for ops/debug). handleOAuthLogout clears the hf_access_token cookie, mirroring every attribute the original res.cookie(...) used in handleOAuthCallback - browsers only delete a cookie if the new "expired" Set-Cookie matches path/secure/sameSite, otherwise we end up shipping two cookies and the session sticks. - POST is the canonical method so the call can't be hijacked by a cross-site <img>/<form> request; GET stays available for curl debugging and incident response. Frontend (TopBar.tsx): - Chip becomes a <button> with aria-haspopup="menu" that toggles an account menu. Color/avatar/name unchanged - same visual. - Dedicated state + ref (accountMenu…d10f68e -
fix(editor): SyncIndicator was stuck on "Disconnected" forever
The <Editor> creates the HocuspocusProvider lazily and assigns it to providerRef.current AFTER the surrounding components have mounted. <SyncIndicator> was wired with \`useEffect(..., [providerRef])\` and early-returned when providerRef.current was null. Because a ref doesn't trigger re-renders, the effect never re-ran once the provider arrived, so no listeners were attached and the status stayed "disconnected" regardless of the actual WebSocket state. The bug was always latent but became visible now that org-owned private Spaces actually get a working WS connection - the auth fix in the previous commit just exposed it. Replace the dependency-only effect with a small polling bootstrap: - Poll providerRef.current every 100ms until it lands. - Once we have the provider, attach connect/disconnect/synced listeners and seed the initial status from configuration.websocketProvider.status. - Add a 1s reconciliation interval that re-reads websocketProvider.status while attached. Some Ho…50f7a20 -
feat(publisher): editor pill shows who you're signed in as
Upgrade the editor quick-link from a bare pencil icon to a proper pill that contextualises the action: ┌──────────────────────────────────────────────────────┐ │ [avatar] Signed in as @tfrere [✎ Edit article] │ └──────────────────────────────────────────────────────┘ The visitor sees who they're authenticated as before clicking, which makes the "would I be writing to the real file?" question self-answering. Useful when multiple HF accounts share the same browser session, or when a collaborator wants to confirm they're not editing on someone else's behalf. Implementation: - Render placeholder content (\"@you\" + empty <img>) so the layout doesn't shift when /api/auth/status comes back. The pill is still \`hidden\` by default - no flash for anonymous visitors. - Inline script fills the <img>.src (preferring user.avatarUrl, falling back to /api/users/<name>/avatar) and the @handle, then drops the \`hidden\` attribute. - New \`.edit-pill\` styles: rounded pill, pa…2b90d0d -
feat(publisher): editor quick-link for signed-in editors
The published article and the editor share the same Space, but a visitor who already has edit rights had no way to jump from one to the other without retyping \`/editor\` in the URL bar. Add a small pencil icon top-right, mirroring the existing theme toggle on the top-left, that links to /editor. Visibility: - Hidden by default (\`<a id="edit-link" ... hidden>\`) so non- editors / anonymous visitors never see a flash. - An inline script probes \`/api/auth/status\` on load and removes the \`hidden\` attribute when \`canEdit\` is true. Fetch failures (offline preview, exported HTML opened from disk, etc.) are silently swallowed - the button just stays hidden. - Hidden under 1100px (same breakpoint as the theme toggle) so mobile / tablet layouts aren't cluttered. Styling: matches the theme toggle (40px circle, page-bg fill, 1px border, soft shadow) so the page stays balanced visually. \`mix(--primary-color)\` tint on hover hints at the destination. Snapshot updated to reflect…44626d0 -
feat(editor): WYSIWYG NodeView for HfUser cards
The HfUser block was rendering as the generic AtomicView - a dashed placeholder card with three labelled inputs - which looked nothing like the actual upstream component (avatar + display name + @handle). Authors couldn't tell what the published page would look like without a round-trip through publish. Replace it with a dedicated NodeView that reproduces the exact DOM of `app/src/components/HfUser.astro` in the editor: .hf-user └─ .hf-user__left ├─ .hf-user__avatar (img or "?" placeholder when empty) └─ .hf-user__text ├─ .hf-user__name (display name) └─ .hf-user__row └─ .hf-user__username (@handle) Inline editor: - Revealed when the node is selected, or when `username` is still empty right after insertion (prompts the author to fill at least the handle). - Three rows: Username / Display name / URL. URL placeholder switches to `https://huggingface.co/<username>` once a handle is known, so the user can see they don't need to…7814104 -
feat(embed-studio): clickable chart list to switch files
The sidebar already lists every chart in the doc but only the current one was highlighted - the others were inert <li>s. Make non-current entries clickable so the user can jump between charts without going back to the article and reopening another embed. - FilesSidebar: optional onSelectChart prop. Non-current items render as a <button class="es-files__item-main"> (same look as the clickable data files), the current item stays a plain <li> with the "editing" badge. - EmbedStudio: forwards onSelectChart to the sidebar. - App: rotates embedStudioSession when switching, so the studio remounts and useEmbedChat's mount-only loadMessages picks up the chat history persisted for the newly-selected file. - CSS: existing .es-files__item--data { padding: 0 } pattern extended via :has() to any .es-files__item that contains a button child, so the <li> padding doesn't stack with the button's own padding. Co-authored-by: Cursor <cursoragent@cursor.com>79008fb -
fix(embed-studio): contextual empty state and input placeholder
The chat panel always said "Describe the chart you want to create" even when a chart was already rendered in the preview pane next to it - confusing because the obvious next action is to ask for tweaks, not to recreate from scratch. Branch the empty state and the textarea placeholder on three situations: - no chart yet (scratch): "Describe the chart you want to create" + the original example prompt - existing chart: "Ask for changes to the chart" + a tweak example - banner mode: phrase both as "banner" instead of "chart" so the hint matches the banner system prompt's mood-setter intent Co-authored-by: Cursor <cursoragent@cursor.com>56a91d6 -
fix(embed): SVG text now follows the iframe theme
Three stacked bugs were keeping the chart text black in dark mode: 1. EmbedStudio mounted both preview iframes with sandbox="allow-scripts" only (no allow-same-origin). The bootstrap script couldn't reach window.parent.document, so the cascade fell through localStorage to matchMedia(prefers-color-scheme) - which returns the OS preference, not the app theme. Result: the iframe could land on a different theme than the article. Aligned the sandbox with HtmlEmbedView ("allow-scripts allow-same-origin"). 2. The THEME_BOOTSTRAP in shared/embed-doc.ts always overwrote the srcdoc-provided data-theme attribute, even when every detection path failed. Honour the existing data-theme before falling back to matchMedia so an explicit isDark from buildEmbedSrcdoc wins. 3. SVG text/line/path don't inherit CSS color the way HTML elements do - their default fill/stroke is "black", not "currentColor". Charts that scoped colours via `body { color: var(--text-color) }` …be7d6fa -
feat(embed-studio): make agent-generated charts theme-aware
The iframe already supports live light/dark swap via CSS variables and a postMessage(setTheme) hot-swap, but the LLM kept generating charts that hardcode colours into SVG attributes (fill="#333", stroke="black", ...). Those values can't be overridden by the parent's data-theme attribute, so the chart looked correct on whatever theme the model guessed and broken on the other one. Two complementary fixes: 1. Forward the current theme (light/dark) from EmbedStudio through useEmbedChat into the request context, and surface it in the system prompt as a "Current theme" section. The model now knows which background it's painting against and can self-correct. 2. Rewrite the "Colors & theming" section of the embed system prompt with a concrete CSS pattern (scoped .d3-* rules driving fill/stroke via var(--text-color), --axis-color, --grid-color, ...) and an explicit ban on hardcoded SVG colour attributes. Add a hint about window.__chartRerender for JS-driven palettes. No…27abbe5