# gal-view

> Adds a visual novel-style dialogue view and visual scene editor to DSH Web GUI session pages. Runs entirely client-side with scene data stored in the browser.

## Metadata

- Author: [@Ayase34](https://github.com/Ayase34)
- Repo: <https://github.com/Ayase34/gal-view.git>
- GitHub: [Ayase34/gal-view](https://github.com/Ayase34/gal-view)
- Stars: 114
- Language: JavaScript
- License: [MIT](https://spdx.org/licenses/MIT.html)
- Topics: `deepseek`, `deepseek-harness`, `dsh-plugin`
- Forks: 6
- Open Issues: 4
- Last push: 2026-08-16T00:02:38.000Z
- Added: 2026-08-20T00:00:00.000Z

## Install

```bash
dsh plugin --profile web add github:Ayase34/gal-view
```

## Wiki

## One-line Description
Adds a "GAL View" tab to the conversation page of DSH Web GUI, turning the dialogue area into a draggable, image-switchable Galgame stage with a built-in visual scene editor for instant image, dialogue, and layer modifications.

## Core Features
- Inserts the "GAL View" tab between "Conversation" and "Trace" tabs in the conversation tab bar (tab order determined by `order: 5`)
- Renders dialogue in 16:9 stage format: background, character sprites, large dialogue box, typewriter-style text, player input, and four preset function buttons (history/auto/skip/settings)
- Built-in visual editor: drag to move, resize/align/color/font/layer order adjustments, supports undo/redo (up to 100 history steps)
- Import image and font asset libraries, single image max 8 MB, single font max 24 MB, exceeding limits or mismatched types are automatically skipped
- Export current scene along with referenced assets/fonts as JSON via `Ctrl+S`, can import in edit mode or one-click reset to default preset
- Each conversation independently saves reading progress (current line, page number, typing progress), can resume after switching tabs or refreshing

## Technical Implementation
- **Language**: JavaScript (Node half ESM) + JSX (client half, classic React.createElement transformation)
- **Key Dependencies**: Only esbuild (devDependency, used to bundle `client/` source into `client.js`); runtime has no npm dependencies, `react` is external and shares the same instance with the host renderer
- **Architecture Pattern**: Official bundle plugin——`cordis.patch.yml` mounts a layer `gal-view` on the web composition layer (Node half minimal, no host behavior), `package.json#dsh.client` declares client kernel composition into the page; view layer registers to the conversation view slot via `slots.inject('conversation.view')`, order 5 falls between "Conversation" (0) and "Trace" (10)
- **Entry Files**: `.dsh-plugin/index.mjs` (Node half, no side effects) + `.dsh-plugin/client/index.mjs` (browser half actual logic) + build artifact `.dsh-plugin/client.js`

## Use Cases
Players and creators who want to present AI conversations in Galgame visual novel style within DSH's conversation page. Suitable for customizing conversations with dedicated character sprites/backgrounds/fonts, or using dialogues as interactive story material for screenshots, demos, live streams—localized assets run entirely in the browser, no backend support needed.

## Prerequisites & Compatibility
| Dependency | Min Version | Description |
|---|---|---|
| DSH | Not declared | Plugin doesn't declare `dsh` version constraint in `package.json`, must execute "restart web" after installation for bundle layer to recompose |
| Node | Not declared | `package.json` has no `engines` field; build script `esbuild --target=es2020`, requires modern Node version supporting ESM |
| Platform | Cross-platform | Runs entirely in browser half (Web GUI), OS independent |
| Native Modules | None | No dependency on `node-pty` / `node:sqlite` or other native extensions |

## Installation
```bash
dsh plugin --profile web add github:Ayase34/gal-view
```

## Configuration
This plugin has no traditional user-facing "configuration form"; the only controllable option is the toggle itself.

| Config | Type | Description | Default |
|---|---|---|---|
| GAL View Tab Visibility | Toggle | Can be turned off/on in Web GUI "Settings → Plugins → GAL View"; after disabling, the "GAL View" tab disappears from conversation tab bar, scene data is preserved | Enabled |

## FAQ

**Q: Installed plugin but don't see "GAL View" tab on conversation page?**

A: Bundle layer composes at web startup, must restart web to load plugin; can run `dsh --profile web --dump-config`, output should show `# == gal-view` layer.

**Q: Where are scene layouts, imported images and reading progress stored?**

A: All stored in browser local——scene JSON goes to localStorage, image/font binary goes to IndexedDB; reinstallation or uninstallation won't lose data, only clearing browser site data will reset.

**Q: Can edit mode drag? Supports undo/redo?**

A: Edit mode supports dragging, attribute modification, layer switching (move up/down/to top/to bottom); undo/redo based on stack implementation, keeps up to 100 history steps; can export current scene along with referenced assets/fonts as JSON via `Ctrl+S`.

**Q: Will reinstalling plugin clear my scenes?**

A: No. Scene data is stored in browser local, decoupled from plugin lifecycle; uninstallation or reinstallation won't lose data, only clearing browser site data will reset.

**Q: Any size limits for importing images or fonts?**

A: Single image max 8 MB, exceeded will be skipped; single font max 24 MB, exceeded or non-font types will be skipped. Skipped files won't interrupt batch import.

**Q: What default scene is included? Where does the content seen on first open come from?**

A: `gal-scene.json` in repository root is the default preset scene distributed with the plugin, includes embedded referenced images and fonts; auto-loads this preset when opening for first time with no local archive, "Reset" in edit mode also returns to this preset.

**Q: How to completely uninstall and restore to original state?**

A: Execute `dsh plugin --profile web remove gal-view` then restart web; scene data stays in browser local (doesn't affect uninstallation itself), to completely clear then clear browser site data.

## Getting Started Difficulty
Beginner — one command to install, takes effect after restart; edit mode is WYSIWYG, no code writing needed; to customize preset can export JSON then replace repository root `gal-scene.json` and repackage.

## Known Issues & Limitations
- Single image asset limit 8 MB (`MAX_ASSET_BYTES` in `assets.mjs`), single font limit 24 MB (`MAX_FONT_BYTES` in `fonts.mjs`), exceeding or non-matching MIME types are silently skipped, no error dialog
- Edit mode undo/redo stack keeps max 100 steps (`HISTORY_LIMIT` in `index.mjs`), earlier history discarded after limit
- Browser localStorage/IndexedDB quota limits vary by browser and device, importing large amounts of HD assets may trigger persistence failure (code silently ignores with `try/catch`, no quota warning UI)
- Browser privacy mode swallows exceptions on localStorage read/write, reading progress resets to initial state after refresh
- Editor history menu and "rectangle/circle/decoration" legacy element types only for compatibility display, new menus removed, only nine current types retained: background/character/dialogue/dialogue-text/speaker-name/text/image/button/action-button

---

This document is auto-generated by [deepseek-plugin.org](https://deepseek-plugin.org). HTML page: [gal-view](https://deepseek-plugin.org/plugins/Ayase34/gal-view)
Wiki generated by AI (model: `MiniMax-M2.5`)
