modscode JA

modscode / Gallery / apercu

apercu

What Claude is building (website, mobile app, desktop client, Unity game…), live in a panel of the client (desktop, mobile in Remote Control, terminal): Claude hooks up the project and the network bridge itself, and drives the same target …

Code you can checkTerminal + desktopPaneToastBoxButtonText

What it does

  • Draws a pane, toasts
  • Adds /preview
  • Watches mcp__apercu__apercu calls
  • Hooks prompt.submit, session.start
  • Calls the network

Good points

  • Written in TypeScript
  • Has a desktop-specific branch
  • Handles errors
  • Writes no files

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like apercu by tibzejoker (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/tibzejoker-apercu/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Aperçu" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Button, Text } = $.ui.resolve(e)
    const nom = '…'
    const url = '…'
    const pilote = '…'
    const vw = '…'
    const vh = '…'
    const last = '…'
    const map = '…'
    const gridRows = '…'
    const value = '…'
    const gridRows2 = '…'
    const kind = '…'
    const text = '…'
    const kind2 = '…'
    const text2 = '…'
    const kind3 = '…'
    const text3 = '…'
    const n = '…'
    const label = '…'
    return (
      <Box flexDirection="column">
        <Box flexWrap="wrap">
          <Button label={`${nom}`} variant="primary" />
          <Button label={`${nom}`} variant="primary" />
          <Button label={`${nom}`} variant="primary" />
        </Box>
        <Text>
          <Text bold>
            {url}
          </Text>
          <Text dimColor>
            {" "}
            {pilote}
            {" "}
            {vw}
            ×
            {vh}
          </Text>
        </Text>
        <Text color="magenta">
          {last}
        </Text>
        <Text dimColor>
          ⏳ capture…
        </Text>
        <Text dimColor wrap="wrap">
          {map}
        </Text>
        <Text dimColor>
          {"grille "}
          8
          ×
          {gridRows}
          {" : A1 en haut à gauche, "}
          {value}
          {gridRows2}
          {" en bas à droite"}
        </Text>
        <Text color="red" wrap="truncate-end">
          {"! "}
          {kind}
          {" : "}
          {text}
        </Text>
        <Text color="red" wrap="truncate-end">
          {"! "}
          {kind2}
          {" : "}
          {text2}
        </Text>
        <Text color="red" wrap="truncate-end">
          {"! "}
          {kind3}
          {" : "}
          {text3}
        </Text>
        <Box flexWrap="wrap">
          <Button label="◀" hotkey="b" />
          <Button label="⌂" hotkey="o" />
          <Button label="↻" hotkey="r" />
          <Button label="⬆" hotkey="u" />
          <Button label="⬇" hotkey="d" />
          <Button label="⏎" hotkey="e" />
          <Button label="📱 mobile" hotkey="m" />
          <Button label="repères ✓" hotkey="h" />
          <Button label="grille ✓" hotkey="g" />
          <Button label="📎 jointe" hotkey="j" variant="primary" />
        </Box>
        <Box flexWrap="wrap">
          <Button label={`${n} ${label}`} />
          <Button label={`${n} ${label}`} />
          <Button label={`${n} ${label}`} />
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const error = '…'
    await $.ui.toast(`Aperçu : ${error}`)
    await $.ui.toast(`Capture jointe à ton prochain message`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

apercu/hooks/register.tsx lines 401–474 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    surface = e.surface
    const { Box, Text, Button } = $.ui.resolve(e)
    rasterCols = Math.max(20, Math.min(160, e.props.bodyColumns - 1))

    const tabs = cibles.length > 1
      ? <Box flexWrap="wrap">{cibles.map(c => (
          <Button key={`c-${c.nom}`} label={`${c.status === 'prête' ? '' : c.status === 'en panne' ? '✗ ' : '⏳ '}${c.nom}`}
            variant={c.nom === active ? 'primary' : undefined} onPress={() => choose($, c.nom)} />
        ))}</Box>
      : null

    if (!frame) {
      const down = cibles.find(c => c.nom === active && c.status !== 'prête')
      return (
        <Box flexDirection="column">
          {tabs}
          <Text dimColor>{failure ? `✗ ${failure}` : starting ? '⏳ Démarrage du hub…' : down ? `${down.status === 'en panne' ? '✗' : '⏳'} ${down.nom} : ${down.error || down.status}` : cibles.length ? 'En attente d\'une image…' : 'Aucune cible. Demande à Claude de brancher l\'aperçu sur ce projet.'}</Text>
          {failure && <Button key="retry" label="Réessayer" variant="primary" onPress={() => ensureDaemon($).then(() => tick($, true))} />}
        </Box>
      )
    }
    const f = frame
    const last = f.last && f.last.by === 'claude' ? `🤖 Claude : ${f.last.text}` : f.last ? `👆 ${f.last.text}` : ''
    const errors = f.console.filter(c => c.kind !== 'warning' && c.kind !== 'info').slice(-3)
    const can = (x: string) => !f.actions || f.actions.includes(x)

    let view = <Text dimColor>⏳ capture…</Text>
    if (e.surface === 'terminal' && cells) {
      const { Raster } = $.ui.resolve(e)
      view = <Raster key="view" columns={cells.columns} rows={cells.rows} cells={cells.cells} />
    } else if (e.surface !== 'terminal' && jpeg) {
      const { Svg } = $.ui.resolve(e)
      view = <Svg source={toSvg(f)} alt={`Aperçu de ${f.url}`} isInteractive />
    }

    const controls = [
      can('back') && <Button key="back" label="◀" hotkey="b" onPress={() => act($, { type: 'back' })} />,
      can('home') && <Button key="home" label="⌂" hotkey="o" onPress={() => act($, { type: 'home' })} />,
      can('reload') && <Button key="reload" label="↻" hotkey="r" onPress={() => act($, { type: 'reload' })} />,
      <Button key="up" label="⬆" hotkey="u" onPress={() => act($, { type: 'scroll', dy: -500 })} />,
      <Button key="down" label="⬇" hotkey="d" onPress={() => act($, { type: 'scroll', dy: 500 })} />,
      <Button key="enter" label="⏎" hotkey="e" onPress={() => act($, { type: 'key', key: 'Enter' })} />,
      can('device') && f.pilote === 'web' && f.device !== 'cdp' && <Button key="device" label={f.device === 'desktop' ? '📱 mobile' : '🖥 desktop'} hotkey="m" onPress={() => act($, { type: 'device', name: f.device === 'desktop' ? 'mobile' : 'desktop' })} />,
      f.hints.length > 0 && <Button key="hints" label={showHints ? 'repères ✓' : 'repères'} hotkey="h" onPress={() => { showHints = !showHints; $.ui.invalidate('ui.render') }} />,
      f.hints.length > 0 && <Button key="grid" label={showGrid ? 'grille ✓' : 'grille'} hotkey="g" onPress={() => { showGrid = !showGrid; $.ui.invalidate('ui.render') }} />,
      <Button key="attach" label={attachPath ? '📎 jointe' : '📎 joindre'} hotkey="j" variant="primary" onPress={() => attach($)} />,
    ].filter(Boolean)
    const gridOn = showGrid || f.hints.length === 0

    return (
      <Box flexDirection="column">
        {tabs}
        <Text><Text bold>{f.url}</Text><Text dimColor>  {f.pilote} {f.vw}×{f.vh}</Text></Text>
        {last ? <Text color={f.last?.by === 'claude' ? 'magenta' : 'gray'}>{last}</Text> : null}
        {view}
        {e.surface === 'terminal' && f.hints.length > 0 && (
          <Text dimColor wrap="wrap">{f.hints.map(h => `${h.n} ${h.label}`).join(' · ')}</Text>
        )}
        {e.surface === 'terminal' && gridOn && (
          <Text dimColor>grille {GRID_COLS}×{gridRows(f)} : A1 en haut à gauche, {String.fromCharCode(64 + GRID_COLS)}{gridRows(f)} en bas à droite</Text>
        )}
        {errors.map((c, i) => <Text key={`err-${i}`} color="red" wrap="truncate-end">! {c.kind} : {c.text}</Text>)}
        <Box flexWrap="wrap">{controls}</Box>
        {e.surface === 'mobile'
          ? <Box flexWrap="wrap">{f.hints.slice(0, 16).map(h => <Button key={`h-${h.n}`} label={`${h.n} ${h.label.slice(0, 16)}`} onPress={() => act($, { type: 'hint', n: h.n })} />)}</Box>
          : (() => {
              const { Input } = $.ui.resolve(e)
              const help = f.hints.length ? 'n° pour toucher · n° + texte pour remplir' : 'case (C4) pour toucher'
              return <Input key="cmd" placeholder={`${help} · ${f.pilote === 'web' ? 'une URL · ' : ''}du texte à taper`} submitLabel="OK" onSubmit={v => void submit($, v)} />
            })()}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 tibzejoker

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What its code calls

networkruns programsreads filestool calls

The design, read from code

Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.

What its code shows

Read from the source at commit 81481ec54fc0 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.apercu/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.1 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.apercu/hooks/register.tsx:69 fetch(api('/state')); apercu/hooks/register.tsx:107 fetch(api(path)); apercu/hooks/register.tsx:129 fetch(api('/act')); apercu/hooks/register.tsx:149 fetch(api(`/frame?since=${since}&${q}`)); apercu/hooks/register.tsx:365 fetch(api('/cibles'))
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.apercu/hooks/register.tsx:82 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads files and reaches the network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add tibzejoker/claude-mods
/plugin install apercu@claude-mods

This installs the marketplace's latest commit, which may not be the one read here (81481ec54fc0). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "tibzejoker-apercu" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs