Panes
A Pane is a building block of a Parable: one thing a person could ask about on its own, such as a chart, a table, a form, a card or a picker. It bundles everything needed to show and change that one thing, so it can be placed on several Pages, opened by itself, pulled into a chat, reviewed and maintained on its own. A Pane is something a person sees: its code draws what it is for, and its own Palette holds every style it needs, so it looks the same wherever it is opened. Plots, rows and code that several Panes share live in the data-layer Package that holds those Panes, never in a Pane that draws nothing (see the Packages Power). Split a Parable into Panes with one test: could a person ask about this part on its own, and would it make sense alone? Then it is a Pane. A part that only makes sense inside its parent is not a Pane: a label, a legend, an axis, one row of a table, one field of a form, a tab strip, a divider. Split by what a person would ask about, never by how the SQL is written. When several Panes show parts of one answer, put the Plot on the data-layer Package that holds them and let each Pane read the Plot by name: two Panes that read one Plot with the same parameters send one read. That Package’s Policies then decide who reads the Plot’s rows. If the Package is still a folder that owns no Plot, give it a Perception and the Policies of those Panes. If it owns Plots, or already has Policies that differ from those Panes’, leave it as it is: its Policies decide who reads its other Plots, saved rows and data. Put those Panes in a new data-layer Package inside it instead, give the new Package the Policies of those Panes, and move the Plot there. Move no Pane out of another data-layer Package: the filters that reach a Pane also cover the Plots of each Package that holds it. A Pane may place other Panes when it is the thing they make together, such as a card that places its sections. Many things of one kind are rows that one Pane draws as they come into view, never one Pane for each thing. Counts of different things, such as people, teams and documents, are not one kind: each count is a question of its own, so give each its own Pane, even when one Plot counts them all. Never design a Pane to a size: a Pane is as large as its one thing needs, and a Pane that shows several things is too large at any size. The Pane editor drawer has Programming for its React code, Perception for its type, its own data and declared Panes, Palette for its CSS, Policies for who may do what, Plots for its SQL computations and a read-only list of its declared Panes’ Plots, and Panes for one tree of the Panes it declares. Each Plot lists its readers under Read by, and a declared Pane or Plot has Open to reach its own editor. The Perception and Policies are fields of the Pane, saved and versioned with it; the Palette and the Plots are Pieces the Pane owns. Deleting a Pane deletes its Palette, and deleting a Pane whose Plots another Piece reads is refused with those readers named. A Pane has one type: what it shows and what people save on it. There are four kinds of Pane. A Plot Pane owns the Plots it draws. A Plot that its Perception does not declare returns rows of the Pane’s type, in scalar-lib types (see the Perceptions Power), so a Pane has at most one such Plot, and each other Plot declares its own PlotContract under the Perception’s plots (PA-AU-049). A bound Pane has no SQL: its parent declares it with Bound and one field of the parent’s row feeds it as props.value, under the parent’s Policies. A saved-data Pane has no SQL and a type that is not null. When its type has anid field, the values people save on it are rows of that type, one for each item and each actor (see the Preferences Power), such as Categories, a date range, an audience or a switch, and it draws its own rows with no value from a parent. When its type has no id field, it saves no rows: it draws the value its parent gives it. A layout Pane has a null type and holds no data. Any Pane can also own data of its own, which only a proposal changes. Parable never picks a saved row on its own: the Pane’s code reads the item it shows. Referencing another Pane lets it render inside this one, and lets this Pane call that Pane’s Plots and read its rows and data under that Pane’s Policies, without rendering it; it does not transfer ownership, copy saved rows, or pass on permission. Only a Page is composition only: a Pane whose type is null owns no undeclared Plot, but can still use the shared controls and read the Plots of the Panes it declares. Reading a Pane never creates rows or repairs missing configuration. A save, Prepare or Publish that gives a Pane an undeclared Plot while its type is null, or a second undeclared Plot, is refused with an error that names the Pane and its Plots: declare each other Plot’s contract, or give the Pane the type of its undeclared Plot’s rows. A Pane the published Version already holds that way shows an info finding and never stops another change. A Plot on a saved-data Pane is refused too (saved-data-plot): a Pane that declares preload, or that was a saved-data Pane in the last Release, would become a Plot Pane and refuse every save of a row. Move the Plot to the Package that holds the Pane and read it from the Pane by name (see the Packages Power). That Package’s Policies then decide who reads the Plot’s rows. If the Package is still a folder that owns no Plot, give it a Perception and the Policies of the Pane. If it owns Plots, or already has Policies that differ from the Pane’s, leave it as it is: its Policies decide who reads its other Plots, saved rows and data. Put the Pane in a new data-layer Package inside it instead, give the new Package the Policies of the Pane, and move the Plot there. If people save rows over the Plot’s rows, declare overrides: true instead. Prepare and Publish refuse this finding also when the published Version already holds it.
Using a Pane and its value requires view permission on its preferences target. Inspecting its code, Perception, SQL, CSS, or Policies each needs its own view permission, and rendering an allowed Pane never requires seeing its source. Every query and every saved write checks current Policies on the server, whatever the component displays. A Pane’s React runs in the reader’s browser inside a sandboxed frame with no network access; it reaches data only through the host, under the reader’s own permissions, except the Workspace’s files, which a Pane that declares workspaceFiles reads under the rules below. The frame does not submit forms, so a form’s onSubmit never runs: handle the button’s click and the field’s Enter in onKeyDown, and never write a form’s onSubmit or action. JavaScript and CSS delivered to a browser cannot be kept secret, while SQL source can stay private because the server runs it by name. The real trust boundary is the author: treat permission to author or propose a Pane like permission to write its SQL, and review Changes before accepting them. A Pane’s code never acts with more rights than its author. Every proposal, and every save of a row that a Policy reads, is a privileged write. The server refuses it unless the reader and every author of code the frame can run hold the right. The host asks for confirmation, except for an eligible Pane-data edit into the reader’s own Pending Patch in Published Versions. The direct-change conditions on the Panes page still apply, including code provenance and data sight. The frame loads the code of every Page and Pane of the Parable, plus any shared module in its build once a Page is on screen, so each person who last saved any of that code counts.
- State the purpose and the interactions the Pane owns: viewing, configuring, editing, saving, removing, and recovering. Save the purpose as the Pane’s description, in one sentence: every Pane needs one, and a save without it is refused. Reuse an existing Pane when the meaning is the same.
- Define its type. Ponder writes the Perception with one concrete type, with an
idfield when people save items, and decides the kind of Pane: Plot, bound, saved-data or layout. It declares the Pane’s data when the Parable owns values, and the references to other Panes. A Page hands a Pane no value. A Pane that owns a Plot, owns data or saves rows draws what it holds with no value from its parent: itsprops.primitiveis null then, so its code checks it for null when it reads it. Any other Pane takes null only when its type does, such asBasePerception<TicketMonth | null>. A Pane whose type does not take null and that holds nothing of its own shows “Choose a Preference or provide an input.” on a Page, and the save notes it as needs-input. The same is true when its parent Pane renders it with noprimitive. A Pane that takes an input still draws when the Page opens: give its input a default, such as the last 12 weeks or all teams. The person can change it. The parent passes that value asprimitive, or the Pane’s type takes null and its code uses the default whenprops.primitiveis null. - Add the logic. Ponder gives each Pane that shows data the SQL Plots it draws. One Plot may stay undeclared and return rows of the Pane’s type; each other Plot declares its own contract. Pages, Packages, Panes, Plots and Reports share one handle namespace in a Parable, so name the Plot for its rows, such as
membersByRoleRows, not after its Pane. Ponder declares the Plot in the Pane’s Perception as a PlotContract so the code can callplots.<name>(), and writes the React code using the shared controls, declared Panes, and approved packages only. The code renders each Plot’s running and empty states before its rows, in that order. A read that fails never reaches the code: the host shows its error in place of the Pane. The Perceptions Power shows the declaration and the Plots Power shows the states. - Decide persistence. Drafts and temporary choices stay in React state until the person chooses to save. A save is preferences.save(
{ id, value, for }) or preferences.saveMany for many rows at once, and a change to the Pane’s own data is a proposal, data.propose. The server decides whether the host must ask for confirmation; eligible edits into the reader’s own Pending Patch apply at once. A Pane’s code also proposes to the data of a Pane it declares, aspanes.<name>.data.propose, under that Pane’s data Policies. A parent edits the data of the Panes it shows this way. Reads are preferences.get(id) or the preferences.useItem and preferences.useItems hooks, which stay live. After a revision conflict, read the item again without discarding the draft. While context.viewAs is set, someone is previewing the Parable as another person and every save and proposal is refused, so show the controls read-only. - Style and protect it. Ponder writes the Pane’s Palette with Pane-scoped CSS and sets its Policies for who may view, edit, create, and delete.
- Place it on the Pages that need it, in the same save as the Pane, and check each placement. A preview draws no live data, so preview only a Pane that draws without a Plot, and check a Pane that reads a Plot with Check a Pane. A reader sees a Pane only on a Page. Declare a new Pane in the Perception of the Page the person named, or of the Home Page when they named none, and place it in that Page’s layout. A save notes a Pane that no Page reaches as unplaced-pane: fix it in the next save.
column, bar, line, stat, table, funnel, heatmap, or grid for any other shape. It draws that shape in moving squares, so the reader sees what is coming. Give it the chart’s height when it is not the default. A chart whose height depends on its rows, such as bars, a funnel, a table or a heatmap, keeps its height only when you give the height of the rows that will come. A SimpleChart takes loading and draws PlotLoading itself, at the default height of its kind: four bars or five funnel stages. Where one value or one line of text will be, draw Skeleton. Never draw a spinner, a “Loading…” label, an empty card, or a cover over the Page. The platform keeps every Plot result in the reader’s browser, encrypted, for two weeks: a read with the same parameters, Pane values, reading and View as answers at once, after a reload and on a return to the Parable too. A chosen Refresh never reads again. A live Plot on Latest answers at once, then reads again in the background, and newer rows replace the old ones in place while the chart’s marks move to their new values. So a Pane never keeps Plot rows of its own, in React state, localStorage or IndexedDB, and never clears or redraws its chart from nothing when rows change: draw the hook’s rows, keep the same elements, and key each mark by its category, not by its index. New parameters keep the old rows on screen, with refreshing true, until the new rows arrive. Results are dropped when Latest moves to a newer Refresh for a Plot that reads a stored output, and when the reader’s access changes. A save, by the reader or anyone else, updates the rows of the Panes it changed in place, without a reload, and runs again only the Plots that read a changed Pane by name, or read a Plot that does. When a Pane needs newer rows than that, call the Plot hook’s breakCache(): the read goes to the server and replaces the kept result; rerun() is answered from the kept result. A Page needs no loading screen or entrance animation of its own: the renderer draws it unseen until each of its Panes has drawn its component, then settles it in, and covers it with the generating mosaic only while it is being built, as when Ponder writes it. The renderer does not wait for the Plots, so the reader sees each Pane’s placeholders until its Plots answer. Only a switch the reader did not choose, such as the Changes that the reader’s own first proposal opens, keeps the previous Page on screen until the new Page’s Plots answer, for at most 15 seconds.
A Page shows each part as soon as that part’s own Plot answers, and never waits for every Plot before it draws. Each Plot is its own read, so a Pane that owns several Plots draws each part with its own Skeleton until that part’s Plot answers, and the reader sees the first values while the last Plot still reads. A read that fails replaces the whole Pane with its error, so give a part a Pane of its own when it must draw even if another part’s read fails. In a row of cards, each card a person could ask about on its own is a Pane. This is the meetings card, a card a person asks about on its own, which owns the Plot meetingCount; the emails and calls cards are the same with their own Plots. When the cards are parts of one answer instead, they read one Plot of the data-layer Package that holds them. A count Plot aggregates in SQL and always returns one row:
panes.<name>.plots.<plot>() and applies the same rule: each part checks its own read and draws its own Skeleton while that read runs. Never write if (meetings.status === 'running' || emails.status === 'running') return <Skeleton />, and never cover the whole Pane with one Skeleton: it holds every part until the slowest Plot answers. In this shape, one failed read replaces the whole Pane, so prefer a Plot Pane for each part when the parts do not depend on each other.
Show a company’s real logo with BrandLogo from the shared controls: <BrandLogo domain="github.com" name="GitHub" />. Use it for vendors, tools, AI models and Providers, such as GitHub, Linear, Claude or Cursor, where a logo helps a reader find a name: a list of tools, a Provider column, a legend. Never use it for a person or an internal team; show a person by name or with an Avatar, and a team by its name. Pass the company’s own domain, such as anthropic.com for Claude and openai.com for ChatGPT, and its name, which labels the logo and supplies the initials drawn when there is no logo. The frame has no network and the host fetches every logo, so never write a logo URL or load an image from the internet. A logo follows the light and dark theme. useBrandLogo(domain) returns the image source for a logo you draw yourself, such as an SVG image beside a chart axis.
A row that stands for a record in a Provider, such as a pull request, an issue, a ticket or a meeting, offers that record in its Provider: put ExternalLinkButton from parable/panes/placeholders in the row with the record’s address, <ExternalLinkButton href={row.html_url} label={Open pull request #${row.number} on GitHub} />. Return the address the Provider’s own data carries as a column of the row’s Plot, such as html_url for a GitHub pull request (its url is the API’s address, not the page), rather than building one from parts. The button shows while its row is hovered or holds keyboard focus, and always on touch screens; a row is a table row, a list item, or an element with role=“row” or data-row. Put it beside the row’s own button, never inside it. Only an https address draws it, so a record with none shows no button. A click opens the record in a new browser tab and leaves the row’s own click alone. To open a link from a control of your own, call openExternal(url) from the Pane’s module in its click handler: the Parable page opens only https links, only just after a click or key press in the frame, so never call it on mount or on a timer.
A link to another Parable of the Workspace, such as a card on Home, opens it in the same tab with parables.open(id) from the Pane’s module, from a click or key press: onClick={() => parables.open(row.parable_id)}. The id is the Parable’s workspace.parables.id, never its root_ref_id or slug. The host refuses a Parable the reader’s Workspace does not list or that is archived, with HANDLE_UNDECLARED, so catch the rejection and leave the card as it was. Never build a /ponder address and open it with openExternal or ExternalLinkButton: that opens a new tab. To show the other Parable’s preview on its card, read parables.preview(id) from the same module, without a press: it answers { src, kind, width, height }, so draw <img src={preview.src} alt="" />, or null when the Parable has no preview to draw, such as one whose only preview is an animated picture. Draw the card without an image then, and never put the Parable’s /api address in an img: the frame loads no image from the app.
A picker of the Parable’s own Versions reads useVersions() from the Pane’s module, which is the list newest first, each with id, label, publishedAt, newest and onScreen, and null on a surface that has no Versions, so draw nothing there. Open one with versions.open(id), or Newest with versions.open(null), from a click or key press. The whole Parable moves to that Version, so the picker must be in each Version a reader can open.
Contextual Ponder is a menu a reader opens on something on a Page, with two entries: “Ponder this…” and “Plot the path to this…”. The Page frame adds it to nothing, so place it yourself, case by case, on the things a reader asks about: visuals, totals, rates, and values that need an explanation. Do not place it on navigation, filters, settings, forms, or a plain list of links. Wrap the thing in ContextualPonder with asChild, so the target adds no box, and place one ContextualPonderSparkle inside it where the sparkle shows: <ContextualPonder asChild target={{ label: 'Meeting hours · 42.5 hrs', plot: 'hoursByWeek' }}><Card><CardHeader><CardTitle>Meeting hours<ContextualPonderSparkle /></CardTitle></CardHeader><CardContent>…</CardContent></Card></ContextualPonder>. Without children, ContextualPonderSparkle takes no room: put it directly after the last word of a title, a value or a label, where the line has empty space after the words, and the sparkle shows in that space. side="start" shows it before the words that follow the spot, for a value at the end of a row. With children, such as a card’s icon in CardAction, the sparkle takes their place in the same box while it shows. The sparkle shows while the pointer is over the target or the keyboard is in it, fades in and out, and never covers content, moves a box or shifts the Page, so never add padding, a gutter or an empty column for it. A right-click anywhere in the target opens the same menu at the pointer, and a long press opens it on a touch screen. To let the menu name a finer thing inside, such as a bar, a row or a number, wrap it in its own ContextualPonder, and give it a ContextualPonderSparkle only where it has room: <ContextualPonder asChild target={{ label: 'West region · $42.5k', plot: 'salesByRegion', row: { region: 'west' } }} entries={[…]}><rect … /></ContextualPonder>. label is what the reader sees there, in their words; plot is the handle of a Plot the Pane reads; row holds the values that identify the row; an entry has id, label, an optional Font Awesome icon and disabled (true or why in a few words). A Pane adds entries of its own to every target in it, and turns any entry off, with useContextualPonder from parable/panes/placeholders, passing a constant or a useMemo object: const MENU = { entries: [{ id: 'viewProof', label: 'View Proof', icon: 'file-certificate', onSelect: target => openProof(target) }], off: ['plotPath'] }; useContextualPonder(MENU);. Never build a second right-click menu. Write ContextualPonder, never PonderTarget, and never pass sparkle: it does nothing. The Improve panel is not in this menu: the Parable’s Providers button opens it. A Pane that asks Ponder itself uses usePonder(): ask(prompt, { model }) runs a Ponder turn for the reader with Ponder’s tools and the reader’s own permissions, in a new conversation with no memory of the last ask; followUp(prompt, { model }) continues the Pane’s last conversation, so use it only when the next question needs the last answer. answer is the Markdown of the current turn so far, to draw with ArtifactBody format=“markdown”, and status is idle, asking, approval, done, stopped or error. A reply that stops partway gets one more turn by itself, so do not ask again on error to finish it. Check available first: a reader without Ponder, View as and a Pane preview inside the conversation have none. Ask from an event handler, such as a button’s click, never on every render, because each ask is a turn in a conversation the reader sees in Ponder. model is an id from usePonderModels() or simple, standard or strong. PlottedPath draws a path from data the Pane already has.
Every Parable is built for every Provider that could feed it, however rare, and for every stream it reads, whichever ones a Workspace turned on. A Provider the Workspace has not connected, or a stream it has not turned on, reads as an empty table, so a visual whose Providers are partly connected still shows what it has, and a Pane whose Plot returns no rows shows its empty state (see the Plots Power). Say what a visual is missing with ImproveParable from parable/panes/placeholders. List the Providers that feed it, each with provider (its name in Plot SQL: zoom in providers.zoom.meetings), name, domain for its logo, and group, the kind of data it holds, such as Calendars or People, and pass the Workspace’s connections, which are Pane data like any other: a Plot providerConnections over workspace.providers returns one row per connected Provider, { provider: string; connection: string }, read only from connections whose setup finished (WHERE setup_finished: a setup started and never finished, with no credential saved, is not connected and Connect continues it, until its status is recomputed; it then reads config_invalid, so it is ‘attention’ and Fix opens it), with provider the connector_slug folded to its Plot SQL name (lower case, each run of other characters one underscore, trimmed, p_ before a leading digit) and connection ‘attention’ when connection_health is attention or disabled, else ‘connected’, grouped by provider with any connected row winning (connection_health already reads the status, and the status before a running sync, so never list statuses in a Plot); a Provider whose connection is healthy but none of whose connections has a row in workspace.stream_data (one row per stream whose data has reached the Pool, its provider_id joining workspace.providers.id) is ‘waiting’: connected, but no data has arrived yet, as for a push Provider such as Claude Telemetry, Slack Events or Parable Pulse until its senders deliver, or a pull Provider until its first sync lands. When the Parable reads a stream a Provider can leave off, such as Slack’s replies, a connection that does not have the stream on is also ‘attention’: join workspace.provider_connections on provider_id and check enabled for the stream’s platform_tap_name. Such a connection is not healthy, so its Provider reads ‘attention’ rather than ‘waiting’ while none of its connections has the stream on, since no data comes from a stream that is off. Its row then offers Fix, which opens the connection where the stream is turned on. Hand the component the hook that reads it, never the hook’s result: function useConnections() { const read = plots.providerConnections(); return read.status === 'ready' ? read.rows : null; } and <ImproveParable providers={[{ provider: 'zoom', name: 'Zoom', domain: 'zoom.us', group: 'Calls' }]} useConnections={useConnections}>{chart}</ImproveParable>. The component calls the hook inside its own error boundary, so a refused or failed read leaves the visual drawing without the badge, the ask and the row; called in the Pane’s body instead, a refused read replaces the whole Pane with “Could not read”. Return null while it reads, never empty rows, because no rows means nothing is connected. Once the Parable declares its Provider groups on its Home Page’s Perception (see the Perceptions Power), the components use those groups and the Workspace’s connections the Page frame reads, each visual showing the groups its Plots read, and a Pane’s own list only lends its Providers’ logos; a visual whose Plots read no Provider that a group names shows no badge, so put every Provider the Parable reads in a group; until then the Providers of one group form a group that one connected Provider meets. Pass emphasis, the groups the visual needs most, such as [‘People’] on adoption by team, and they lead (see the Populate Power). Wrapping a visual, it shows, always, while data is missing, a square amber Missing data badge in the top-right corner of the visual’s CardHeader, at the same place in every card. Only the title’s row shares that corner: a long title wraps before the badge, and a CardDescription keeps the card’s full width under the title (a title outside a CardHeader wears the badge after the title). The badge says on hover, focus or press what sources the visual leaves out, without guessing whether it has rows. When the connections are known and no group that feeds the visual has a Provider whose connection is ‘connected’ or ‘attention’, the visual has no data and cannot show anything true. Each of its Providers is then missing or waiting for its first data. ImproveParable then hides the children of the visual’s CardContent, keeps them mounted, and shows an ask in their place: a heading, the sentence you pass as reason, such as reason="This counts deploys.", which says what the number measures, and the actions. While an unmet group still offers a Provider, the heading is “Needs deploys data” from the unmet groups’ names (“Needs deploys and incidents data” for two), with Connect and “+N”. Otherwise every connected Provider waits for its first data: the heading is “Waiting for first data from Datadog”, with no action. The card’s title and the badge stay in view. While a Provider is still offered, the badge’s hint says what the visual leaves out; while one waits for its first data, it says the same heading. A Provider that needs attention keeps its data in the Pool, so it may hold data and the visual keeps its content: when no Provider that feeds the visual is connected, the badge’s hint and the row say “Datadog needs attention”, and the row holds the Improve panel’s Fix, labeled “Fix Datadog connection” (with an unmet group too, the row says what is missing first and holds Connect). When some group that feeds the visual has a connected Provider, one row at the bottom of its CardContent says what is missing, such as “Missing incidents data” or “Missing incidents and people data”, and holds the actions instead. The actions are Connect for the first Provider offered, which opens its setup at once, or Request … connector for a Provider this environment’s catalog has no connector for, and, with more Providers offered, “+N”, which opens the one Improve panel. A card shows one Connect: the ask or the row, never both. When the visual’s value needs every group that feeds it, such as a change failure rate that divides incidents by deploys, pass needsAll: while any of those groups is unmet, or is met only by Providers that wait for their first data, the visual shows the ask instead of its content, so it never prints a partial number such as 0 % next to the row. Nothing goes on or over the card’s border: the ask goes first in the CardContent and the row last; without CardContent, each goes last in the Card, after its header; without a Card, each goes after the visual. A visual with no CardContent has nothing to hide, so its ask shows under the title. When the connected data covers too little of the work, pass coverage, such as coverage={{ text: '2 of 16 active repositories have deploys' }}. With no unmet group, the visual then wears the same badge with that text as its hint, and the row with the whole text and Add a source, which opens the Improve panel. In a narrow card, the actions move under the text. With an unmet group, the text follows the missing sources in the badge’s hint and in the same row, “Missing incidents data. 2 of 16 active repositories have deploys”, with one Connect and “+N”; no second badge or row shows. Give the visual a title, such as CardTitle, and put its body in CardContent. A visual with no title wears the badge in the ask or the row. The Parable’s Providers button, beside Pieces and Problems, opens the same panel for the whole Parable, so a Page needs no copy of it. The panel is titled “Populate this Parable” until the Parable can populate and “Improve this Parable” after that; its groups are rows of a card tree, Required first, each with its rule; open, a group lists its missing Providers by logo and name with Connect, then folds its connected ones under Connected and, in a group that has its most, the ones the reader cannot add under Other. With no children it is the “Improve this Parable” band. On a Page with several visuals, wrap each visual; otherwise one band goes at the top of the Page’s first Pane that always draws, never in a Pane of its own, because a Page imports only Panes and a Pane of its own would draw nothing once every Provider is connected. PopulateParable takes the same providers and useConnections, wraps a Pane’s content and draws the panel in its place while a Required to Populate group has fewer connected than its rule asks or no Provider has data or needs attention, headed “Waiting for first data from” and the Provider’s name while a connected Provider waits for its first data, so the Pane holding a Parable’s Home content wraps it in PopulateParable with a sentence on what the Parable shows once it has data. Connect opens the Provider’s setup in the app with a way back to the Page. A Provider waiting for its first data offers neither Connect nor Fix. ImproveParable draws nothing of its own when no unmet group has a Provider left to offer and some group has a connected Provider (with needsAll, when every group also has a Provider that is connected or needs attention), and PopulateParable when each Required to Populate group has as many connected as its rule asks and a Provider has data or needs attention; a group with more connected than its rule allows, such as two in an Exactly 1 group, never hides the Page or adds a badge, and neither draws anything while the connections are null or when their read fails. A Pane never draws its own missing-data notice, and never prints a zero, a rating such as LOW, or a change such as a 100% drop in place of missing data: when a visual has no data to show, ImproveParable says so.
Show every time in the reader’s own time zone and clock, never in UTC or on a 24-hour clock their locale does not use. Import formatTime and formatDateTime from parable/panes/placeholders; they read the reader’s browser the same way the app does. formatTime(at) reads “12:31pm ET” today and “Oct 6, 12:31pm ET” on another day, and a reader whose locale uses a 24-hour clock sees “17:31 BST”. formatDateTime(at) always shows the date, and formatDateTime(at, { long: true }) spells the whole moment out for a tooltip. Show a relative age with formatAge(at), such as “3 hrs ago”, and put the exact time on its hover with a title. The helpers read the current time themselves, so a Pane never calls Date.now() while it renders. readerClock() returns the reader’s timeZone and locale. A Plot returns instants and the Pane formats them; Plot SQL cannot take the reader’s time zone as a parameter, because AT TIME ZONE accepts only a quoted zone.
Write no extraneous copy. A label names its control or value in the fewest words, and a Pane adds no sentence that explains a control, says where a value came from, tells the reader they can change something, or repeats what a control already shows. When a control seems to need such a sentence, fix the control or its label. Some sentences are not extraneous, because the reader needs them to act. A control the reader cannot use stays on screen, disabled, with one short sentence on why: when policies.seatCapabilities allows it, what turns it on (“Switch to Publishing to change this.”), otherwise who can. The same goes for the reading, empty and cut-off states the Plots Power describes, an action’s error message, and the sentence PopulateParable carries.
Every Pane must render alone. A Pane opened by itself that renders nothing shows its name and “Nothing to show here.”, which is never a reason to leave a Pane without its own empty state. Selected by itself in Pieces, with no Page or parent Pane around it, it draws with sensible defaults instead of failing. When Panes share state, it lives in the code of the data-layer Package that holds them, and its hook returns the state the Page or parent provides and, when nothing provides it, the module’s own state with defaults, shared by every Pane in the frame. A Pane that shows nothing until something is chosen shows its first sensible choice or a clear empty state. Check a Pane counts a Pane that waits for a value on its Page (needs-input) as a problem. Check a Pane also finds a Pane that a Page shows whose code draws nothing on every path (draws-nothing), and counts it as a problem. It does not draw the Pane, so code that fails or draws nothing only for some rows shows only on the Page itself.
A Pane shows a file from the Parable’s Artifacts, such as a logo, a photo or a video, with ArtifactImage or ArtifactVideo from parable/panes/placeholders. Name the file by the id that list_parable_artifacts gives: <ArtifactImage artifact="<id>" alt="Acme logo" fallback={<span>Acme</span>} />. Only a Pane can show a file, because a Page may import only the Panes it declares and the runtime layout modules. Never copy a file’s markup or bytes into a Pane’s source: the copy does not follow a rename, a replace or a delete (see the Artifacts Power).
Pane code reads and adds the Parable’s files with files from the Pane’s module. files.list() lists every live file of the Parable, with its id, name, kind, format, size and check state, and a data file’s table. files.list({ from: 'workspace' }) lists the Workspace’s checked files, without the files that hold a Provider’s data: a file uploaded for a connection, and a file a tap reads, such as a published Artifact’s file. files.read(id) returns one file as a Blob, up to 25 MB. Use it for small files, such as a JSON settings file. Read one or two files at a time: a third call while two are in flight is refused with RATE_LIMITED. Read a data file’s rows through a Plot over its table (see the Artifacts Power). files.upload({ kinds }) opens the host’s file picker and adds the chosen file to the Parable. Call it only from a click or a key press, never on mount. It resolves with the file once its check ends, or with null when the reader closes the picker. Only Primary or Publishing, in the Publishing mode, adds a file. Show the refusal’s message when the call rejects. files.list({ from: 'workspace' }) and files.read of a Workspace file work only when the Pane’s Perception declares readonly workspaceFiles: true (for a Page’s own code, the Page’s Perception). Without it the call is refused with PA-AU-121. Only a person who can view the Workspace’s files may save that declaration. A save by anyone else is refused with PA-AU-120. The Workspace’s files also reach a Page only when everyone who last saved its code may view the Workspace’s files (PA-AU-070). Through a Pane that declares it, every reader of the Parable can list and read every other checked Workspace file. Declare it only when the person asks for the Workspace’s files.
When a Pane does not compile, has Warnings & Errors, or does not render, find out exactly why before changing it. Publishing waits until no Piece has Warnings & Errors, so fix them as you go. Read a Piece’s problems returns the Pane’s code, Palette, Perception and Policies, with every current warning and error: compile errors, TypeScript type errors, Code check findings (React rules, classes nothing styles, and the Parable rules such as values-api, data-in-code and module-at-load), Plot SQL validation, and the Parable rules on the Perception and the SQL, each with its line, column, the text of its line, and for a Parable rule a link to the page that teaches its fix. Follow the finding’s own message: it names what to write instead. A class is known when the shared controls’ stylesheet or any of the Parable’s Palettes styles it; one nothing styles is a warning, so define it in the Palette or remove it. A Tailwind class counts only when that stylesheet already holds it, because the frame does not compile the classes a Pane writes. Fix one problem at a time with Edit part of a Piece’s source: replace the smallest passage that occurs exactly once and fixes the problem, and pass the revision and the version that the read returned. Its answer carries the problems after the save; repeat until none is an error, then preview the Pane. A refused save names the import or handle at fault and where it is. Each Pane compiles on its own, so a broken Pane shows its error in its place while the rest of the Page still renders.
A good Pane renders a permitted value, shows a clear state when there is no saved row or access is denied, shows that a Plot is still reading instead of an empty result (the host shows a failed read), accepts valid values and refuses invalid ones, survives save and reload, and refuses a stale write without losing the draft. It behaves correctly when the reader, the Workspace, or the selected Report changes. The same Pane placed on two Pages shares its saved rows instead of duplicating them. Check these in the running Parable; a Pane preview inside the conversation uses captured data and cannot run live SQL or save rows. The platform does not refuse every Pane that shows several things, or every Page that holds words or drawings of its own, so never claim stricter enforcement than the product provides.
Sketch with sample rows
A sketch shows the person the layout of a new Page before any Plot exists, so they can agree on what it shows. Ponder sketches only when its sketch-first rule says to. Each sample Pane is a layout Pane: its type is null and it owns no Plot. Its code holds 5 to 8 typed-in rows in a constant, with made-up names, never a real person, customer or company, and it draws them with the shared controls. Wrap each visual in SampleData from parable/panes/placeholders: it puts an amber “Sample data” badge after the visual’s title, so a reader never takes a sample number for a real one. Keep each sample Pane short, at most 20 lines: a title, the rows, and inline styles, with no Palette CSS. A sketch is one save of the Page and at most 6 Panes, under 8,000 characters, so it draws in seconds.Controls and charts
Build each control from parable/panes/placeholders. Do not write a control in plain HTML when the design system has one.- A choice of more than one value is
Comboboxwithmultiple. Show the chosen values inComboboxChips, with aComboboxChipfor each value and aComboboxChipsInputto type in. - A choice of one value is
Select, orNativeSelectfor a short fixed list. - A date or a date range is
DateSelector. - A small set of options that all stay visible is
ToggleGroupwith aToggleGroupItemfor each option. - A menu of actions is
DropdownMenu. - Conditions that a person builds, such as “status is Open and owner is Ana”, are
Filters. Filters is a heavy control, so a Page loads it only when a Pane imports it.
SimpleChart draws one titled card of rows as a stat row, bars, a line, a table, a funnel or a heatmap, such as <SimpleChart kind="funnel" title="Issues by stage" rows={rows} x="stage" y="issues" />. A funnel draws one stage per row in row order, with each stage’s share of the total. A heatmap also takes value, the number column: x is the column and y the row. A heatmap puts number columns or rows, such as hours, in number order, and keeps text ones in the SQL’s order, so set the order with ORDER BY and return plain labels, never a sort key such as “1 Mon”. For weekday rows, return CASE extract(isodow FROM created_at) WHEN 1 THEN 'Mon' WHEN 2 THEN 'Tue' WHEN 3 THEN 'Wed' WHEN 4 THEN 'Thu' WHEN 5 THEN 'Fri' WHEN 6 THEN 'Sat' WHEN 7 THEN 'Sun' END AS weekday and ORDER BY MIN(extract(isodow FROM created_at)). The Query Layer’s to_char takes chrono formats, such as '%a', and returns a PostgreSQL pattern such as 'Dy' as literal text. While its Plot reads, pass loading={read.status === 'running' && read.rows.length === 0}: the card keeps its title and draws the chart’s shape until the rows arrive. Draw any other chart with D3 (import * as d3 from 'd3') or with SVG elements, as the example below does. Color the marks in the Palette with the chart tokens of the Palettes Power, such as var(--chart-categorical-1). When the code needs the colors as values, such as for a D3 scale, import CHART_COLORS from parable/panes/placeholders. It holds the categorical chart colors in order, as var() references, so the chart repaints when the theme changes.
A control that filters a Plot sends its value as one Plot parameter. Each parameter is one string, finite number, boolean or null. Send a multi-select’s values as one delimited string, such as "open,blocked", and split it in the SQL, or filter the rows in a child Plot (see the Plots Power).
Example: a chart Pane
This example is a small, complete chart: a Plot Pane, its Plot, its Palette, and the Home Page that places it. It counts the issues completed in each of the last six months, from every Provider that holds issues. Build a new chart in the same shape. The Pages Power holds the Home Page half (see its Example section). The example compiles against the Pane types. In it,example is the Parable’s handle: write the real one.
The Perception declares the kind of the rows and the one Plot. A Pane that owns a Plot draws its Plot’s rows with no value from its parent, so a Page hands it nothing, and it never shows “Choose a Preference or provide an input.”:
range with unnest makes the months, because a Plot that reads Provider tables cannot call the generate_series table function:
pull_request__url, and only the issues closed as completed. Jira keeps the resolution time in the fields struct column.
The Pane’s code reads the Plot from its props, draws PlotLoading in the shape of its columns while the first read runs, then the empty state, then the bars. Every month has a row, so the empty state is the one where every month is 0. The title states what the chart shows, as the Plots Power asks, and the code builds it from the rows. Above the card, the Pane draws the one Improve this Parable band of its Page (principle 5). The band shows only while the Workspace lacks a Provider the Plot reads, so it sits in a Pane that always draws, never in a Pane of its own, which would draw nothing once every Provider is connected:
Add a Pane with its Plot and its Palette
One edit_pieces call adds a Pane, its Plot and its Palette. The call below adds the chart Pane of the example to a Package the Parable already has. To show the Pane, declare it in a Page’s Perception and place it in the Page’s code in the same call (see the Pages Power).- Call read_parable_contents. Take the key of the Package, and the orders of the Packages and Panes in it.
- Call check_parable_state. It gives refRevision for expectedRefVersion, and aggregateRevision for expectedAggregateRevision. Only Personal mode, where proposalId is null, sends expectedAggregateRevision. In Publishing mode, send the proposalId of the open Changes instead.
- Get six new keys: the Pane, the Plot, the Palette, and one for each of their three code rows. In Ponder, call prepareNewPieceIds. Outside Ponder, make one new UUID for each key.
-
Send the call. Replace each value in angle brackets and the two revision numbers. Put the Perception, the code, the SQL and the CSS of the example in the four strings. Keep every other field as it is:
- A copied manifest. The server generates a Pane’s perceptionManifest from its perceptionSource. Leave perceptionManifest out. When you copy a Pane from read_parable_contents, remove its perceptionManifest and give each row a new key.
- A Plot with no owner. A Plot names its Pane with ownerKind “pane” and ownerKey, the Pane’s key. A Plot has no paneKey field.
- CSS on the Pane. CSS belongs to the Pane’s Palette. Send a Palette with ownerKind “pane” and ownerKey, the Pane’s key, and save the CSS with the Palette’s key as programKey. A save that puts CSS on the Pane’s own key is refused. A Pane saved without a Palette gets an empty one. Save its CSS later under the key of that Palette, which read_parable_contents gives.
- Code under another name. An implementation’s text goes in code. An implementation has no source or text field. A save refuses an implementation that has a key it does not declare or has no code, and the refusal names the field to correct.
- A taken order. The Packages and Panes in one Package share one order. Give the Pane an order that none of them uses. An order you leave out is 0. The refusal names a free order.