Repository navigation
fix(tree_renderer): truncate overlong node titles in summary headings - #167
Closed
designcomputer wants to merge 1 commit into
Closed
designcomputer wants to merge 1 commit into
designcomputer wants to merge 1 commit into
Conversation
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.
Problem
PageIndex's no-TOC fallback structure generator sometimes copies an entire source sentence verbatim into a node's
titlewhen there's no natural short heading to extract (see VectifyAI/PageIndex#341).render_summary_mdrenders that title directly as a Markdown heading, producing unreadable, multi-line headings inwiki/summaries/*.md— e.g.:Fix
Add
_short_title(): titles over 80 chars are truncated with…when rendered as a heading. Only affects display in the summary — the full title still comes through from the underlying PageIndex tree unmodified.Testing
Added two tests to
tests/test_tree_renderer.py(overlong title truncates with ellipsis; short titles pass through unchanged). Full suite (928 tests after these additions) passes;ruff format,ruff check, andmypy openkb/tree_renderer.pyare clean.Found and verified while investigating PageIndex long-doc rendering quality for a real knowledge base — see the sibling PRs for two related fixes to the same renderer (duplicate summary collapsing, source-text rendering) plus a follow-up for embedded images (#166).