Skip to content

[Feature Request] Directory Preview: Simple View Toggle #3252

@floatin

Description

@floatin

Feature Description

Summary

Add a "Simple View" toggle option for the Directory Preview block that shows only file name (with icon), hiding additional columns like permissions, last modified time, size, and file type.

Use Case

When browsing large directories, the detailed view with multiple columns can be overwhelming. A simple view showing only the file name/icon allows faster scanning of directory contents.

Current Behavior

Directory Preview shows all columns: Icon, Name, Permissions, Last Modified, Size, Type

Desired Behavior

Simple View shows only: Icon, Name

Additional Context

This is useful when:

  • Browsing documentation folders with many files
  • Quickly scanning directory contents
  • Limited screen space scenarios

Implementation Suggestion

Meta Field

Add a per-block atom simpleView: PrimitiveAtom<boolean> to PreviewModel

UI Changes

Context Menu (Default Settings submenu)
Add checkbox menu item:

Simple View     [✓]

Code Changes

preview-model.tsx

+    simpleView: PrimitiveAtom<boolean>;

+        this.simpleView = atom<boolean>(false);

preview-directory-utils.tsx

+    const simpleView = globalStore.get(model.simpleView) ?? false;
     return [
         // ... existing menu items ...
+        {
+            label: "Simple View",
+            type: "checkbox",
+            checked: simpleView,
+            click: () => {
+                globalStore.set(model.simpleView, !simpleView);
+            },
+        },
     ];

preview-directory.tsx

+    const simpleView = useAtomValue(model.simpleView);

+    useEffect(() => {
+        if (simpleView) {
+            table.setColumnVisibility({
+                logo: true,
+                name: true,
+                modestr: false,
+                modtime: false,
+                size: false,
+                mimetype: false,
+                path: false,
+            });
+        } else {
+            table.setColumnVisibility({
+                logo: true,
+                name: true,
+                modestr: true,
+                modtime: true,
+                size: true,
+                mimetype: true,
+                path: false,
+            });
+        }
+    }, [simpleView, table]);

Behavior

  • Simple View is off by default (detailed view)
  • Toggle state is per-block (not global)
  • State persists during session
  • Does not persist to config (ephemeral view preference)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions