Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear Filter Value When Clicking on a Directory in the File List View #1066

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented Nov 27, 2024

In the file list view, users can filter directories and files by a path String. However, the filtered directory is navigated by a click, the children content is not displayed automatically because the filter value is not cleared.

In the file list view, users can filter directories and files by a path String.
However, the filtered directory is navigated by a click, the children content is not displayed automatically because the filter value is not cleared.
@minwoox minwoox added this to the 0.71.0 milestone Nov 27, 2024
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.41%. Comparing base (f810f16) to head (c186803).
Report is 42 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1066      +/-   ##
============================================
- Coverage     71.60%   69.41%   -2.20%     
+ Complexity     4121     4119       -2     
============================================
  Files           402      412      +10     
  Lines         16452    16823     +371     
  Branches       1762     1841      +79     
============================================
- Hits          11781    11677     -104     
- Misses         3640     4119     +479     
+ Partials       1031     1027       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@minwoox minwoox changed the title Clear filter value when a directory is clicked in file list view Clear Filter Value When Clicking on a Directory in the File List View Nov 28, 2024
@ikhoon
Copy link
Contributor

ikhoon commented Dec 2, 2024

We may reset the stats of DynamicDataTable by specifying key.

--- webapp/src/dogma/features/file/FileList.tsx
+++ webapp/src/dogma/features/file/FileList.tsx
@@ -125,7 +125,7 @@ const FileList = <Data extends object>({
   );
   return (
     <Box>
-      <DynamicDataTable columns={columns as ColumnDef<Data>[]} data={data} />
+      <DynamicDataTable key={slug} columns={columns as ColumnDef<Data>[]} data={data} />

I haven't fully tested but it seems to work.

@minwoox
Copy link
Member Author

minwoox commented Dec 2, 2024

I should've asked you before making this. 😅

@minwoox
Copy link
Member Author

minwoox commented Dec 2, 2024

I haven't fully tested but it seems to work.

Checked it works perfectly. Thanks!

@minwoox minwoox merged commit f01f9d3 into line:main Dec 4, 2024
10 checks passed
@minwoox minwoox deleted the fix_fileList branch December 4, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants