Fix: bare page-range scope returns empty; restore MCP byte-for-byte parity#1
Open
newjordan wants to merge 2 commits into
Open
Conversation
In the export scope bar (and the MCP's scope selectors), choosing "Page
range…" and entering a single page with no dash — e.g. `7` — matched ZERO
scenes and silently produced an empty export. parseRangeSet stored the bare
number in its `set`, but the pages branch of exportScenes() queried it with
an empty numStr (`r.has('', scenePageStart(i))`), so the set was never
consulted and no range existed to match.
Pass the computed page number as the match key (`r.has(p, p)`), so a bare
page matches via the set and page ranges still match via `ranges`. Fixed
identically in the app (src/index.html) and the MCP server so the two stay
in parity. Scene-number scope is untouched.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2NtcuBy6SQmKaBQtgvkog
The MCP server documents that its packs reproduce the desktop app's output "byte-for-byte", but two templates had drifted: - Video and storyboard packs: when a PROP BIBLE is present, the app emits a blank line before `## SHOTS TO GENERATE` / `## FRAMES TO GENERATE`; the MCP ran the heading straight onto the prop rows. - Script Companion: the app has a blank line between the style-guide slot and `### Bibles`; the MCP omitted it (affecting every companion export). Match the app exactly. Verified by rendering both sides for the same project and diffing to zero bytes (companion, video-with-prop-bible, image-with-prop- bible all now identical). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2NtcuBy6SQmKaBQtgvkog
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.
Two small correctness fixes (export scope + MCP parity)
Two independent, low-risk fixes surfaced while working in the export code. Each is its own commit.
fix(export)— a bare page number in "pages" scope matched zero scenesIn the export scope bar, choosing "Page range…" and typing a single page with no dash — e.g.
7— matched zero scenes and silently produced an empty export.parseRangeSetstored the bare number in itsset, but the pages branch ofexportScenes()queried it with an empty key (r.has('', scenePageStart(i))), so the set was never consulted and no range existed to match.Fixed by passing the computed page number as the match key (
r.has(p, p)), so a bare page matches via the set and page ranges still match viaranges. Fixed identically in the app and the MCP so the two stay in parity; this also fixes the same bug in the MCP'slist_scenes/get_shot_list/export_prompt_packunderscope:"pages". Scene-number scope is untouched.fix(mcp)— restore byte-for-byte parity with the app's prompt packsThe MCP server documents that its packs reproduce the app "byte-for-byte", but two templates had drifted:
## SHOTS TO GENERATE/## FRAMES TO GENERATE; the MCP ran the heading straight onto the prop rows.### Bibles; the MCP omitted it (affecting every companion export).Matched the app exactly. Verified by rendering both sides for the same project and diffing to zero bytes (companion, video-with-prop-bible, and image-with-prop-bible all now identical).
Not fixed here (found, not touched)
An adversarial pass over the parser/exporter turned up several more unrelated bugs I intentionally left out of this focused PR — e.g. the FDX title-page reader rejecting real titles that start with a metadata word (
Draft Day,Byzantium), an all-caps action line between two non-blank lines being mis-detected as a character cue, and a combinedINT/EXT.heading voiding a PDF's layout-derived page numbers. Happy to open those separately with repro cases.🤖 Generated with Claude Code
https://claude.ai/code/session_01A2NtcuBy6SQmKaBQtgvkog