Skip to content

feat(studio): credit sources on cards and redraw the More Info panel - #91

Merged
jm-rivera merged 2 commits into
feat/getdata-answer-panelsfrom
feat/studio-card-panels
Nov 1, 2026
Merged

jm-rivera merged 2 commits into
feat/getdata-answer-panelsfrom
feat/studio-card-panels

Conversation

@jm-rivera

@jm-rivera jm-rivera commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Studio cards credit their sources in a short line, and the More Info panel opens with the calculation, credits publishers and cites with a link a reader can follow. Cards drag from their head and frame, so their content can be clicked and selected.

Changes

  • Canvas title: the 45-character cut is gone; the title runs to the card filters and opens in full in a hover popup (WorkspaceToolbar.tsx).
  • Card source line: "Source: X +N more" with a small More Info mark, no indicator count, and no credit drawn from the attribution label of a described card (sourceLine in src/lib/chat/widgets.ts; CardChrome.tsx).
  • Computed cards credit the sources their inputs hold, read from the description's source entries; entries with a content_version are inputs (isInputSource, describedSources).
  • More Info: "Calculated as" for quotient and share cards, publisher-first sources, Short and Reference list citations, and a "Create a public link to cite" button that mints a card snapshot once per card version (calculationOf, citeForms in descriptionBlocks.ts; citeLinkKey in infoPanel.ts; CardInfoPanel.tsx; Studio.tsx).
  • POST /api/share returns the snapshot's servedAt, so the citation reads "data as of" (src/app/api/share/route.ts, readShareAnswer).
  • How this card was made: a step rail of short verb and object rows built from the description's steps (stepRows; ServedStep keeps input and inputs).
  • Drag: one press decision for card drag and board pan; mouse presses on the head or frame drag after 4 px, presses on content click and select text, and touch or read-only canvases still pan (src/components/organisms/Studio/canvas/cardPress.ts, useCardDrag.ts, usePan.ts).

Notes for reviewers

  • Computed cards name their publishers once dfo-apis serves credited source entries; until then a computed card reads "Source: DFO calculation".
  • description-computed-quotient.json stays byte-identical to the dfo-spec-kit vector; the credited shape lives in the local description-computed-quotient-credited.json.
  • The source line keeps "Source:" whole with :has(); older browsers let it shrink.
  • The motion-kit films reference CardChrome and Whiteboard classes this change renames or removes, and need recapturing.

Testing: pnpm lint, pnpm lint:css, pnpm typecheck, pnpm test (2,212 pass on this layer) and pnpm build pass. Before and after screenshots of a seeded conversation are below.

Screenshots

Before is origin/dev (b91925c) and after is this branch, at 1440 by 900. Both ran against a local Postgres seeded with the same two saved conversations, loaded at /studio/.

Change Before After
Canvas title: more of the long title shows before the ellipsis before 01 after 01
Hovering the title shows the full text in a tooltip Not present after 01
Source line on a bar card: one line reading "Source: ..." with an info icon, beside the Built with DFO mark before 02 after 02
Source line on a stat card: one line with the mark in place of a two-line footer that clipped it before 02 after 02
More Info, top: a Calculated as block, and a Short and Reference list toggle for the citation before 03 after 03
More Info, How this card was made: the steps read as a timeline in place of three paragraphs before 03 after 03
Drag from the title row: the card moves in both builds before 04 after 04
Press on a legend and drag: the card stays in place and the legend text is selected before 04 after 04
Press on a table cell and drag: the card stays in place and the cell text is selected before 04 after 04

@jm-rivera
jm-rivera added this pull request to stack #93 October 31, 2026 22:25
The canvas title runs to the card filters and shows in full on hover
(WorkspaceToolbar.tsx, clipTitle removed). The card foot credits its
sources as "Source: X +N more" with a small More Info mark, drops the
indicator count, and credits a computed card's input publishers
(sourceLine in lib/chat/widgets.ts).

More Info shows the calculation first for quotient and share cards,
lists sources publisher first, offers short and reference citations,
and mints a public snapshot link for the citation; POST /api/share
returns the snapshot's servedAt. How this card was made is a step
rail (descriptionBlocks.ts stepRows). Cards drag from the head and
frame after a 4px move, so content clicks and selects text, while
touch and read-only canvases still pan (canvas/cardPress.ts).
The pending request lived in CardInfoPanel, so reopening More Info
re-enabled the button and a second click minted a second public
snapshot. Studio now holds the request per `citeLinkKey`
(`citeLinkOnce`) and reuses it until it settles.
@jm-rivera
jm-rivera force-pushed the feat/studio-card-panels branch from 7fd1f9d to ba16575 Compare October 31, 2026 22:45
@jm-rivera
jm-rivera marked this pull request as ready for review October 31, 2026 23:34
@jm-rivera
jm-rivera merged commit 13c1a02 into dev Nov 1, 2026
2 checks passed
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.

1 participant