fix(frontend): rework chunking debug UX in KB editor
The chunking debug panel was an inline section that crowded the
strategy form, broke its own layout with negative margins, and crashed
on result.rejected being null. The trigger button required scrolling to
the form's bottom to reach.
- Move debug into a right-side t-drawer pinned above the modal stacking
context (attach=body, z-index 3000) so it overlays cleanly.
- Promote the trigger to a sticky header sibling next to the section
title, with right padding to clear the modal close button.
- Replace unicode arrows / + / − with tdesign-icons (Chevron, Play,
ErrorCircle) and rebuild the result layout: pill-shaped breadcrumb
tags, line-clamped previews with gradient fade on collapse, ordered
chunk list, structured error block.
- Drop custom char counter (t-textarea already has one).
- Add four sample fixtures (markdown / faq / chapter / plain) loadable
as preset chips so users have realistic content to test against.
- Guard `result.rejected` nullability that crashed the panel.
- Normalize the recursive tier label to legacy in the UI since both
tiers behave identically — pairs with the backend cleanup.
- Rename strategy labels in zh-CN/en-US/ko-KR/ru-RU from internal jargon
("auto", "heading", "heuristic", "legacy") to descriptive names
("Automatic", "Heading-aware", "Structure-aware", "Length-based") and
add presetLabel + sample i18n keys.
This commit is contained in:
@@ -1924,20 +1924,20 @@ export default {
|
||||
strategyPlaceholder: 'Select strategy (defaults to classic recursive splitting)',
|
||||
strategies: {
|
||||
auto: {
|
||||
label: 'Automatic (recommended)',
|
||||
tooltip: 'A document profiler analyzes structure and picks heading-aware, smart-detection or classic splitting per upload.'
|
||||
label: 'Automatic',
|
||||
tooltip: 'A document profiler picks between heading-aware, structure-aware and length-based splitting per upload.'
|
||||
},
|
||||
heading: {
|
||||
label: 'Markdown-optimized',
|
||||
tooltip: 'Splits primarily at Markdown headings (#, ##, ###). Best for clean Markdown with explicit section structure.'
|
||||
label: 'Heading-aware',
|
||||
tooltip: 'Splits at Markdown heading boundaries (#, ##, ###); each chunk carries its heading path. Best for well-structured Markdown.'
|
||||
},
|
||||
heuristic: {
|
||||
label: 'Smart structure detection',
|
||||
tooltip: 'Detects page-breaks, numbered sections, multilingual chapter markers (DE/EN/ZH), all-caps titles. Ideal for PDFs without proper Markdown.'
|
||||
label: 'Structure-aware',
|
||||
tooltip: 'Splits on detected structural cues: page-breaks, numbered sections, multilingual chapter markers (DE/EN/ZH), all-caps titles. Ideal for PDFs without Markdown headings.'
|
||||
},
|
||||
legacy: {
|
||||
label: 'Classic',
|
||||
tooltip: 'Classic recursive splitting on separators only — the original behavior. Use this if the new strategies misbehave on your content.'
|
||||
label: 'Length-based',
|
||||
tooltip: 'Ignores structure; splits recursively by character count and separators — the original behavior. Use when the structure-aware strategies misbehave on your content.'
|
||||
}
|
||||
},
|
||||
overlapWarning: 'Overlap is large compared to chunk size — chunks will share most of their content.',
|
||||
@@ -1957,6 +1957,13 @@ export default {
|
||||
toggleHint: 'Run the chunker against sample text without re-uploading',
|
||||
sampleLabel: 'Sample text',
|
||||
samplePlaceholder: 'Paste a Markdown / plain-text snippet to see how the current configuration would chunk it…',
|
||||
presetLabel: 'Load sample:',
|
||||
samples: {
|
||||
markdown: 'Markdown doc',
|
||||
faq: 'FAQ list',
|
||||
chapter: 'PDF chapters',
|
||||
plain: 'Plain prose'
|
||||
},
|
||||
runButton: 'Run preview',
|
||||
loading: 'Running chunker on sample…',
|
||||
errorPrefix: 'Preview failed',
|
||||
|
||||
Reference in New Issue
Block a user