Build panels
Build panels
A community panel is a folder of web files that Deska runs in a sandbox on your desk. What one is, how it reaches Deska, the rules it lives under, and where each part is documented.
What a panel is
A community panel is a small web page that lives on a Deska desk next to terminals, editors and tasks. You write it as a folder: a panel.json that says what the panel is and what it may do, an HTML page, and whatever scripts, styles, images and fonts that page loads. There is no build step, no server and no framework to adopt. Deska serves the folder to the panel itself.
Deska runs the page in a sandboxed frame with an origin of its own, so it cannot read your files, your other panels, what your agents do or your account. The page reaches Deska only through window.deska, the SDK Deska serves at /__deska/sdk.js inside every panel. Through it a panel keeps its own data, follows the theme, knows when it is on screen, and, when the person allows it, sends notices, opens links, copies text, signs the person in to its own server with Sign in with Deska, or offers actions to the agent of a task the person connects.
A panel shows up in two places:
- On the desk, as a panel on the canvas, in a dock or in a window of its own. Every package has this.
- In Extras, the popover on the canvas that holds Notes, Focus and Music, as a row with a state line and a round control. Optional; see Extras.
The smallest panel
Two files make a panel that loads, follows the theme and greets you by its name:
{
"schema": 1,
"id": "hello-desk",
"name": "Hello Desk",
"version": "0.1.0",
"description": "Says hello in Deska's colors.",
"author": "Your name",
"sdk": 1,
"contributes": { "panel": { "entry": "index.html" } }
}<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="/__deska/sdk.js"></script>
<style>
body { margin: 0; padding: 16px; background: var(--deska-bg); color: var(--deska-text); font: 13px var(--deska-font-ui); }
</style>
</head>
<body>
<p id="hello">Waiting for Deska</p>
<script type="module">
const init = await deska.ready()
document.getElementById('hello').textContent = `Hello from ${init.panel.name}`
</script>
</body>
</html>Put them in a folder, open Build a panel (in the Marketplace, Yours › My panels › Create a panel), choose Load a folder and pick it. The panel lands on your desk and reloads each time you save. Build your first panel takes the same idea further in about fifteen minutes.
From a folder to people’s desks
- Build. Write the folder, preview it next to your editor with the examples repository’s preview tool, and load it in Deska with Load a folder. Deska checks it with the same rules it will meet when submitted. See Testing and debugging.
- Submit. Add a
screenshots/folder with 1 to 5 images of the panel, then press Submit… on the folder in Loaded folders. Any account signed in to Deska can submit, and deska.dev checks the package again. See Submitting and review. - Review. Deska reviews every version before people can install it. Once approved, it is published. If Deska declines it, its note says why, in Build a panel and on your account page.
- Install. People find it in Discover and on deska.dev/panels, read what it may do and which sites it reaches, and install it. Their installs follow their account to every computer they sign in to.
- Update. Keep the
id, raiseversion, and press Update… on the panel in Your panels: choose the folder, any name, then review and submit. Once Deska approves it, installs offer the update, and ask again first if the new version wants a permission or a site they had not allowed. A folder with another id would be a new panel. See Update a panel you published.
The rules in short
Each rule below has a reason and a way around it on The sandbox; the exact limits are on Error codes and limits.
| Rule | What to do instead |
|---|---|
| Only the sites in network, over https | Declare every host the panel fetches from or loads images, fonts and media from. The API must allow any origin (CORS). |
| No localStorage, indexedDB or cookies | Keep data in deska.storage: 256 KB per package, shared by every copy on the computer. Keep images and other files in deska.files: 32 MB a file, 256 MB per package. |
| No downloads | Save a file with deska.files.save: the person picks where. |
| No frames of its own, workers or remote scripts | Ship your libraries inside the package. Play media from declared hosts with <audio> and <video>, or show another site’s page through Deska with deska.embed. |
| Forms never navigate, no popups or alert() | Handle submit with preventDefault(), open links with deska.openUrl. |
| Focus moves only when the person acts | Call openUrl, clipboard.write and files.save straight from a click; ask for attention with deska.notify. |
| No secrets | There is no place to hide a key in a panel. Use public APIs, or your own server with Sign in with Deska. |
| No sign-in or password forms | Sign people in with Sign in with Deska; review declines a panel that draws its own. |
| It can reload at any time | Keep what matters in storage and rebuild from what deska.ready() answers. |
Say which Deska panels yours goes with
Add goesWith to panel.json: the Deska panels your panel is used alongside, by id.
"goesWith": ["terminal", "editor"]- Deska uses it for the For you section of Panels: if a person pins or opens Terminal, your panel may show with Goes with Terminal. The match happens on their computer; nothing about them is sent anywhere.
- A panel that does not say what it goes with is never suggested there. It is optional.
- Up to 6 ids, lowercase letters, digits and dashes, as the built-in panels are named in the panel picker. An id Deska does not know never matches. An empty list says none.
- If Deska already declared this for your published panel, the list in your newest approved version replaces it.
Where everything is
Start from an example
deska-panels-examples on GitHub holds twenty-two MIT licensed panels, a starter folder and the preview tool. Read one, copy it, or load any folder under panels/ with Load a folder. Begin with Team Clocks, then keep SDK Playground open while you build: it runs every call and shows every error code. The full list, with screenshots, is on Example panels.
People who only want to install panels will find what they need on Community panels.