feat(webui): Initialize root directory on file lister mount (resolves #1780).#1786
Conversation
WalkthroughModified PathsSelectFormItem component to eagerly load root directory contents on component mount using ROOT_PATH and expand the tree accordingly. Includes error handling with console logging and user-facing error message display. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
components/webui/client/src/pages/IngestPage/Compress/PathsSelectFormItem/index.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}
⚙️ CodeRabbit configuration file
- Prefer
false == <expression>rather than!<expression>.
Files:
components/webui/client/src/pages/IngestPage/Compress/PathsSelectFormItem/index.tsx
🧬 Code graph analysis (1)
components/webui/client/src/pages/IngestPage/Compress/PathsSelectFormItem/index.tsx (2)
components/webui/client/src/pages/IngestPage/Compress/PathsSelectFormItem/typings.ts (1)
ROOT_PATH(28-28)components/webui/client/src/pages/IngestPage/Compress/PathsSelectFormItem/utils.ts (1)
ROOT_PATH(104-104)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: package-image
- GitHub Check: build (macos-15)
- GitHub Check: build (ubuntu-24.04)
🔇 Additional comments (1)
components/webui/client/src/pages/IngestPage/Compress/PathsSelectFormItem/index.tsx (1)
20-20: LGTM!The ROOT_PATH import is necessary for the initialization logic and is properly used in the new useEffect hook.
Description
This PR improves the UX of the
PathsSelectFormItemcomponent by automatically loading and expanding the root directory ("/") when the component mounts. Previously, users had to manually click on the root node to view its contents, which created unnecessary friction in the file browser workflow.Changes:
useEffecthook that callsloadPath(ROOT_PATH)on mount to pre-fetch the root directory contents.Checklist
breaking change.
Validation performed
taskcd build/clp-package./sbin/start-clp.sh./sbin/stop-clp.shthen editedbuild/clp-package/etc/clp-config.yaml: setlogs_input.directory: "/home/junhao/"/homeis shown.Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.