modscode JA

modscode / Gallery / lavish-pages

lavish-pages

Shows the Lavish pages this session opened, whether each is streaming, idle, closed or dead, with a one-line description of each and open and end buttons

Code you can checkTerminal + desktopPaneBandToastBoxButtonText

What it does

  • Draws a band above the prompt, a pane, toasts
  • Adds /lavish-pages
  • Watches Write, Edit, Bash calls
  • Hooks session.start
  • Keeps its own state between turns

Good points

  • Written in TypeScript
  • 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 lavish-pages by FoCDoT (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/focdot-lavish-pages/
// 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 band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const summary = '…'
    const label = '…'
    const name = '…'
    const inline = '…'
    const metaText = '…'
    const label2 = '…'
    const metaText2 = '…'
    const label3 = '…'
    const metaText3 = '…'
    const more = '…'
    const length = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row">
          <Text bold>
            {"lavish "}
          </Text>
          <Text dimColor wrap="truncate-end">
            {summary}
            {"  "}
          </Text>
          <Button label="collapse" plain dimColor />
          <Text>
            {" "}
          </Text>
          <Button label="hide" plain dimColor />
        </Box>
        <Box flexDirection="row">
          <Text>
            {label}
          </Text>
          <Button label={`${name}`} plain />
          <Text dimColor>
            {` · ${inline}`}
          </Text>
          <Text dimColor>
            {metaText}
          </Text>
          <Text>
            {" "}
          </Text>
          <Button label="open" />
          <Button label="end" />
          <Button label="reopen" />
          <Button label="forget" dimColor />
        </Box>
        <Box flexDirection="row">
          <Text>
            {label2}
          </Text>
          <Button label={`${name}`} plain />
          <Text dimColor>
            {` · ${inline}`}
          </Text>
          <Text dimColor>
            {metaText2}
          </Text>
          <Text>
            {" "}
          </Text>
          <Button label="open" />
          <Button label="end" />
          <Button label="reopen" />
          <Button label="forget" dimColor />
        </Box>
        <Box flexDirection="row">
          <Text>
            {label3}
          </Text>
          <Button label={`${name}`} plain />
          <Text dimColor>
            {` · ${inline}`}
          </Text>
          <Text dimColor>
            {metaText3}
          </Text>
          <Text>
            {" "}
          </Text>
          <Button label="open" />
          <Button label="end" />
          <Button label="reopen" />
          <Button label="forget" dimColor />
        </Box>
        <Text dimColor>
          {`  +${more} more · /lavish-pages lists them all`}
        </Text>
        <Button label={`hide ${length} closed`} plain dimColor />
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Lavish pages" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const summary = '…'
    const label = '…'
    const name = '…'
    const inline = '…'
    const metaText = '…'
    const below = '…'
    const label2 = '…'
    const metaText2 = '…'
    const label3 = '…'
    const metaText3 = '…'
    return (
      <Box flexDirection="column">
        <Text dimColor wrap="truncate-end">
          {summary}
        </Text>
        <Text dimColor>
          No Lavish pages from this session.
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row">
            <Text>
              {label}
            </Text>
            <Button label={`${name}`} plain />
            <Text dimColor>
              {` · ${inline}`}
            </Text>
            <Text dimColor>
              {metaText}
            </Text>
            <Text>
              {" "}
            </Text>
            <Button label="open" />
            <Button label="end" />
            <Button label="reopen" />
            <Button label="forget" dimColor />
          </Box>
          <Text dimColor wrap="truncate-end">
            {`    ${below}`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box flexDirection="row">
            <Text>
              {label2}
            </Text>
            <Button label={`${name}`} plain />
            <Text dimColor>
              {` · ${inline}`}
            </Text>
            <Text dimColor>
              {metaText2}
            </Text>
            <Text>
              {" "}
            </Text>
            <Button label="open" />
            <Button label="end" />
            <Button label="reopen" />
            <Button label="forget" dimColor />
          </Box>
          <Text dimColor wrap="truncate-end">
            {`    ${below}`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box flexDirection="row">
            <Text>
              {label3}
            </Text>
            <Button label={`${name}`} plain />
            <Text dimColor>
              {` · ${inline}`}
            </Text>
            <Text dimColor>
              {metaText3}
            </Text>
            <Text>
              {" "}
            </Text>
            <Button label="open" />
            <Button label="end" />
            <Button label="reopen" />
            <Button label="forget" dimColor />
          </Box>
          <Text dimColor wrap="truncate-end">
            {`    ${below}`}
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const stderr = '…'
    await $.ui.toast(`lavish: ${stderr}`)
    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.

lavish-pages/hooks/register.tsx lines 462–516 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const list = ordered(await read($, pages))
    if (e.props.hasSurvey || list.length === 0 || (await read($, isHidden))) return next(e)

    const { Box, Text, Button } = $.ui.resolve(e)
    const columns = e.props.bodyColumns
    const expandedSetting = await read($, isExpanded)
    const expanded = expandedSetting ?? list.length <= AUTO_EXPAND_MAX
    const withClosed = await read($, showClosed)

    const header = (
      <Box flexDirection="row">
        <Text bold>lavish </Text>
        <Text dimColor wrap="truncate-end">
          {summary(list)}
          {'  '}
        </Text>
        <Button
          key="toggle"
          label={expanded ? 'collapse' : 'expand'}
          plain
          dimColor
          onPress={() => update($, isExpanded, () => !expanded)}
        />
        <Text> </Text>
        <Button key="hide" label="hide" plain dimColor onPress={() => update($, isHidden, () => true)} />
      </Box>
    )
    if (!expanded) return header

    const active = list.filter(p => !isDone(p))
    const done = list.filter(isDone)
    const candidates = withClosed ? [...active, ...done] : active
    // Header, the closed toggle and the "+N more" line take three rows at most.
    const room = Math.max(1, Math.min(BAND_ROWS_MAX, e.props.maxRows - 3))
    const shown = candidates.slice(0, room)
    const more = candidates.length - shown.length

    return (
      <Box flexDirection="column">
        {header}
        {shown.map(page => row($, e, page, columns))}
        {more > 0 && <Text dimColor>{`  +${more} more · /lavish-pages lists them all`}</Text>}
        {done.length > 0 && (
          <Button
            key="closed"
            label={withClosed ? `hide ${done.length} closed` : `show ${done.length} closed`}
            plain
            dimColor
            onPress={() => update($, showClosed, () => !withClosed)}
          />
        )}
      </Box>
    )
  })
lavish-pages/hooks/register.tsx lines 320–379 · Band
function row(
  $: EngineInterface,
  e: Parameters<EngineInterface['ui']['resolve']>[0],
  page: LavishPage,
  columns: number,
  descBelow = false,
) {
  const { Box, Text, Button } = $.ui.resolve(e)
  const run = async (argv: string[], done: string) => {
    const res = await $.process.run(argv, { timeoutMs: 20000 })
    $.ui.toast(res.exitCode === 0 ? done : `lavish: ${(res.stderr || res.stdout).trim().slice(0, 120)}`)
    await refresh($)
  }
  const name = nameOf(page.file)
  const isNarrow = columns < 70
  const label = isNarrow ? `${GLYPH[page.status]} ` : `${GLYPH[page.status]} ${WORD[page.status]}`.padEnd(12)
  const meta = [
    page.prompts > 0 && !isDone(page) ? `${page.prompts} queued` : '',
    page.status === 'closed' && page.endedBy ? `by ${page.endedBy === 'user' ? 'you' : page.endedBy}` : '',
    !isNarrow && page.rev !== undefined ? `r${page.rev}` : '',
  ].filter(Boolean)
  const metaText = meta.length > 0 ? `  ${meta.join(' · ')}` : ''
  const buttons = isLive(page) ? 16 : page.status === 'pending' ? 8 : 20
  const room = Math.max(8, columns - label.length - metaText.length - buttons - 2)
  const nameWidth = Math.min(room, name.length)
  const inline = descBelow ? undefined : descFit(page.desc, room - nameWidth - 3)
  const canOpen = page.url !== undefined && !isDone(page) && page.status !== 'dead'

  return (
    <Box key={`row-${page.file}`} flexDirection="row">
      <Text bold={page.status === 'streaming'} dimColor={!isLive(page)}>
        {label}
      </Text>
      <Button
        key={`name-${page.file}`}
        label={fit(name, nameWidth)}
        plain
        dimColor={isDone(page)}
        onPress={() => page.url && run(['open', page.url], `Opened ${name}`)}
      />
      {inline !== undefined && <Text dimColor>{` · ${inline}`}</Text>}
      {metaText !== '' && <Text dimColor>{metaText}</Text>}
      <Text> </Text>
      {canOpen && <Button key={`open-${page.file}`} label="open" onPress={() => run(['open', page.url!], `Opened ${name}`)} />}
      {isLive(page) && (
        <Button key={`end-${page.file}`} label="end" onPress={() => run(['lavish-axi', 'end', page.file], `Ended ${name}`)} />
      )}
      {(isDone(page) || page.status === 'dead') && (
        <Button
          key={`reopen-${page.file}`}
          label="reopen"
          onPress={() => run(['lavish-axi', page.file, '--reopen'], `Reopened ${name}`)}
        />
      )}
      {(isDone(page) || page.status === 'dead') && (
        <Button key={`forget-${page.file}`} label="forget" dimColor onPress={() => save($, l => l.filter(p => p.file !== page.file))} />
      )}
    </Box>
  )
}
lavish-pages/hooks/register.tsx lines 518–530 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    const list = ordered(await read($, pages))
    return (
      <Box flexDirection="column">
        <Text dimColor wrap="truncate-end">
          {summary(list)}
        </Text>
        {list.length === 0 && <Text dimColor>No Lavish pages from this session.</Text>}
        {list.map(page => paneRow($, e, page, e.props.bodyColumns))}
      </Box>
    )
  })
lavish-pages/hooks/register.tsx lines 382–391 · Pane
function paneRow($: EngineInterface, e: Parameters<EngineInterface['ui']['resolve']>[0], page: LavishPage, columns: number) {
  const { Box, Text } = $.ui.resolve(e)
  const below = descFit(page.desc, columns - 4)
  return (
    <Box key={`pane-${page.file}`} flexDirection="column">
      {row($, e, page, columns, true)}
      {below !== undefined && <Text dimColor wrap="truncate-end">{`    ${below}`}</Text>}
    </Box>
  )
}
Licence text (MIT)
MIT License

Copyright (c) 2026 FoCDoT

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 filesenv varsdrives Claudetool callsremembers

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 97b6b8801d07 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.lavish-pages/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.2 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).lavish-pages/hooks/register.tsx:104 find (not on Windows); lavish-pages/hooks/register.tsx:117 grep (not on Windows); lavish-pages/hooks/register.tsx:118 grep (not on Windows)
NetworkWhether every fetch names its https host in the code.lavish-pages/hooks/register.tsx:184 fetch(`${baseOf(list)}/health`)
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.lavish-pages/hooks/register.tsx:329 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and 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 FoCDoT/lavish-pages
/plugin install lavish-pages@lavish-pages

This installs the marketplace's latest commit, which may not be the one read here (97b6b8801d07). 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 "focdot-lavish-pages" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs