Repository navigation
Conversation
- onTreeSelect passed (start, end - start) to setSelectionOffsets, which expects absolute (start, end); selecting a field highlighted the wrong bytes. Pass (start, end) to match navigate(). - Render empty value/offset cells as blank instead of the literal 'None'. - Show offsets as compact 0x-prefixed hex instead of zero-padded 8 digits, and sort the start/end columns numerically (KaitaiTreeWidgetItem) so dropping the padding doesn't break ordering. - Guard onTreeSelect against blank offset cells (ValueError on int()). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a Kaitai-IDE-style workflow: edit a .ksy in a new editor pane, compile it on the fly, and reparse the current file with the result. kshelpers: - compile_ksy(): write source to a temp dir and invoke kaitai-struct-compiler with --debug (needed for the start/end offsets the tree-builder relies on). - find_compiler()/login_shell_path(): resolve the compiler via the login shell's PATH, since GUI apps don't inherit it. - load_ksy_class(): (re)load a freshly compiled module so edits take effect. - parse_io_view_with_class(): parse with an explicit class, bypassing magic inference. view: - third splitter pane with a .ksy editor, Compile & Parse button, status line. - construct_view() accepts a ks_class and records (start, end, item) intervals. - hex->tree sync: clicking a byte selects the smallest containing field via navigate()/setCurrentOffset(), with a _syncing guard against feedback loops. test/: a small demo format, generator, and sample binary for exercising the live-compile path end to end. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The editor pane now tracks which format is driving the tree (built-in, file, or editor) and whether the editor text matches what was last compiled. Adds Load/Save buttons bound to a .ksy path, a lock toggle that keeps the editor read-only by default, and makes construct_view report success so a compile that parses nothing is surfaced instead of silently leaving the old tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
xusheng6
marked this pull request as draft
July 28, 2026 18:59
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.
Turns the Kaitai view into a small IDE for
.ksyformats..ksyeditor pane compiles the source and reparses the current file in place, so format development is iterative instead of round-tripping through disk and a plugin reload..ksypath; Save writes back to it, Load pulls a format in from disk.construct_viewnow reports success, so a format that compiles but parses nothing is surfaced instead of silently leaving the previous tree in place.🤖 Generated with Claude Code