for gtnh branch sync upstream - #1
Merged
Merged
Conversation
…piler purification (#14) * feat(autocomplete): add core interfaces, selection strategies, and word boundary resolver * feat(autocomplete): add AutocompletePopup widget Implements the dropdown popup UI for autocomplete suggestions with scrollable candidate list, selection highlighting, scrollbar, and viewport clamping. * feat(autocomplete): add MdxSyntaxResolver, provider interfaces, and ItemIdProvider * feat(autocomplete): integrate popup and double-click selection into GuideScreen * fix(autocomplete): dirty hotfixes for popup trigger, position, scroll, and value range - Fix keyboard typing not triggering autocomplete (schedule polluted state) - Fix popup position anchoring to cursor pixel instead of hardcoded offset - Fix popup flip above cursor when insufficient room below - Fix Backspace consumed by navigation instead of forwarded to textarea - Fix modal scroll wheel (popup only when mouse inside) - Fix ItemCandidate icon offset - Fix fallback regex replaceEnd to scan forward for closing quote - Add cursor pixel position API to SceneEditorMultilineTextArea - Add throttled diagnostic logging * refactor(autocomplete): clean up, cache AST, extract shared utils - Remove debug printlns - Cache MdAstRoot to skip re-parse on cursor-only moves - Store pendingContext to avoid re-resolve on commit - Preserve popup scroll/selection when candidate list unchanged - Extract getAutocompleteAnchorX/Y(), eliminate magic numbers - Extract SyntaxUtils shared by 3 resolvers - Fix fallback regex for lowercase tags - Fix raw Map type, COWList→ArrayList, skip redundant computeSize * feat(autocomplete): add TagAttributeRegistry, AttributeSpec, AttrType * feat(autocomplete): add renderWidth() to AutocompleteCandidate * feat(autocomplete): add resolver chain, context types, and attribute name completion - Add CompositeResolver to chain Frontmatter→Mdx→WordBoundary resolvers - Add FrontmatterResolver for YAML frontmatter key/value detection - Add MdxValueContext, MdxAttrNameContext, TagStartContext, FrontmatterContext - Extend MdxSyntaxResolver with TAG_START and ATTRIBUTE_NAME detection - Extend AutocompleteProviders with 4-way context dispatch - Add AttributeNameProvider using TagAttributeRegistry - Add ColorCandidate and RegistryCandidate rendering stubs - Wire CompositeResolver into GuideScreen * feat(autocomplete): add 16 value providers and tag name provider - Boolean, EnumValue, Color, OreDict, BlockId, EntityName providers - KeyBind, PageReference (stub), Anchor (stub), Command providers - NumericValue, Expression, Domain, FormatPattern providers - RecipeFilter, TagName providers - Fix RegistryCandidate to support ItemStack icon rendering - Register all providers in ClientProxy * feat(autocomplete): add frontmatter, markdown, and structural hint providers - FrontmatterKeyProvider and FrontmatterValueProvider - MarkdownInlineProvider, MarkdownBlockProvider, FencedBlockLanguageProvider (stubs) - NbtProvider, Vector3Provider, DataProvider for structural template hints - Add autocomplete-test.md guide page for manual testing * refactor(autocomplete): remove 6 unnecessary providers, merge recipe filter, fix registry gaps - Remove Boolean, Vector3, Nbt, Data, MarkdownInline, MarkdownBlock providers - Merge RecipeFilterProvider into ItemIdProvider (add input/output keys) - Simplify ColorProvider to symbolic names only - Add chart tags (Bar/Column/Line/Scatter/PieChart) to TagAttributeRegistry - Add chart child tags (Series, LineSeries, Slice, PieInset) - Add FunctionGraph child tags (Plot, Point) - Extend GameScene/Scene with camera attributes - Extend Function/FunctionGraph with container attributes - Extend Entity with rotation attributes - Extend Latex with sourceScale, showTooltip, offset - Extend ImportStructure, PlaceBlock, ReplaceBlock with bounds attrs - Add Block scene element tag * feat(autocomplete): implement PageReference, Anchor, FrontmatterValue, FencedBlockLanguage providers - FencedBlockLanguageProvider: return language list filtered by partial text - PageReferenceProvider: static setPages() wired from GuideScreen, suggests page paths - AnchorProvider: static setDocumentText() wired from GuideScreen, parses headings - FrontmatterValueProvider: contextual hints per frontmatter key * feat(autocomplete): add ImagePathProvider for src attribute file suggestions Scans resource pack asset directories for .png/.snbt/.csv/.json/.mmd files. Uses AccessorFMLClientHandler mixin for resource pack access, same pattern as DataDrivenGuideLoader. * fix(autocomplete): correct provider semantics, disable unstable providers - Fix crash-causing format patterns (%d/%f) and domain syntax - Separate Anchor display/replacement, limit Color to Color/id - Filter NumericValueProvider by attr name, add missing tag keys - Handle # inside frontmatter quotes - Disable TagNameProvider, AttributeNameProvider: unreliable until parser supports error-recovery - Remove EnumValueProvider, FencedBlockLanguageProvider registrations - Roll back EntityNameProvider hardcoded aliases * bugfix * Update PageCompiler.java * bugfix * bugfix * fix: parser soundness - validate attributes, handle escapes, reject NaN/Infinity * refactor: make MDX tokenizer error-tolerant, remove fallback parser * fix: set AST attribute positions, restore tag-start detection with parent context * refactor: migrate YAML and code-fence to AST, delete manual resolvers * fix: frontmatter autocomplete filtered out by WORD type check * fix: autocomplete alignment - frontmatter, link URL, tag-start context, smart newline * fix: make parser fully error-tolerant — eliminate all user-input-driven throws - FactoryTag: fix recover() token exit order (LIFO), handle EOF vs non-EOF consume, remove crashEol, unify optionalEsWhitespace to always allow lazy lines - FactoryMdxExpression: add recovery token for lazy-line bailout path - MdxMdastExtension: replace 6 ParseException throws with graceful recovery or recursive stack unwind in onErrorRightIsTag/onErrorLeftIsTag - MdastCompiler: replace 3 throws (exit open==null, defaultOnError x2) with recursive unwind + stack restoration; guard onexitlineending against empty stack The tokenizer and mdast compiler now produce a partial AST for any input, ensuring autocomplete can always query syntax context. * fix: autocomplete — YAML list items with colons, top-level parent key, nested MDX elements - YAML list items with colons in value (e.g. "guidenh:guide_icon") now correctly resolve to their parent key context via isYamlListMarker check before colon-split - Top-level keys with prevIndent=0 now return their own context for list items and empty lines, instead of falling back to plain text - findEnclosingMdxElement: search children first for innermost match, fixing nested MDX element attribute/tag-start autocomplete * fix: partial tag name autocomplete and blank-line Enter in frontmatter - resolveTagStart: extend to detect partial tag names after '<' (e.g. <I|, <Item|) by walking back to '<' and extracting partialText for TagNameProvider filtering. Closing tags (</I) are excluded. - applySmartNewline: when the current line is blank (trimmed empty), move cursor to the next line instead of inserting an extra blank line. * fix: missing closing brace in applySmartNewline * feat(autocomplete): register missing tag attributes — annotations, sounds, quests, block stats - Add 6 annotation tags: BlockAnnotation, BoxAnnotation, LineAnnotation, DiamondAnnotation, TextAnnotation, BlockAnnotationTemplate (41 attrs) - Add 2 sound tags: PlaySound (11 attrs), SoundLink (10 attrs) - Add 2 quest tags: QuestLink (id, text), QuestCard (id, show_desc) - Add 2 block stats tags: BlockStats (10 attrs), BlockStat (3 attrs) * fix: mark recovered MDX elements so resolver skips them consistently - Add 'recovered' field to MdxJsxFlowElement, MdxJsxTextElement, and Tag - Register mdxJsxRecovery enter handler in mdast extension - Reorder non-EOF recovery: emit mdxJsxRecovery BEFORE tag exit so the handler runs before exitMdxJsxTag creates the AST node - findEnclosingMdxElement skips recovered=true nodes - Remove ATTRIBUTE_NAME→TAG_START resolver fallback * update * fix: mark MDX tags recovered at EOF and fix tag-start position * feat: Phase 1 Runtime abstraction — MasterScheduler, LytHost, WorkItem Add unified tick scheduling and Lyt tree host environment: - MasterScheduler: single ClientTick.END entry point with priority queues - WorkItem interface: shouldRun() + tick(deadlineNs) → YIELD/DONE - LytHost: event queue, deferred task queue, NavigationState, ViewportState - LytHostWorkItem: thin WorkItem adapter for MasterScheduler - WarmupWorkItem, SearchIndexWorkItem, DevWatchWorkItem: migrate from GuideWarmupPump, GuideSearch, GuideDevWatcherPump - NavigationState: consolidates GuideScreenMemory, GuideBookmarkState, GuideScreenHomeHistory into single instance - ViewportState: encapsulates scroll/clamp/viewport rect logic - LytNode: add replaceChild(), isAttached() - LytDocument: add replaceChild() override - Wire MasterScheduler + LytHost in ClientProxy - GuideScreen: migrate to LytHost.getNavigation() / getViewport() * refactor: complete Phase 1 migration — disable old tick pumps, wire LytHost - Remove GuideWarmupPump.init() and GuideDevWatcherPump.init() calls - WarmupWorkItem and DevWatchWorkItem now fully replace them - Add WarmupWorkItem.clearScheduler() for GuideLightweightReloadService - Connect LytHost.setDocument() on page load in GuideScreen - Clean up unused imports in ClientProxy * fix: sync ViewportState scroll, bridge NavigationState with old singletons - ViewportState.scrollTo() now called from clampScroll() to sync scroll position - Add recallNavigationState, consumeValidLastContentState, isSupportedContentAnchor, isValidContentRoute to NavigationState (migrated from GuideScreenMemory) - Replace last 2 GuideScreenMemory call sites in GuideScreen - Bridge bookmark/history writes to both NavigationState and old singletons - Document known Phase 1 residuals in design doc * refactor: Phase 2A — IR unification, MdAst→MdxJsx conversion - Add MdAstToMdxConverter: convert all MdAst nodes to MdxJsxElement in-place during PageCompiler.parse(), keeping only MdAstText as leaf - Add 14 new TagCompilers for standard elements: Block: p, h1-h6, ul/ol, li, pre, blockquote, table, hr Inline: strong, em, del/u/wavy/dotted, code, img - Simplify PageCompiler: eliminate all instanceof MdAst* branches in compileBlockContext() and compileFlowContent() - Simplify PageIndexer: same treatment — tag dispatch by MdxJsx name - Simplify GuideSiteHtmlCompiler: same treatment for 25+ branches - Adapt helper files: MarkdownRuntimeBlocks, MarkdownListSemantics, GuideTitleHeadings, HomePageSummaryExtractor, GuideMarkdownDefinitions - Add MdAstToMdxConverter.convert() calls after MdAst.fromMarkdown() in SceneEditorMarkdownCodec, SceneEditorMultilineTextArea, MdxSyntaxResolver - Add LytBox.replaceChild() for nested stub node replacement - Register all new TagCompilers in DefaultExtensions * fix: Phase 2A — runtime regressions from code review - C1: BlockquoteCompiler — call parseBlockquoteDirective() for alert/quote boxes - C2: ListItemCompiler — call extractTaskMarker() for [x]/[ ] checkboxes - C3: GuideSiteHtmlCompiler — restore code block sub-languages (csv/filetree/mermaid/functiongraph) - D6-1/D6-2: skip <definition> elements (no error block), forward <span> children - Fix navigation: parse frontmatter BEFORE converter removes MdAstYamlFrontmatter - Fix table inline nodes: add phrasing containers (td/th/p/li etc.) to isPhrasingParent - FQN cleanup: replace inline FQNs with proper imports in ListItemCompiler, MdxSyntaxResolver * fix: buildErrorPage uses MdxJsx, convertPhrasingChildren handles mixed content - buildErrorPage() now creates MdxJsxFlowElement instead of MdAstHeading/MdAstParagraph, so error pages go through the tag-dispatch pipeline correctly. - convertPhrasingChildren() now accepts List<?> and handles both inline phrasing and block-level nodes (e.g. MdAstParagraph inside <td>), fixing ClassCastException that caused pages with table cells containing block content to lose their frontmatter and disappear from the navigation tree. * fix: restore paragraph merging in compileBlockContext for inline content Table cells with alternating MdAstText and <code> elements (e.g. `billboard`, `smoke`, `largesmoke`) were getting each text fragment wrapped in a separate LytParagraph because the new compileBlockContext lacked the previousLayoutChild optimization. Restored it: adjacent inline elements now merge into one paragraph. Added known-issues memo to phase2 spec for the proper fix (TableCompiler should use compileFlowContext directly). * fix: kramdown table widths, NFE protection, dead code removal prep - MdAstToMdxConverter: convert kramdown {: widths=... } lines to <table-meta> - TableCompiler: consume <table-meta> elements, apply preferred column widths - HeadingCompiler: depth default 1, parseIntSafe with NFE protection, clamp 1-6 - ListCompiler: parseIntSafe with NFE protection for start attribute * refactor: Phase 3 — compiler purification, LytHost runtime, dead code removal - Add id/nodeUid/styleClass fields and onAttach/onDetach lifecycle to LytNode - Add isLive/setLive with recursive cascade to LytDocument - Introduce LytScript, ScriptContext, ScriptType interfaces - Add script registry, two-level cache, MOUNT dispatch to LytHost - Migrate 18 impure compilers to pure TagCompiler + LytScript stubs - Delete GuideWarmupPump, GuideWarmupScheduler, WarmupWorkItem, GuideDevWatcherPump - Remove 19 warmup methods from MutableGuide, warmup page cache - Remove 12 dead MdAst compile methods from PageCompiler - Wire LytHostPreheatItem to MasterScheduler with MEDIUM priority * fix: Phase 3 review — scene data loss, flow MOUNT dispatch, missing registrations - ScenePlaceholder now extends LytParagraph so config data survives - BlockImageCompiler stores extracted attributes in BlockImagePlaceholder - dispatchMountEvents/allocateNodeUids traverse LytParagraph content + LytFlowSpan children - LytFlowContent gets nodeUid field for flow-level node identification - LytScript.onEvent/LytEvent target widened to Object for flow content support - Register missing scripts: BlockImage, CsvTable, Mermaid, Scene, GameScene * fix: cascadeLive, LytBox lifecycle, flow-content replace, 9 script implementations - Fix cascadeLive to call onAttach/onDetach on all nodes (was only LytDocument) - Add lifecycle hooks to LytBox append/removeChild/replaceChild - Handle LytFlowInlineBlock in MOUNT dispatch (penetrate to inner block styleClass) - Support LytFlowContent replacement in ScriptContextImpl.replace() - Wire LytHostPreheatItem to MasterScheduler, setCurrentPageId in GuideScreen - Make CategoryPlaceholder and SpecialPlaceholder public with public fields Implement 9 LytScript: PlayerNameScript — read Minecraft username KeyBindScript — look up key binding mapping CommandLinkScript — set click callback with chat command SoundLinkScript — set click sound spec StructureScript — resolve item stacks via Item.itemRegistry SubPagesScript — query navigation tree, build page link list ItemGridScript — resolve item stacks, build item grid ItemImageScript — resolve item stack, build LytItemImage ItemLinkScript — resolve item stack, set tooltip (index lookup deferred) * fix: materialize 7 empty-shell scripts, flow-content replace, scheduler persistence 7 scripts now have real runtime implementations: - ImageScript/FloatingImageScript: loadAsset → LytImage replacement - MermaidScript: parse .mmd → LytMermaidMindmap - SpecialScript: MediaWiki special page resolution via Guide - RecipeScript: NEI recipe lookup cascade (handler → integration → vanilla) - BlockImageScript: mini 3D block scene construction - SceneScript: re-parse childrenSource → dispatch to 19 element compilers Fixes: - ScriptContextImpl.replace handles LytParagraph parents (not just LytFlowSpan) - Flow content replacement invalidates document layout - LytHostWorkItem stays in scheduler queue (was removed after first DONE) - ScenePlaceholder fields made public, pageDomain stored for runtime compiler - ScriptContext.getPageCollection() added for SpecialScript - SceneScript applies all config (layerSlider, grid, showGrid, explicitCenter) * fix: 9 verified bugs from adversarial audit - QuestCardScript: createQuestGuiLink instead of createQuestLink(null) → NPE - RecipeScript: read ph.limit, always ctx.replace in showFallback, drop stale multi guard - MermaidScript: replaceWithError on all 3 failure paths - ItemLinkScript: ore attribute fallback via OreDictionary.getOres() - FloatingImageCompiler: Random(0) for deterministic borderColor - BlockImageCompiler/Script: Integer.MIN_VALUE sentinel for meta=0 vs unspecified - MasterScheduler: progressive deadlineNs across HIGH/MEDIUM/LOW queues * fix: replace loading placeholders and error messages with styled [TagName] format * fix: transparent LytFlowInlineBlock penetration in ctx.replace, universal replaceChild - ScriptContextImpl.replace(): when node is LytFlowInlineBlock and newNode is LytBlock, swap inner block via setBlock() — all block-level scripts automatically work in paragraph/list-item contexts without wrapper awareness. - LytNode.replaceChild(): default throws UnsupportedOperationException instead of silent no-op. Missing overrides added to LytAlignedBlock, LytDocumentFloat, LytDetailsBlock, LytQuoteBox, and LytTableRow. - ItemId parsing in ItemImageScript, ItemGridScript, StructureScript: use IdUtils.parseItemRef() to correctly handle namespace:path format (was broken by lastIndexOf(':') splitting). - SceneScript: GuideSceneStructureCompileScope.run(true, ...) to enable scene element compilation at runtime. - LytHostWorkItem: always return YIELD to prevent scheduler ejection. - LytParagraph: PLACEHOLDER_STYLE (amber) and ERROR_STYLE (red) for consistent placeholder/error display. - RecipeScript: use ph.limit directly, always ctx.replace() in showFallback. - FloatingImageCompiler: Random(0) for deterministic border color. - BlockImageCompiler: meta default Integer.MIN_VALUE sentinel. - docs/refractor/phase3-two-tree-problem.md: architectural memo. All scripts: replace "Loading..." spam with clean [TagName] placeholders and [TagName] error messages on failure paths. * sa * fix: resolve merge compilation errors - Remove extra closing brace in MutableGuide.close() - Remove unused GuideDevWatcherPump import in ClientProxy - Replace Collections.emptyMap() with Map.of() in SceneEditorMarkdownCodec * fix: null-guard drawTiledBackground against missing mc/textureManager GuideScreen.drawTiledBackground could NPE when mc is null during screen transitions. Added defensive null check with warning log instead of crash. * feat: wire document cache and preheat pipeline with mount/swap dual-path - Replace setDocument with mountDocument (fresh) and swapDocument (cached) - PageCacheEntry stores GuidePage with mounted flag to distinguish preheated-only from fully materialized cache entries - completePendingContentPageLoadIfNeeded checks cache before compiling - Wire PreheatCompiler, requestPreheatNeighbors, preheatStep to real impl - LytHostPreheatItem: shouldRun → hasPreheatWork, tick → preheatStep - LRU eviction at 32 pages; evict/invalidate clean up preheatScheduled - Null-guard drawPageMissingMessage and drawLoadingMessage against mc==null * refactor: replace page-level mounted flag with node-level result cache - Remove swapDocument/mounted/isPageMounted/markPageMounted - mountDocument resets pageNodeCounters for stable UIDs across remounts - dispatchScript checks node cache before invoking script - ScriptContextImpl.replace records node results on every branch - completePendingContentPageLoadIfNeeded always uses mountDocument * feat: defer Micromark AST parse to first getAstRoot() call F3+T reload now only extracts YAML frontmatter (~200ns/page) instead of running full Micromark parsing (~161us/page). The AST is lazily parsed on first getAstRoot() call, which happens during page display, preheat pipeline, or background search indexing. * fix: add super.initGui() and mc null guard to prevent NEI crash GuideScreen.initGui() did not call super.initGui(), so NEI's Mixin never initialized the GuiContainer.manager field. Calling super.initGui() ensures the NEI manager is properly set up. Also added mc==null guard in updateScreen() as a defensive measure. * fix: strip UTF-8 BOM in frontmatter extraction and init NEI manager - parseFrontmatterFromSource() now strips UTF-8 BOM before extracting YAML frontmatter, fixing "0 navigation entries" in NavigationTree - GuideScreen.initGui() initializes NEI GuiContainerManager via reflection to prevent Mixin NPE from uninitialized manager field - Added null guards: mc==null in updateScreen(), guide==null in rememberNavigationState() * feat: add dispatchSubtree API for detached block tree MOUNT dispatch Adds ScriptContext.dispatchSubtree() and LytHost.dispatchToSubtree() to recursively allocate UIDs and dispatch MOUNT events into a detached subtree (e.g. tooltip content). Needed for scripts to materialize placeholders in content that is not reachable through the main document. * fix: add TooltipScript to dispatch MOUNT events into tooltip content TooltipTagCompiler now sets styleClass="Tooltip" on LytTooltipSpan. TooltipScript walks the detached ContentTooltip subtree on MOUNT, dispatching to nested placeholders (Recipe, ItemImage, BlockImage, etc.) that were previously unreachable and displayed as yellow "[TagName]". * fix: restore missing scene properties in BlockImageScript Align BlockImageScript with original Phase 2 BlockImageCompiler: - setShowBackground(false) - setVisibleLayerSliderEnabled(false) - setGridButtonEnabled(false) - setGridVisible(false) - setAnnotationsVisible(false) These were lost during the Phase 3 compiler-to-script migration, causing BlockImage scenes to render a dark background + border frame. * fix: add PLACEHOLDER_STYLE to 7 invisible placeholder compilers Category, Special, StructureView, SubPages, ItemGrid, KeyBind, PlayerName placeholders now show amber italic "[TagName]" text while scripts materialize. * fix: restore Phase 2 Category behaviors - title resolution, isWrapped, gap - Add isWrapped pattern for flow-context Category placeholders - Resolve page titles through MediaWikiPageTitleResolver (was showing raw path) - Set gap=2 on LytVBox for proper spacing between entries - Replace hardcoded error strings with GuidebookText references * fix: restore graceful image degradation with missing-texture icon When image asset is not found, still create LytImage with GuidePageTexture.missing() instead of replacing with error paragraph. FloatingImage also sets fallback title on missing images. * fix: small script regressions - normalize, viewSize, null-guard, inline, namespace - MermaidScript: restore normalize() call on loaded source - StructureScript: call setViewSize() with placeholder dimensions - CommandLinkScript: add mc.thePlayer null guard before sendChatMessage - QuestCardScript: restore createQuestLink for guide-page navigation - SubPagesScript: restore null vs empty string distinction for pageId - ItemImageScript: setInline(true), extract namespace from itemId - ItemGridScript: extract namespace from itemId instead of hardcoded minecraft * feat: Phase 3 architecture fixes - SceneViewportMetrics, pre-parsing, yield - Restore SceneViewportMetrics pure-function utility (8-corner projection, auto-size clamp) shared between BlockImageScript and SceneScript - Pre-parse Scene children markdown AST at compile time in SceneTagCompiler, eliminating MOUNT-time re-parse in SceneScript - Add timeToYield()/markComplete() to ScriptContext for async yield support - Rewrite MaterializeTask to support YIELD→re-entry, backward-compatible with existing scripts (auto-complete when no yield requested) - Make SpecialScript async with markComplete * fix: systematic Phase 2→3 regression fixes and architectural improvements Critical fixes: - SceneScript: set CURRENT_SCENE before element compilation (restores Ponder/annotations) - SceneScript: call initializePonderTimelineBaseline + captureInitialInteractiveState - BlockImageScript: restore inline NBT parsing (id="stone{...}") and registryId arg - ItemLinkScript: fallback to getDisplayName() for self-closing tags - StructureScript: add Block.blockRegistry fallback for technical blocks - ItemImageScript/ItemGridScript: apply NBT from ParsedItemRef to ItemStack High priority: - SceneScript: restore auto-zoom (85% fill) and auto-size via SceneViewportMetrics - SceneScript: restore auto-center guard logic - SubPagesCompiler: add try/catch around resolveId() - MermaidCompiler: document compileNodeContentBlocks Phase 2 limitation - SpecialScript/SubPagesScript: add isWrapped pattern - SpecialScript: replace hardcoded strings with GuidebookText - QuestLinkScript: add try/catch around BqHelpers.resolveDisplay - CommandLinkScript: restore FMLLog logging - CategoryScript: use MediaWikiGeneratedListBlock via MediaWikiTagCompilerSupport - ItemImageCompiler: add ore attribute support to placeholder Architectural: - LytFlowInlineBlock: add centralized unwrapPlaceholder() utility - SceneTagCompiler: store element compilers in placeholder (removes hardcoded DefaultExtensions) - LytHost: two-phase dispatchMountEvents (sync first, then async) - Index methods: document Phase 2→3 indexing limitations - MediaWikiListPlanner: simplified column distribution algorithm - GuideScreen: add null guard in handleKeyboardInput * fix: systematic Phase 2→3 regression fixes and architectural improvements Critical fixes: - SceneScript: set CURRENT_SCENE before element compilation (restores Ponder/annotations) - SceneScript: call initializePonderTimelineBaseline + captureInitialInteractiveState - BlockImageScript: restore inline NBT parsing (id="stone{...}") and registryId arg - ItemLinkScript: fallback to getDisplayName() for self-closing tags - StructureScript: add Block.blockRegistry fallback for technical blocks - ItemImageScript/ItemGridScript: apply NBT from ParsedItemRef to ItemStack High priority: - SceneScript: restore auto-zoom (85% fill) and auto-size via SceneViewportMetrics - SceneScript: restore auto-center guard logic - SubPagesCompiler: add try/catch around resolveId() - MermaidCompiler: document compileNodeContentBlocks Phase 2 limitation - SpecialScript/SubPagesScript: add isWrapped pattern - SpecialScript: replace hardcoded strings with GuidebookText - QuestLinkScript: add try/catch around BqHelpers.resolveDisplay - CommandLinkScript: restore FMLLog logging - CategoryScript: use MediaWikiGeneratedListBlock via MediaWikiTagCompilerSupport - ItemImageCompiler: add ore attribute support to placeholder Architectural: - LytFlowInlineBlock: add centralized unwrapPlaceholder() utility - SceneTagCompiler: store element compilers in placeholder (removes hardcoded DefaultExtensions) - LytHost: two-phase dispatchMountEvents (sync first, then async) - Index methods: document Phase 2→3 indexing limitations - MediaWikiListPlanner: simplified column distribution algorithm - GuideScreen: add null guard in handleKeyboardInput * fix: height-weighted column distribution with binary search Replace ceil(N/C) entry-based distribution with binary search on pixel heights that accounts for group header overhead (SECTION_GAP + HEADER + ROW). Minimizes variance across columns while preserving group/sort order. * fix: height-weighted column distribution with binary search Replace ceil(N/C) entry-based distribution with binary search on pixel heights that accounts for group header overhead (SECTION_GAP + HEADER + ROW). Minimizes variance across columns while preserving group/sort order. * fix: register MOUNT-time scenes for Ponder tick dispatch - registerRuntimeScenes() scans document tree for LytGuidebookScene instances and registers them in GuidePage.scenes() for tick dispatch - Called at the start of tickCurrentPageScenes() so async-created scenes (SceneScript MaterializeTask) are picked up on the next tick - Adds Ponder debug logging for button click/toggle/tick state * fix: register MOUNT-time scenes for Ponder tick dispatch - registerRuntimeScenes() scans document tree for LytGuidebookScene instances and registers them in GuidePage.scenes() for tick dispatch - Called at the start of tickCurrentPageScenes() so async-created scenes (SceneScript MaterializeTask) are picked up on the next tick - Adds Ponder debug logging for button click/toggle/tick state * fix: restore deep search indexing for Category and Special pages CategoryCompiler.index() and SpecialCompiler.index() now resolve category/special page member titles at indexing time and index them for full-text search, matching Phase 2 behavior. * fix: restore deep search indexing for Category and Special pages CategoryCompiler.index() and SpecialCompiler.index() now resolve category/special page member titles at indexing time and index them for full-text search, matching Phase 2 behavior. * fix: pass sourcePack through ScenePlaceholder to runtime PageCompiler Add getSourcePack() to PageCompiler, store sourcePack in ScenePlaceholder, and use it in SceneScript's runtime compiler instead of empty string. * fix: pass sourcePack through ScenePlaceholder to runtime PageCompiler Add getSourcePack() to PageCompiler, store sourcePack in ScenePlaceholder, and use it in SceneScript's runtime compiler instead of empty string. * fix: wire real ExtensionCollection, annotation tooltip dispatch, BlockStats - Use guide's ExtensionCollection instead of EMPTY for runtime compiler - Dispatch MOUNT events into annotation ContentTooltip subtrees - Apply implicit BlockStats for scenes without explicit BlockStats element - Handle BlockStats element attributes (visible, buttonEnabled) - Add docs for StructureLib selection listeners and scene cache limitations * fix: wire real ExtensionCollection, annotation tooltip dispatch, BlockStats - Use guide's ExtensionCollection instead of EMPTY for runtime compiler - Dispatch MOUNT events into annotation ContentTooltip subtrees - Apply implicit BlockStats for scenes without explicit BlockStats element - Handle BlockStats element attributes (visible, buttonEnabled) - Add docs for StructureLib selection listeners and scene cache limitations * fix: log NBT parse failures in BlockImageScript instead of silently ignoring * fix: log NBT parse failures in BlockImageScript instead of silently ignoring * refactor: unify duplicate resolveItemId with IdUtils.resolveItemStack Both ItemImageScript and ItemGridScript had identical 18-line resolveItemId() implementations. Replaced with the shared IdUtils.resolveItemStack() utility. * refactor: unify duplicate resolveItemId with IdUtils.resolveItemStack Both ItemImageScript and ItemGridScript had identical 18-line resolveItemId() implementations. Replaced with the shared IdUtils.resolveItemStack() utility. * fix: Mermaid mindmap NodeContent BlockImage rendering and zoom - Fix CameraSettings.setZoom() to mark projection dirty instead of view - Add sceneViewportOverride to LytGuidebookScene for per-frame GL viewport control - Remove ResponsiveVisualSizing.scaleWidth from canvas preferredWidth to match toolbar - Scale scene viewport with mindmap zoom while locking camera viewport to original size - Position scene at contentViewport coordinates for correct 3D viewport placement * fix: Mermaid mindmap NodeContent BlockImage rendering and zoom - Fix CameraSettings.setZoom() to mark projection dirty instead of view - Add sceneViewportOverride to LytGuidebookScene for per-frame GL viewport control - Remove ResponsiveVisualSizing.scaleWidth from canvas preferredWidth to match toolbar - Scale scene viewport with mindmap zoom while locking camera viewport to original size - Position scene at contentViewport coordinates for correct 3D viewport placement * fix: sprite UV drift and LaTeX rendering in Mermaid NodeContent - Override blitGuiSprite in NodeContentRenderContext to use GL scale for display size while keeping UV range fixed to sprite dimensions - Add raw-GL rendering path for LytLatexBlock / LytLatexDisplayBlock that applies mindmap zoom via GL matrix transforms * fix: sprite UV drift and LaTeX rendering in Mermaid NodeContent - Override blitGuiSprite in NodeContentRenderContext to use GL scale for display size while keeping UV range fixed to sprite dimensions - Add raw-GL rendering path for LytLatexBlock / LytLatexDisplayBlock that applies mindmap zoom via GL matrix transforms * fix: F3+T cache gaps, editor preview placeholders, SceneScript camera centering - Clear GuideLatexTextureCache, GuideSceneStructureCache, and 5 StructureLibBoundedCache instances on F3+T resource reload - Dispatch MOUNT events to editor preview document so async scripts materialize placeholder blocks in the guide editor split view - Reorder SceneScript camera setup to zoom -> size -> center and restore offset save/restore logic, matching Phase 2 SceneTagCompiler * fix: F3+T cache gaps, editor preview placeholders, SceneScript camera centering - Clear GuideLatexTextureCache, GuideSceneStructureCache, and 5 StructureLibBoundedCache instances on F3+T resource reload - Dispatch MOUNT events to editor preview document so async scripts materialize placeholder blocks in the guide editor split view - Reorder SceneScript camera setup to zoom -> size -> center and restore offset save/restore logic, matching Phase 2 SceneTagCompiler * fix: raw-GL blocks not rendering in Mermaid NodeContent under zoom - Add blitGuiSprite override in NodeContentRenderContext to keep sprite UV fixed while scaling display via GL matrix (prevents atlas bleed) - Add usesRawGl() helper detecting blocks that bypass RenderContext - Apply GL matrix transforms (translate + scale) for LaTeX, ItemImage, and NEI recipe blocks that render with raw OpenGL calls * fix: raw-GL blocks not rendering in Mermaid NodeContent under zoom - Add blitGuiSprite override in NodeContentRenderContext to keep sprite UV fixed while scaling display via GL matrix (prevents atlas bleed) - Add usesRawGl() helper detecting blocks that bypass RenderContext - Apply GL matrix transforms (translate + scale) for LaTeX, ItemImage, and NEI recipe blocks that render with raw OpenGL calls * style: spotless formatting cleanup in scripts and compiler - Remove unused imports, reorder imports, wrap long lines - Split chained method calls across lines for readability * style: spotless formatting cleanup in scripts and compiler - Remove unused imports, reorder imports, wrap long lines - Split chained method calls across lines for readability * sa * sa * Update PageCompiler.java * Update PageCompiler.java * fix logo bug * fix logo bug * fix inline code * fix inline code * opti * opti * Update GuideScreen.java * Update GuideScreen.java * add GuideScreenScrollbarOutline * add GuideScreenScrollbarOutline * fix blockquote directive text stripping * fix task list item remaining text propagation * fix LytListItem missing from float-aware wrapping * fix page cache not cleared on guide reload * fix keybind and player name placeholder style leak * fix Mermaid parser HTML tag stripping * fix Mermaid canvas Scene integration * fix Scene button zoom consistency * stop tracking CLAUDE.md * sa * bugfix * move logs * refactor code highlighting * unify Scene rendering through RenderContext coordinate system All Scene rendering now uses layout coordinates exclusively, with coordinate conversion handled by the context — no manual screen-space computation. - NodeContentRenderContext.toScreenRect: chain through delegate to include documentOrigin and scrollOffset, returning absolute screen coordinates - Scene: remove instanceof LytGuidebookScene special case from Mermaid canvas, render through generic block.render(nodeContext) path - Scene: camera viewport defaults to sceneW/sceneH (cameraViewportOverride retained only for offscreen export callers) - Scene buttons, ponder controls, slider tracks: all raw GL parts wrapped in conditional GL transform (push/pop only for non-VanillaRenderContext) - Slider render path: separate layout-space rects (resolveSliderTrackLayoutRect) from screen-space hit-test rects - VanillaRenderContext.toScreenRect: scale dimensions by zoom All drawSceneButtons, drawPonderControls, drawSlider, and resolveSliderTrackRect now use layout coordinates. Hover detection uses context.toScreenRect() to convert layout to screen coords before comparing against mouseX/mouseY. * add beginLocalView/endLocalView to RenderContext, clean up ponder coordinate mixing - RenderContext: add beginLocalView()/endLocalView() default no-ops - NodeContentRenderContext: override to push GL translate+scale for raw GL - drawSceneButtons, drawPonderControls, drawSlider: use context.beginLocalView() instead of instanceof VanillaRenderContext check + manual pushGlTransform - drawPonderControls: use context.toScreenRect() for all screen-space hit-test coordinates instead of manual lastDocZoom multiplication - drawPonderKeyframeNodes: pass context+scale for hover via toScreenRect - Overlay rendering: pass screen-space viewport to o.render(), keep scissor separate via pushLocalScissor(sceneRect) - Store cachedPonderBtnScreenW/H from toScreenRect for ponderButtonAt and containsPonderButtons * add content tabs * opti * change content tabs block * add content tab title * opti * use guide debug log * bugfix * bugfix * sa * bugfix * bugfix * bugfix * bugfix * remove unused lang * opti * add color & dynamic tooltip integration * add back and forward hotkey --------- Co-authored-by: ABKQPO <93412322+ABKQPO@users.noreply.github.com>
YannickMG
approved these changes
Jun 7, 2026
YannickMG
left a comment
There was a problem hiding this comment.
Pretty sure it's usual policy for this type of mods to leave the original author free reign to make changes, basically like MUI2.
Anyway what's a beta without a little excitement? We can't ship the guide without this.
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.