feat(component): implement directory component enhancements
Directory Component Improvements
Implements two key improvements to the Directory component:
1. Changes 'Types' field to dropdown format
Before:
MessageTextInput(
name="types",
display_name="Types",
info="File types to load. Leave empty to load all default supported types.",
is_list=True,
)
After:
DropdownInput(
name="types",
display_name="Types",
info="File types to load. Select types or leave empty to load all supported types.",
options=TEXT_FILE_TYPES,
value=TEXT_FILE_TYPES[0],
)
2. Sets default path to current directory
MessageTextInput(
name="path",
display_name="Path",
info="Path to the directory to load files from. Defaults to current directory ('.')",
value=".",
)
Improvements
- Provides a clearer file type selection interface
- Sets a sensible default path
- Adds better tooltip information about the default directory
CodSpeed Performance Report
Merging #5012 will degrade performances by 25.52%
Comparing raphaelchristi:enhance-directory-input (923ae7c) with main (c1bd7c8)
Summary
❌ 1 regressions
✅ 14 untouched benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
| Benchmark | main |
raphaelchristi:enhance-directory-input |
Change | |
|---|---|---|---|---|
| ❌ | test_successful_run_with_input_type_any |
259.2 ms | 348 ms | -25.52% |
Very nice improvements @raphaelchristi , thank you!
EDIT: @raphaelchristi i just realized, i dont think the DropdownInput supports multi-select...
Very nice improvements @raphaelchristi , thank you!
EDIT: @raphaelchristi i just realized, i dont think the DropdownInput supports multi-select...
Thanks @erichare That's a good point... Which input do you suggest for this implementation?
EDIT: I think to accept multi-select we can do something like:
StrInput(
name="types",
display_name="Types",
info="File types to load (comma-separated). Leave empty to load all supported types.",
value=",".join(TEXT_FILE_TYPES[0:3]), # Default to first 3 types
list=True, # This will allow multiple values
),
Very nice improvements @raphaelchristi , thank you! EDIT: @raphaelchristi i just realized, i dont think the DropdownInput supports multi-select...
Thanks @erichare That's a good point... Which input do you suggest for this implementation?
EDIT: I think to accept multi-select we can do something like:
StrInput( name="types", display_name="Types", info="File types to load (comma-separated). Leave empty to load all supported types.", value=",".join(TEXT_FILE_TYPES[0:3]), # Default to first 3 types list=True, # This will allow multiple values ),
This is good!
Can you check the mypy linting issues here?
Mypy failures are the main thing here.
Thanks for the review @erichare !
I checked the mypy linting and it's passing without any issues now.
Thanks @raphaelchristi !!