LiminaliaLiminalia
Technical docs: How Studio works: Screens

Screens

Open in Claude (new tab)

The interface is in Japanese and English. Switch it with “English” / “日本語” in the ”…” menu at the right end of the top bar (in the desktop app, also with “View → Language” in the menu; the app menus, the start screen, the export window and dialogs switch too). If you haven’t chosen, it follows the language of the OS or browser. Syntax check messages also appear in English when the interface is in English (diagnostics-en.ts in @liminalia/lang, a table that builds the English from the shape of each Japanese message; the default output of lim check stays in Japanese, and lim check --lang en gives English. A test confirms that every code and message is in the table. Plugin diagnostics use the messageEn and hintEn they provide, and fall back to the original text if there are none). Messages the dev server returns when it refuses a request (the error in the response) also appear in English when the interface is in English. The client adds the header x-liminalia-lang: en (STUDIO_LANGUAGE_HEADER) to its requests, and the dev server translates the message with the table in server/errors-en.ts (which builds the English from the shape of the Japanese message; lines not in the table use the English of the syntax check, and if there is none, the original text) before returning it. A test confirms that every Japanese message of the dev server matches the table. Messages thrown by plugins are passed through as they are. Command descriptions (the names and tags in the parts panel, completion, hover and the parameter panel) also show the English of the command definitions (summaryEn, docEn) when the interface is in English, and the parts panel can also be searched with English words for what you want to do (keywordsEn). Plugin commands without English stay in Japanese. The export window of the desktop app also shows its progress lines in the interface language (@liminalia/project/build-lines-en; the output of external tools, and the detailed messages shown when a tool can’t be found, stay as they are). Confirmations for deleting and overwriting don’t use the browser’s built-in confirm(); Studio asks with its own dialog (askConfirm in confirm-dialog.ts, which also shows “Yes” and “Cancel” in the interface language). Esc or clicking outside cancels.

How the interface is organized (choose the object first)

Files, scenes, lines, pages, parts, characters, assets, variables, game settings, endings and comments are opened and selected first, and the actions are attached to that object where you can see them (OOUI). The screen names in the top bar are all nouns, every panel has a heading and a close button, and the cards for files, scenes, lines, pages and the flowchart show the same menu as a right-click from their ”…”. The script heading is the open file itself; clicking it shows that file’s menu (including Import text and Change history). The following stay as tasks, because the procedure itself is what matters: test play, export, ⌘K and search and replace across files, running checks and measurements, importing text, applying a theme, assigning voices in bulk, and the getting started tour.

From left to right, the top bar has the project button (the cover image and the project name; the cover is the export icon (build.icon), or the first background of “New game” if there is none; clicking it opens “Project”), back and forward (⌘[ and ⌘], or the mouse’s back and forward buttons), the switch between the main screens (“Script,” “Flowchart” and “Check”; Check has a badge with the number of problems), the other screens (“Characters,” “Assets,” “Variables,” “Game settings,” “Game screens” and “Plugins”) and the “More screens” menu, search (⌘K; in the desktop app, ⌘P too; see “Search and commands” below), “Export,” “Test play,” the color scheme button (it switches auto → light → dark in that order; the desktop app tells the app the choice (setTheme), and the export window uses the same color scheme), and the ”…” menu (Refresh, Getting started tour, How to use (website), How-to guides (website), language, showing and hiding panels, and backgrounds in scene headings). “How to use (website)” opens the Studio guide on the site (/guide/, or /en/guide/ in the English display), and “How-to guides (website)” opens the how-to guides (/howto/), in another tab (the Studio app opens it in the default browser; it’s also in the Help menu). The site’s URL is kept in one place, SITE_URL in protocol.ts, and links are made with siteUrl and referenceUrl. The top bar fits within the width of the window (fitTopbar in app.ts, which measures again whenever the width changes). If there isn’t enough room, it first shortens the project name to 7 characters, then moves the tabs of the other screens, starting from the end (Plugins), into the “More screens” menu, and if that still isn’t enough, it shows only the cover for the project. Moved tabs are hidden, so Tab doesn’t move focus to them either (at a width of 1024px, all the other screens are in the menu). The “More screens” menu lists the screens that didn’t fit, and always “Timeline,” “Comments,” “Voices” and “Trash” (Timeline can also be opened with “Open” in the right panel of the Script screen). The badge with the number of open comments appears on this button. When the current screen is one in the menu, the button looks selected. When the text size is 100%, the text size button isn’t shown. The keys for switching screens follow the order of the top bar: ⌘1 Script, ⌘2 Flowchart, ⌘3 Check, ⌘4 Characters, ⌘5 Assets, ⌘6 Variables, ⌘7 Game settings, ⌘8 Plugins, ⌘9 Project (Timeline, Comments and Voices, and Game screens, which was added later, have no number). The tab tooltips show the keys. Except on the Mac, keys are shown with Ctrl (keys written with ⌘ are Ctrl on Windows and Linux; tooltips and tour text are changed to Ctrl+… too; plainKeys in strings.ts). When Studio is opened in a browser, it doesn’t take keys the browser uses: ⌘P and Ctrl+P stay as print (open files with ⌘K and Ctrl+K), and instead of ⌘1–9 and Ctrl+1–9 (which switch browser tabs), screens switch with ⌃1–9 on the Mac and Ctrl+Shift+1–9 elsewhere (⌘⇧3–5 on the Mac take screenshots, so they aren’t used). ⌘+, ⌘− and ⌘0 are taken as Studio’s text size (instead of the browser’s zoom), and ⌘S as save. ⌘⌥P starts a test play from the cursor line, ⌘⌥R adds ruby to the selected characters (see “Ruby” below), ⌘⌥K bookmarks the cursor line, F2 and ⇧F2 go to the next and previous bookmark (see “Bookmarks” below), F12 goes to the jump target or the macro definition and ⇧F12 lists the lines using the macro on the cursor line (in some browsers the developer tools get them first), ⌘F finds in the open file in the script (see “Find and replace in the block view” below; the editor’s search in the code view, and the search field of other screens; in the desktop app, also “Edit → Find” and “Edit → Find in All Files” (⌘⇧F) in the menu), and ⌘Z and ⇧⌘Z on the Timeline, Voices, Assets, Characters, Flowchart, Game settings, Game screens, Project and Variables screens undo and redo the changes made on that screen (see “Play from Here,” “Go to Jump Target” and “Undo on screens” below). “Refresh” in the ”…” menu (in the desktop app, “Project → Refresh” in the menu, ⌘⇧R) reloads a project that was changed outside Studio (see “Refresh” below). “Test play” plays the game from the beginning (in the desktop app, in the app’s test play window; in a browser, in another tab). “Play from Here” starts a test play from the selected line (see “Play from Here” below). Back and forward return to where you were, as in a browser. They remember screen switches, switches between script files, and moves to a line 10 or more lines away in the same file (not moves made by the preview’s cursor sync), and moves within a screen (asset kinds and folders, the selected character and the view (“Settings” and so on) on the Characters screen, position adjustment, variable kinds, the project panels, plugin pages). When you go back to a place in the script, the preview moves to that line too (not while it is paused). Plugin screens can go back the same way with navState, restoreNav and ctx.remember() (plugins.md). In the desktop app, “Export” opens the export window (the client tries to go to STUDIO_PLAY or STUDIO_EXPORT, and the app catches it). In a browser, it shows how to export instead (export-dialog.ts): open the project in the desktop Studio and click “Export,” or run lim build . browser in the project folder (“Copy” copies the command). Notices appear over the bottom center of the screen. Notices with a button such as “Undo” (12 seconds) aren’t removed when the next notice arrives; the next one stacks on top (up to 3; each disappears when its time runs out or when you click it). Error notices (errorText in errors.ts) show only what happened and what to do. Reasons the dev server returns in words (4xx) are shown as they are; unexpected failures inside the server (5xx), lost connections and program errors are reworded. The raw details (exception messages, HTTP status codes) are left only in the developer tools console (what project plugin screens and commands throw is shown as it is, for the people who write the plugins).

Studio’s look uses Radix Colors (mauve for grays, violet for actions and the current position), with the bundled fonts Zen Kaku Gothic New, Zen Old Mincho and JetBrains Mono (client/fonts.css; the desktop app includes only the woff2 files for the weights it uses). Character colors use color in cast.json (the color of the name box in the game) as it is, and characters without a color are gray. Faces are cropped from the base variant of the sprite, and the crop position is saved in Studio’s data (.liminalia/shared.json). Things only Studio needs (face positions, the positions of scenes moved on the flowchart and so on) aren’t saved in the game data (.lim, cast.json, liminalia.json).

Studio’s data is split into two files (server/studio-state.ts). What is shared with the project (scene tags and statuses sceneMarks, character notes castNotes, face crops faces, head marks heads, and positions of scenes moved on the flowchart mapPositions; STUDIO_SHARED_KEYS) is kept in .liminalia/shared.json and goes into Git (the template’s .gitignore excludes everything in .liminalia/ except this file). It reaches co-authors and the mobile studio too, and changes brought in with Git show up on screen right away. What belongs to you alone (where you last were, bookmarks, favorites, breakpoints, the character goal and daily counts, the TODO marker words, the name for comments) is kept in .liminalia/studio.json and stays out of Git. Shared data that an earlier version saved in .liminalia/studio.json is moved to .liminalia/shared.json when the project is opened (if .liminalia/shared.json already has a value for the same scene or character, that one is used). Neither file goes into the exported game.

The first time Studio opens, it guides you by highlighting the main areas in turn (blocks and code, the parts panel, the script, the preview, test play, dropping assets) (client/tour.ts; close it with Esc or “Close,” and it remembers that you’ve seen it). You can see it again with “Getting started tour” in the ”…” menu.

When Studio opens, it returns to the file and line you had open last time (lastOpen in .liminalia/studio.json, remembered per project; if the file is gone, it opens the entry file). When there is nowhere to return to (the first time a project is opened), the cursor goes to the first line of text in entry (a line whose picture shows in the preview, not the comments at the top).