Merged
Conversation
… changes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd Stats tab improvements
## Syntax Highlighting (TextMate + Semantic Tokens)
- Add `lib/renpy.tmLanguage.json`: comprehensive TextMate grammar for Ren'Py with 40+
patterns covering labels, init/python blocks, define/default, screen/transform
definitions, jump/call/scene/show/hide/play/stop statements, ATL keywords, screen
language, character dialogue, string interpolation, and builtins
- Add `lib/textmateGrammar.ts`: async TextMate engine bridge using `vscode-textmate` +
`vscode-oniguruma`; loads onig.wasm via fetch and registers a Monaco TokensProvider
that replaces the Monarch tokenizer after async init (Monarch kept as immediate fallback)
- Add `lib/renpySemanticTokens.ts`: 9 semantic token types (renpyLabel, renpyLabelUndefined,
renpyCharacter, renpyCharacterUnknown, renpyImage, renpyImageUnknown, renpyScreen,
renpyScreenUnknown, renpyVariable) with dark/light theme rules; cross-references live
analysis data so undefined jump targets and unknown screen refs highlight distinctly
- Add `public/onig.wasm`: Oniguruma WASM binary (copied from vscode-oniguruma release)
- Update `components/EditorView.tsx`: register semantic tokens provider with
`monaco.Emitter<void>` wired to re-fire on analysis changes; expand renpy-dark/light
themes to ~30+ rules; set `semanticHighlighting.enabled: true` in editor options
- Add `vscode-textmate` and `vscode-oniguruma` to package.json
## Diagnostics Tab (replaces Punchlist)
- Add `hooks/useDiagnostics.ts`: `useDiagnostics()` hook aggregating 8 diagnostic sources
into a unified `DiagnosticsResult` — invalid jump/call targets, syntax validation on all
blocks, missing images, missing audio, undefined characters, undefined screens, unused
characters, and unreachable labels; also exports `migratePunchlistToTasks()` for
backwards-compatible migration of saved punchlist data
- Add `components/DiagnosticsPanel.tsx`: two-section panel — Issues (auto-detected,
non-dismissible, grouped by file with collapsible sections and severity filter pills)
and Tasks (user-created work items with inline add/complete/delete; sticky notes from
canvas auto-appear as pinned tasks); tab badge shows live error count
- Delete `components/PunchlistManager.tsx`: fully replaced by DiagnosticsPanel
- Update `types.ts`: add `DiagnosticSeverity`, `DiagnosticIssue`, `DiagnosticsTask`,
`DiagnosticsResult`; add `'diagnostics'` to `EditorTab.type` union; add
`diagnosticsTasks` to `ProjectSettings`
- Update `App.tsx`: call `useDiagnostics()` at top level so badge count is available
even when the panel is not mounted; load/save `diagnosticsTasks`; migrate old
`punchlistMetadata` and `punchlist` tab type on project load
- Update `electron.js`: rename Punchlist → Diagnostics in View menu
## Toolbar & View Menu UX
- Move Stats and Diagnostics buttons to the toolbar middle group (after Tidy Up),
separated by a divider; Diagnostics button shows a live red error count badge
- Remove Stats button from the right action group (it was semantically misplaced)
- Add Stats to the View menu so it appears alongside all other views
- Update `Toolbar.tsx`: add `diagnosticsErrorCount` prop; update `onOpenStaticTab`
type to include `'diagnostics'`
## Stats Tab Improvements
- Restructure into three labeled sections: Writing, Structure, Assets & Health
- Writing: Total Words, Estimated Playtime, Dialogue Words, Narration Words (with
percentage-of-total subtitles showing the dialogue/narration split)
- Structure: Script Files, Characters (total defined, sub-label shows speaking count),
Labels, Menus/Branches, Identified Routes; complexity score replaced with a bucketed
label (Linear / Branching / Complex / Non-linear) based on branching density rather
than a formula that maxes out at 10 for any large project
- Assets & Health: Image Assets, Audio Assets, Script Errors (clickable card that
navigates to Diagnostics tab when errors exist)
- Character word count chart switched to vertical layout (matching Lines by File);
adds Top 5 / Top 15 / All toggle; subtitle shows "Showing X of Y speaking characters
(Z defined with no dialogue)" to account for silent defined characters
- Lines by File: extended to Top 15 / Top 30 / All toggle
## Validator False Positive Fixes (lib/renpyValidator.ts)
- `init offset = N`: excluded from init-block-missing-colon rule (`init offset` is a
valid assignment statement, not a block opener)
- `label _("text")` screen displayable: added screen-block context tracker (similar to
existing python-block tracker); suppresses `checkMissingColon` and
`checkMenuChoiceCondition` inside `screen name(...):` blocks, fixing false positives
for `label title`, `label _("Display")`, and similar screen language displayables
- Multi-line `define` dict literals: `"key" : value` dict entries no longer trigger the
menu-choice rule (bail when `afterQuote` starts with `:`)
- Triple-quoted strings: closing `"""` line no longer triggers menu-choice rule (was
parsed as empty string `""` + dangling `"`, producing garbled error message)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.