Skip to content

Feat: Render the skills list using a tree view. - #17115

Merged
yingfeng merged 7 commits into
infiniflow:mainfrom
cike8899:feat-structure-wiki
Jul 20, 2026
Merged

yingfeng merged 7 commits into
infiniflow:mainfrom
cike8899:feat-structure-wiki

Conversation

@cike8899

Copy link
Copy Markdown
Contributor

Summary

Feat: Render the skills list using a tree view.

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code labels Jul 20, 2026
@cike8899 cike8899 added the ci Continue Integration label Jul 20, 2026
@cike8899
cike8899 marked this pull request as draft July 20, 2026 10:04
@cike8899
cike8899 marked this pull request as ready for review July 20, 2026 10:04
@dosubot dosubot Bot added the 💞 feature Feature request, pull request that fullfill a new feature. label Jul 20, 2026
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR reorganizes dataset compilation into separate LLM wiki and skills views, adds hierarchical skill deletion, removes compilation-template parser fields, simplifies template editing, and applies several UI and developer-tooling adjustments.

Changes

Compilation views and skill management

Layer / File(s) Summary
Compilation view shell
web/src/pages/dataset/compilation/*, web/src/pages/dataset/dataset/generate-button/hook.ts
Compilation now switches between LLM wiki and skills views, with graph mode removed and trace types mapped centrally.
LLM wiki and skills views
web/src/pages/dataset/compilation/llm-wiki-view.tsx, web/src/pages/dataset/compilation/skills-view.tsx, web/src/pages/dataset/compilation/loading-card.tsx
New view components fetch their own data, handle loading and empty states, invalidate caches after generation, and render resizable layouts.
Hierarchical skills UI
web/src/pages/dataset/compilation/skills-left-panel.tsx, web/src/pages/dataset/compilation/utils/skill-tree.ts
Skills are converted, filtered, counted, and rendered as a searchable tree with per-node actions.
Skill deletion requests
web/src/utils/api.ts, web/src/services/dataset-skill-service.ts, web/src/hooks/use-dataset-skill-request.ts
Tree and page deletion endpoints, service methods, mutation hooks, success messages, and cache invalidation are added.
Compilation labels and navigation
web/src/locales/*.ts, web/src/pages/dataset/sidebar/index.tsx, web/src/pages/chunk/.../document-view-switch/index.tsx
Navigation and artifact-related labels are updated in English and Chinese.

Estimated code review effort: 4 (Complex) | ~45 minutes

Parser template removal

Layer / File(s) Summary
Parser configuration cleanup
web/src/components/chunk-method-dialog/*, web/src/pages/dataset/dataset-setting/*
Compilation template group fields are removed from parser schemas, defaults, and configuration UI.
Compilation template selector simplification
web/src/components/compilation-template-form-field.tsx, web/src/pages/agent/form/compilation-form/index.tsx
Template selection uses a simple searchable selector, and the compilation form accepts one optional template group identifier.

Template editor changes

Layer / File(s) Summary
Template editor validation and field controls
web/src/pages/user-setting/compilation-templates/create-next/{schema.ts,components/*}
Template names are required, custom field types are allowed, and add-field controls are always available.
Template editor textareas
web/src/pages/user-setting/compilation-templates/create-next/components/*
Description and global-rules textareas receive updated row counts and vertical resizing.

Sequence Diagram(s)

sequenceDiagram
  participant DatasetCompilation
  participant LlmWikiView
  participant SkillsView
  participant ReactQueryCache
  DatasetCompilation->>LlmWikiView: render LLM wiki view
  DatasetCompilation->>SkillsView: render skills view
  LlmWikiView->>ReactQueryCache: fetch artifact topics and trace data
  LlmWikiView->>ReactQueryCache: invalidate artifact caches after completion
  SkillsView->>ReactQueryCache: fetch skills and trace data
  SkillsView->>ReactQueryCache: invalidate skills cache after completion
Loading

Possibly related PRs

Poem

A bunny hops through wiki and tree,
With templates trimmed neatly.
Skills can vanish with a click,
Caches refresh—quick, quick, quick!
“Artifacts!” sings the hare with glee.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the main change: rendering the skills list with a tree view.
Description check ✅ Passed The description includes the required Summary section and is aligned with the PR’s purpose, though it is brief.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/pages/dataset/compilation/index.tsx (1)

49-68: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

"To Skills" button label is not translated.

Line 62 hardcodes To Skills, while the sibling button on line 55 uses t('knowledgeDetails.llmWiki'). This will leave the toggle untranslated for non-English locales even though the rest of the header is localized.

🌐 Proposed fix
             <Button
               variant={viewMode === ViewMode.Skills ? 'default' : 'outline'}
               size="sm"
               onClick={handleSwitchToSkills}
             >
-              To Skills
+              {t('knowledgeDetails.toSkills')}
             </Button>

As per coding guidelines, web/src/locales/{zh,en}.ts: "For translation tasks, add keys only to explicitly requested language files; commonly these are src/locales/zh.ts and src/locales/en.ts." Add the corresponding key to both locale files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/compilation/index.tsx` around lines 49 - 68, Replace
the hardcoded “To Skills” label in the Skills toggle button near
handleSwitchToSkills with the translation helper, and add the corresponding
translation key to both web/src/locales/en.ts and web/src/locales/zh.ts. Keep
the existing llmWiki translation pattern and button behavior unchanged.

Source: Coding guidelines

🧹 Nitpick comments (2)
web/src/components/compilation-template-form-field.tsx (1)

12-22: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Drop the fallback name prop.
CompilationTemplateFormField is only called once, and that caller passes name="compilation_template_group_ids" explicitly. Make name required and remove the stale parser_config.compilation_template_group_id default.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/compilation-template-form-field.tsx` around lines 12 - 22,
Update CompilationTemplateFormFieldProps and the CompilationTemplateFormField
signature to require name, removing the default
parser_config.compilation_template_group_id fallback. Preserve the existing
explicit name="compilation_template_group_ids" usage at its caller.
web/src/utils/api.ts (1)

177-183: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate URL-building logic between GET and DELETE variants.

deleteDatasetSkillTree/deleteDatasetSkillPage duplicate the exact same string-building logic as getDatasetSkillTree/getDatasetSkillPage just above. Since both HTTP verbs hit the same URL, reuse a single builder to avoid the two copies drifting apart later.

♻️ Proposed fix
+const buildDatasetSkillTreeUrl = (datasetId: string) =>
+  `${restAPIv1}/datasets/${datasetId}/skills`;
+const buildDatasetSkillPageUrl = (datasetId: string, skillKwd: string) =>
+  `${restAPIv1}/datasets/${datasetId}/skills/${skillKwd
+    .split('/')
+    .map((s) => encodeURIComponent(s))
+    .join('/')}`;
+
 ...
-  getDatasetSkillTree: (datasetId: string) =>
-    `${restAPIv1}/datasets/${datasetId}/skills`,
-  getDatasetSkillPage: (datasetId: string, skillKwd: string) =>
-    `${restAPIv1}/datasets/${datasetId}/skills/${skillKwd
-      .split('/')
-      .map((s) => encodeURIComponent(s))
-      .join('/')}`,
-  deleteDatasetSkillTree: (datasetId: string) =>
-    `${restAPIv1}/datasets/${datasetId}/skills`,
-  deleteDatasetSkillPage: (datasetId: string, skillKwd: string) =>
-    `${restAPIv1}/datasets/${datasetId}/skills/${skillKwd
-      .split('/')
-      .map((s) => encodeURIComponent(s))
-      .join('/')}`,
+  getDatasetSkillTree: buildDatasetSkillTreeUrl,
+  getDatasetSkillPage: buildDatasetSkillPageUrl,
+  deleteDatasetSkillTree: buildDatasetSkillTreeUrl,
+  deleteDatasetSkillPage: buildDatasetSkillPageUrl,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/utils/api.ts` around lines 177 - 183, Reuse the existing
getDatasetSkillTree and getDatasetSkillPage URL builders for
deleteDatasetSkillTree and deleteDatasetSkillPage instead of duplicating their
template and skillKwd encoding logic. Keep the DELETE functions’ signatures and
resulting URLs unchanged so both HTTP verbs share one source of truth.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/components/compilation-template-form-field.tsx`:
- Around line 32-35: Enable clearing for the optional template-group selection
by passing the appropriate allow-clear option to SelectWithSearch in the
compilation template form field. Preserve the existing value, change handler,
and options behavior so users can unset a previously selected group back to
none.

In `@web/src/components/markdown-editor.tsx`:
- Around line 24-26: Update the useEffect in the markdown editor so that after
determining content differs from contentRef.current, it assigns the new content
prop to contentRef.current before continuing. Preserve the existing early return
for matching content and ensure toggleSource reads the latest prop value.

In `@web/src/pages/agent/form/compilation-form/index.tsx`:
- Around line 18-21: Normalize compilation_template_group_ids consistently
between initialCompilationValues, useFormValues hydration/reset handling, and
FormSchema: either convert legacy arrays to the single selected ID before form
values are loaded, or change the schema and UI to use arrays throughout. Ensure
both initial and node-derived values share the same shape and persistence
remains consistent.

In `@web/src/pages/dataset/compilation/skills-left-panel.tsx`:
- Around line 38-78: Update SkillDeleteAction and the delete-all trigger so both
icon-only buttons remain keyboard focusable without relying on hidden display
styles, and provide descriptive aria-label values using the existing translation
symbols. Preserve hover-based visual behavior while ensuring focused buttons are
visible and screen-reader accessible, and keep the existing delete click
handling intact.

In `@web/src/pages/dataset/sidebar/index.tsx`:
- Line 71: Restore localization for both artifact labels: in
web/src/pages/dataset/sidebar/index.tsx:71, use the existing locale-backed
plural “Artifacts” translation, and in
web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/document-view-switch/index.tsx:73,
use the existing locale-backed singular “Artifact” translation. Reuse the
established translation hook or locale keys rather than hardcoded English
strings.

---

Outside diff comments:
In `@web/src/pages/dataset/compilation/index.tsx`:
- Around line 49-68: Replace the hardcoded “To Skills” label in the Skills
toggle button near handleSwitchToSkills with the translation helper, and add the
corresponding translation key to both web/src/locales/en.ts and
web/src/locales/zh.ts. Keep the existing llmWiki translation pattern and button
behavior unchanged.

---

Nitpick comments:
In `@web/src/components/compilation-template-form-field.tsx`:
- Around line 12-22: Update CompilationTemplateFormFieldProps and the
CompilationTemplateFormField signature to require name, removing the default
parser_config.compilation_template_group_id fallback. Preserve the existing
explicit name="compilation_template_group_ids" usage at its caller.

In `@web/src/utils/api.ts`:
- Around line 177-183: Reuse the existing getDatasetSkillTree and
getDatasetSkillPage URL builders for deleteDatasetSkillTree and
deleteDatasetSkillPage instead of duplicating their template and skillKwd
encoding logic. Keep the DELETE functions’ signatures and resulting URLs
unchanged so both HTTP verbs share one source of truth.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eaff422e-1618-4081-8abd-1b8ac4d0f196

📥 Commits

Reviewing files that changed from the base of the PR and between aff9ff6 and 352961b.

📒 Files selected for processing (33)
  • web/CLAUDE.md
  • web/src/components/chunk-method-dialog/index.tsx
  • web/src/components/chunk-method-dialog/use-default-parser-values.ts
  • web/src/components/compilation-template-form-field.tsx
  • web/src/components/markdown-editor.tsx
  • web/src/hooks/use-dataset-skill-request.ts
  • web/src/locales/en.ts
  • web/src/locales/zh.ts
  • web/src/main.tsx
  • web/src/pages/agent/canvas/node/dropdown/accordion-operators.tsx
  • web/src/pages/agent/form/compilation-form/index.tsx
  • web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/document-view-switch/index.tsx
  • web/src/pages/dataset/compilation/constants.ts
  • web/src/pages/dataset/compilation/hooks/use-compilation-view.ts
  • web/src/pages/dataset/compilation/index.tsx
  • web/src/pages/dataset/compilation/knowledge-force-graph.tsx
  • web/src/pages/dataset/compilation/llm-wiki-view.tsx
  • web/src/pages/dataset/compilation/loading-card.tsx
  • web/src/pages/dataset/compilation/skills-left-panel.tsx
  • web/src/pages/dataset/compilation/skills-view.tsx
  • web/src/pages/dataset/compilation/utils/skill-tree.ts
  • web/src/pages/dataset/dataset-setting/configuration/naive.tsx
  • web/src/pages/dataset/dataset-setting/form-schema.ts
  • web/src/pages/dataset/dataset-setting/index.tsx
  • web/src/pages/dataset/dataset/generate-button/hook.ts
  • web/src/pages/dataset/sidebar/index.tsx
  • web/src/pages/user-setting/compilation-templates/create-next/components/add-field-modal.tsx
  • web/src/pages/user-setting/compilation-templates/create-next/components/basic-info-step.tsx
  • web/src/pages/user-setting/compilation-templates/create-next/components/section-field-grid.tsx
  • web/src/pages/user-setting/compilation-templates/create-next/components/template-configuration.tsx
  • web/src/pages/user-setting/compilation-templates/create-next/schema.ts
  • web/src/services/dataset-skill-service.ts
  • web/src/utils/api.ts
💤 Files with no reviewable changes (8)
  • web/src/pages/dataset/dataset-setting/form-schema.ts
  • web/src/pages/dataset/dataset-setting/index.tsx
  • web/src/components/chunk-method-dialog/use-default-parser-values.ts
  • web/src/pages/dataset/dataset-setting/configuration/naive.tsx
  • web/src/pages/dataset/compilation/constants.ts
  • web/src/pages/dataset/compilation/knowledge-force-graph.tsx
  • web/src/components/chunk-method-dialog/index.tsx
  • web/src/pages/dataset/compilation/hooks/use-compilation-view.ts

Comment on lines +32 to +35
<SelectWithSearch
value={field.value}
onChange={field.onChange}
options={options}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Optional field can't be cleared once set.

The paired schema field is optional, but SelectWithSearch defaults allowClear to false and it isn't overridden here, so once a template group is selected there's no UI affordance to unset it back to "none." The prior multi-select allowed deselecting; this is a UX regression.

🛠️ Proposed fix
       {(field) => (
         <SelectWithSearch
           value={field.value}
           onChange={field.onChange}
           options={options}
+          allowClear
         />
       )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<SelectWithSearch
value={field.value}
onChange={field.onChange}
options={options}
<SelectWithSearch
value={field.value}
onChange={field.onChange}
options={options}
allowClear
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/compilation-template-form-field.tsx` around lines 32 - 35,
Enable clearing for the optional template-group selection by passing the
appropriate allow-clear option to SelectWithSearch in the compilation template
form field. Preserve the existing value, change handler, and options behavior so
users can unset a previously selected group back to none.

Comment on lines +24 to +26
if (content === contentRef.current) {
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Update contentRef.current to track new content from props.

The useEffect correctly early-returns when the content prop matches contentRef.current to avoid clobbering local edits. However, when they do differ (e.g., when the parent loads new data asynchronously), contentRef.current is never updated.

This causes a bug when switching to the source view: toggleSource will copy the stale contentRef.current value into the raw editor, resulting in an empty or outdated source view.

🐛 Proposed fix to update the ref when content changes
   useEffect(() => {
     if (content === contentRef.current) {
       return;
     }
+    contentRef.current = content;
     if (showSource) setRawContent(content);
   }, [showSource, content]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (content === contentRef.current) {
return;
}
if (content === contentRef.current) {
return;
}
contentRef.current = content;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/markdown-editor.tsx` around lines 24 - 26, Update the
useEffect in the markdown editor so that after determining content differs from
contentRef.current, it assigns the new content prop to contentRef.current before
continuing. Preserve the existing early return for matching content and ensure
toggleSource reads the latest prop value.

Comment on lines 18 to 21
export const FormSchema = z.object({
compilation_template_group_ids: z.array(z.string()).optional(),
compilation_template_group_ids: z.string().optional(),
...LlmSettingSchema,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether this field previously used an array shape elsewhere (e.g. saved fixtures, backend node schema)
rg -n 'compilation_template_group_ids' --type=ts --type=tsx

Repository: infiniflow/ragflow

Length of output: 184


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== occurrences =="
rg -n "compilation_template_group_ids" .

echo
echo "== relevant file outlines =="
ast-grep outline web/src/pages/agent/form/compilation-form/index.tsx --view expanded || true
ast-grep outline web/src/components/compilation-template-form-field.tsx --view expanded || true

echo
echo "== inspect compilation form =="
sed -n '1,220p' web/src/pages/agent/form/compilation-form/index.tsx | cat -n

echo
echo "== inspect compilation template field =="
sed -n '1,220p' web/src/components/compilation-template-form-field.tsx | cat -n

echo
echo "== search for defaultValues / hydration paths =="
rg -n "defaultValues|reset\\(|setValue\\(|compilation_template_group_ids" web/src/pages web/src/components web/src/hooks web/src/utils

Repository: infiniflow/ragflow

Length of output: 50374


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== pipeline default =="
sed -n '340,390p' web/src/pages/agent/constant/pipeline.tsx | cat -n

echo
echo "== use-form-values =="
sed -n '1,120p' web/src/pages/agent/hooks/use-form-values.ts | cat -n

echo
echo "== validation utils normalization =="
sed -n '430,490p' api/utils/validation_utils.py | cat -n

echo
echo "== document api normalization helpers =="
sed -n '1,130p' api/apps/restful_apis/document_api.py | cat -n

echo
echo "== compiler python schema/comments =="
sed -n '1,90p' rag/flow/compiler/compiler.py | cat -n

Repository: infiniflow/ragflow

Length of output: 15466


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== agent form watcher =="
sed -n '1,220p' web/src/pages/agent/hooks/use-watch-form-change.ts | cat -n

echo
echo "== agent form value plumbing =="
sed -n '1,220p' web/src/pages/agent/form/compilation-form/index.tsx | cat -n

echo
echo "== select-with-search value contract =="
sed -n '1,260p' web/src/components/originui/select-with-search.tsx | cat -n

echo
echo "== any normalization for compilation template group ids in web =="
rg -n "compilation_template_group_id|compilation_template_group_ids" web/src | sed -n '1,200p'

Repository: infiniflow/ragflow

Length of output: 13664


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== agent form watcher =="
sed -n '1,220p' web/src/pages/agent/hooks/use-watch-form-change.ts | cat -n

echo
echo "== select-with-search value contract =="
sed -n '1,260p' web/src/components/originui/select-with-search.tsx | cat -n

echo
echo "== web-side normalization / uses =="
rg -n "compilation_template_group_id|compilation_template_group_ids" web/src | sed -n '1,240p'

Repository: infiniflow/ragflow

Length of output: 11353


Normalize compilation_template_group_ids before hydrating this form. initialCompilationValues still seeds it as [], and useFormValues passes node data through unchanged, so this schema/UI split can hydrate the select with the wrong shape and persist inconsistent data. Convert legacy arrays to the single selected id at load/reset time, or keep the field list-shaped end to end.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agent/form/compilation-form/index.tsx` around lines 18 - 21,
Normalize compilation_template_group_ids consistently between
initialCompilationValues, useFormValues hydration/reset handling, and
FormSchema: either convert legacy arrays to the single selected ID before form
values are loaded, or change the schema and UI to use arrays throughout. Ensure
both initial and node-derived values share the same shape and persistence
remains consistent.

Comment on lines +38 to 78
function SkillDeleteAction({
skillKwd,
deleteLoading,
onDelete,
}: SkillDeleteActionProps) {
const { t } = useTranslation();

type SkillListItemProps = {
item: FlatSkillNode;
isSelected: boolean;
onSelect: (skillKwd: string) => void;
};
const handleTriggerClick = useCallback(
(e: React.MouseEvent<HTMLButtonElement>) => {
// TreeView does not guard action clicks: without this the row would
// also get selected and a branch row would toggle its accordion.
e.stopPropagation();
},
[],
);

function SkillListItem({ item, isSelected, onSelect }: SkillListItemProps) {
const handleClick = useCallback(() => {
onSelect(item.skill_kwd);
}, [item.skill_kwd, onSelect]);
const handleConfirmDelete = useCallback(() => {
onDelete(skillKwd);
}, [skillKwd, onDelete]);

return (
<li
onClick={handleClick}
className={cn(
'flex items-center gap-2 px-3 py-2 rounded-md text-sm cursor-pointer',
'text-text-secondary hover:bg-bg-base hover:text-text-primary',
isSelected && 'bg-bg-card text-text-primary',
)}
style={{ paddingLeft: `${item.depth * 16 + 12}px` }}
<ConfirmDeleteDialog
title={t('datasetSkill.deleteSkillTitle')}
content={{ title: t('datasetSkill.deleteSkillDescription') }}
onOk={handleConfirmDelete}
>
<span className="truncate">{item.skill_kwd}</span>
</li>
<Button
variant="ghost"
size="icon-sm"
disabled={deleteLoading}
onClick={handleTriggerClick}
// TreeActions keeps actions always visible on the selected row;
// hide again so the button only appears while hovering the row.
// `hidden` (not opacity-0) so no invisible click target remains.
className="hidden group-hover:inline-flex"
>
<Trash2 />
</Button>
</ConfirmDeleteDialog>
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Icon-only delete actions aren't keyboard accessible.

The row delete button is only revealed with hidden group-hover:inline-flex; hidden sets display:none, so it's not focusable and keyboard-only users can never tab to or activate it. Both this button and the "delete all" trigger are also icon-only with no aria-label; since lucide-react v1 sets aria-hidden on icons by default, screen readers get no accessible name either.

♿ Proposed fix
       <Button
         variant="ghost"
         size="icon-sm"
         disabled={deleteLoading}
         onClick={handleTriggerClick}
-        // TreeActions keeps actions always visible on the selected row;
-        // hide again so the button only appears while hovering the row.
-        // `hidden` (not opacity-0) so no invisible click target remains.
-        className="hidden group-hover:inline-flex"
+        aria-label={t('common.delete')}
+        // TreeActions keeps actions always visible on the selected row;
+        // hide again so the button only appears while hovering the row,
+        // but keep it reachable via keyboard focus.
+        className="hidden group-hover:inline-flex group-focus-within:inline-flex focus-visible:inline-flex"
       >
         <Trash2 />
       </Button>
           <Button
             variant="ghost"
             size="icon-sm"
             disabled={deleteTreeLoading}
+            aria-label={t('datasetSkill.deleteAllTitle')}
             data-testid="skills-clear-trigger"
           >

Also applies to: 161-169

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/compilation/skills-left-panel.tsx` around lines 38 -
78, Update SkillDeleteAction and the delete-all trigger so both icon-only
buttons remain keyboard focusable without relying on hidden display styles, and
provide descriptive aria-label values using the existing translation symbols.
Preserve hover-based visual behavior while ensuring focused buttons are visible
and screen-reader accessible, and keep the existing delete click handling
intact.

{
icon: <LucideBookText className="size-[1em]" />,
label: t(`knowledgeDetails.compilation`),
label: 'Artifacts',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore localization for the artifact labels.

Both changed labels bypass the existing translation system, so non-English users see English-only UI text:

  • web/src/pages/dataset/sidebar/index.tsx#L71-L71: use a locale-backed plural “Artifacts” label.
  • web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/document-view-switch/index.tsx#L73-L73: use a locale-backed “Artifact” label.
📍 Affects 2 files
  • web/src/pages/dataset/sidebar/index.tsx#L71-L71 (this comment)
  • web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/document-view-switch/index.tsx#L73-L73
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/dataset/sidebar/index.tsx` at line 71, Restore localization for
both artifact labels: in web/src/pages/dataset/sidebar/index.tsx:71, use the
existing locale-backed plural “Artifacts” translation, and in
web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/document-view-switch/index.tsx:73,
use the existing locale-backed singular “Artifact” translation. Reuse the
established translation hook or locale keys rather than hardcoded English
strings.

@yingfeng
yingfeng marked this pull request as draft July 20, 2026 10:54
@yingfeng
yingfeng marked this pull request as ready for review July 20, 2026 10:54
@yingfeng
yingfeng marked this pull request as draft July 20, 2026 10:54
@yingfeng
yingfeng marked this pull request as ready for review July 20, 2026 10:54
@yingfeng
yingfeng marked this pull request as draft July 20, 2026 10:54
@yingfeng
yingfeng marked this pull request as ready for review July 20, 2026 10:54
@yingfeng
yingfeng marked this pull request as draft July 20, 2026 10:55
@yingfeng
yingfeng marked this pull request as ready for review July 20, 2026 10:55
@yingfeng
yingfeng marked this pull request as draft July 20, 2026 10:56
@yingfeng
yingfeng marked this pull request as ready for review July 20, 2026 10:56
@yingfeng yingfeng added ci Continue Integration and removed ci Continue Integration labels Jul 20, 2026
@yingfeng
yingfeng marked this pull request as draft July 20, 2026 10:57
@yingfeng
yingfeng marked this pull request as ready for review July 20, 2026 10:57
@yingfeng
yingfeng merged commit 392b249 into infiniflow:main Jul 20, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. size:XXL This PR changes 1000+ lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants