Show Hidden File Count In Status Bar

by Alex Johnson 37 views

The Importance of Visibility: Unveiling Hidden File Counts

Have you ever found yourself staring at your computer screen, wondering just how many files are tucked away in your folders, especially when you've specifically enabled the "Show Hidden Files" option? It's a common scenario, particularly when using file management tools like Puter. When you decide to peek behind the curtain and reveal those files that typically remain unseen (you know, the ones starting with a dot .), you get to see them. But here's the kicker: you don't get a clear indication of how many of those files are actually hidden. This lack of immediate feedback can be quite frustrating. You might be trying to organize your data, or perhaps you're just double-checking to ensure that your settings are working as intended, and you're left manually counting. This manual process is not only tedious but also prone to errors, especially in folders with a large number of files. This is precisely why the motivation behind this feature request is so strong: to provide users with an instantly accessible count of hidden files directly within the status message, making your file management experience significantly smoother and more intuitive. This small addition can make a big difference in understanding your folder's true contents at a glance.

Current Behavior: The Unseen Majority

Let's dive a little deeper into how things currently work, or rather, how they don't work, in Puter. When you're navigating through your files, the status bar at the bottom of the window typically gives you a summary. It might say something like "8 items" or perhaps a more detailed breakdown like "5 files, 3 folders." This is helpful, providing a quick overview of what's readily visible. However, the crucial piece of information that's missing is the count of hidden files, even when you've explicitly told Puter to show them. Imagine this: you enable the "Show Hidden Files" option, and suddenly, a whole new set of files appears. You see them, you can interact with them, but the status bar remains blissfully unaware. It continues to show only the total count of all items, or sometimes, even just the count of non-hidden items, failing to acknowledge the presence of the files you've intentionally revealed. This behavior leaves users in a state of uncertainty. They see the hidden files, but they have no quantitative way of knowing how many there are without resorting to manual counting. This is where the need for a change becomes apparent. The current system presents a visual clue but lacks a numerical confirmation, creating a gap in the user experience that this feature aims to fill. It's like being handed a map with some roads obscured – you can see them if you squint, but you don't have a clear sense of the entire road network.

Reproduction Steps:

To truly understand this limitation, let's walk through a simple reproduction scenario:

  1. Open Puter and navigate to any folder: Let's pick your trusty "Documents" folder for this.
  2. Create some visible files: Right-click in the folder, go to "New," and select "Text Document." Name it file1.txt. Repeat this process to create another file named file2.txt.
  3. Create some hidden files: Now, for the magic! Again, right-click, "New," "Text Document." This time, name it .hidden1. Notice the dot at the very beginning of the name? That's the universal signal for a hidden file on many operating systems. Do the same for another file, .hidden2.
  4. Observe the folder view: By default, if your "Show Hidden Files" option is enabled (which it often is in testing scenarios like this), you'll see file1.txt, file2.txt, .hidden1, and .hidden2 all listed.
  5. Check the status bar: Now, glance down at the status bar at the bottom of the Puter window. What does it say? In most cases, it will likely show something like "4 items" or maybe "2 files, 2 folders" if you had folders. Crucially, it will not mention that 2 of those items are hidden files. This is the core of the issue – the status bar doesn't differentiate or quantify the hidden items you're seeing.

This simple walkthrough highlights the disconnect between what the user sees (hidden files are visible) and what the user knows (how many hidden files there are). The status bar, a prime location for quick information, fails to provide this essential context, necessitating a change to enhance user awareness and control.

Expected Behavior: Clarity at a Glance

Imagine a much-improved scenario where the status bar actively informs you about the hidden elements within your current view. This is the core of the expected behavior: when hidden files are visible, the status bar should clearly indicate the count of these hidden items. No more manual counting, no more guesswork. We're talking about a subtle yet powerful enhancement that significantly boosts usability. The goal is to provide immediate, quantitative feedback about the hidden components of your folder's content, seamlessly integrated into the existing status message.

Clarity and Consistency: The Ideal Format

To achieve this, we envision a status bar that adapts its message based on the presence and visibility of hidden files. For instance, if you have a total of 8 items in a folder, and 3 of them are hidden files that are currently displayed, the status bar could elegantly display something like: "8 items (3 hidden)". This format is concise, easy to understand, and immediately tells you the composition of the items in the folder. Another potential format could be: "5 files, 3 folders (2 hidden)", providing a more granular breakdown while still incorporating the hidden file count. The key is clarity and consistency.

Acceptance Criteria:

To ensure this feature is implemented correctly and delivers the expected value, here are the specific criteria it must meet:

  • [ ] Hidden Count Display: When the "Show Hidden Files" option is enabled and there are indeed hidden files present in the current folder view, the status bar must display the count of these hidden items. This is the primary requirement.
  • [ ] Clear Formatting: The format used for displaying the hidden count should be unambiguous. Examples like "8 items (3 hidden)" or "5 files, 3 folders (2 hidden)" are ideal. The goal is for users to instantly grasp the information without needing to decipher any special notation.
  • [ ] No Hidden Files Scenario: If "Show Hidden Files" is enabled but there are no hidden files in the folder, the status bar should remain unchanged, displaying the count as it normally would (e.g., "5 items"). No extra information about hidden files should appear if there are none.
  • [ ] Hidden Files Disabled Scenario: When the "Show Hidden Files" option is disabled, hidden files are not visible. Consequently, the status bar should not show any count related to hidden files, regardless of how many might exist. The display should revert to the default behavior.
  • [ ] Dynamic Updates: The hidden file count must be dynamic. If you add, delete, or rename files in a way that changes the number of hidden files (or their hidden status), the count in the status bar must update in real-time to reflect these changes accurately.
  • [ ] Standard Convention: The hidden count should strictly adhere to the standard convention, meaning it only includes items whose names begin with a dot (.). This ensures compatibility and predictability across different user expectations.

By adhering to these acceptance criteria, the feature will provide a robust, intuitive, and valuable enhancement to the file management experience in Puter, ensuring users have complete and effortless awareness of their folder's contents.

Steps To Test: Verifying the Enhancement

To confirm that the new feature works exactly as expected, here's a step-by-step guide designed for thorough testing. This process will help you verify every aspect of the hidden file count functionality, from its initial display to its dynamic updates.

Step 1: Setting the Stage - Creating a Test Environment

First things first, let's create a clean and isolated space to conduct our tests. This prevents any interference from existing files or folders.

  1. Navigate to your Puter interface: Open Puter as you normally would.
  2. Create a new folder: Right-click anywhere on your desktop or within an existing folder like "Documents." From the context menu, select "New" and then "New Folder." This ensures we have a dedicated space.
  3. Name the folder: Give it a clear and descriptive name, such as TestHiddenFiles. This will make it easy to find and manage during testing.
  4. Open the test folder: Double-click on TestHiddenFiles to open it and make it the active window.

Step 2: Populating with Visible Files

Now, let's add some standard, visible files to our new folder. This will establish a baseline for our status bar count.

  1. Create the first visible file: Right-click inside the TestHiddenFiles folder. Select "New" → "Text Document." Name this file document1.txt.
  2. Create the second visible file: Repeat the process: Right-click → "New" → "Text Document." Name this file document2.txt.
  3. Initial Status Bar Check: After creating these two files, take a look at the status bar at the bottom of the Puter window. You should see it display "2 items". This confirms that the basic item count is functioning correctly before we introduce any hidden files.

Step 3: Introducing Hidden Files and Verifying the Count

This is the crucial step where we add hidden files and check if the new feature correctly identifies and counts them.

  1. Create the first hidden file: Right-click inside the TestHiddenFiles folder again. Select "New" → "Text Document." This time, carefully name the file .hidden1. Remember, the leading dot (.) is essential for it to be recognized as a hidden file.
  2. Create the second hidden file: Repeat the process for another hidden file: Right-click → "New" → "Text Document." Name this one .hidden2.
  3. Ensure Hidden Files are Visible: If you don't see .hidden1 and .hidden2 listed alongside document1.txt and document2.txt, you might need to enable the "Show Hidden Files" option. Right-click within the folder (in an empty space), and ensure that "Show Hidden Files" is checked. If it's not, click on it to enable it.
  4. Observe the Enhanced Status Bar: With both visible and hidden files now present and visible, check the status bar again. This is the key test: The status bar should now display the total item count along with the count of hidden files. For example, it should show something like "4 items (2 hidden)" or a similar clear format indicating the presence of the two hidden files you just created. This confirms the core functionality of the feature.

Additional Tests to Consider:

  • Renaming: Try renaming document1.txt to .document1 (making it hidden) and then renaming .hidden1 to visible_file (making it visible). Observe if the status bar count updates correctly in both scenarios.
  • Deletion: Delete one of the hidden files (e.g., .hidden2) and check if the status bar count decreases accordingly.
  • Empty Folder with Hidden Files Enabled: Create an empty folder, enable "Show Hidden Files," and ensure the status bar shows "0 items" with no mention of hidden files.
  • Disabling Hidden Files: After testing with hidden files visible, disable the "Show Hidden Files" option. Verify that the status bar reverts to showing only the total count (e.g., "2 items" if only document1.txt and document2.txt remain visible) and no longer indicates hidden items.

By following these steps, you can thoroughly test and validate the implementation of the "Show Hidden Files Count" feature, ensuring it meets all the defined acceptance criteria and provides a valuable improvement to the user experience.

Submission Guidelines

For submitting your findings, especially if you're reporting a bug or providing feedback on this feature, a visual demonstration can be incredibly helpful. We recommend using a screen recording tool to capture your test process.

  • Recording Tool: Download and use https://cap.so/. This tool is suggested for its ease of use and ability to capture your screen effectively. When recording, consider using "Studio mode" if available, which can offer a more polished output.
  • Export Format: Once your recording is complete, export it as an MP4 video file.
  • Submission: You can then directly upload this MP4 file by dragging and dropping it into the comment section of the relevant issue or discussion thread.

This visual evidence will provide invaluable context for developers and other users reviewing your submission.

Pull Request Guide

If you're a developer looking to contribute code to implement this feature or any other aspect of the project, please refer to the official guide on submitting pull requests:

  • Guide: You can find the comprehensive guide at https://hackmd.io/@timothy1ee/Hky8kV3hlx. This guide outlines the best practices and requirements for contributing code, ensuring a smooth integration process for your contributions.

Further Reading

For those interested in the broader context of file management and user interface design, you might find these resources helpful: