Acceptance Criteria
This is an experiment. I want to note down all important parts of the project. We can then give it to AI tools and see how well they generate the code.
General project setup:
Add a .pre-commit-config.yaml
Package it using pyproject.toml and flit. Do not use setup.py. The name of the package is “flitz”.
Test the application using pytest. Avoid using TestCase. Use a pytest fixture instead.
Add sphinx documentation and ensure it’s build on readthedocs
Prefer pathlib over os.
Features:
Create a file explorer application using Python.
Make a list-view: Name, size, Type, Date Modified.
When double-clicking on a folder, the view should descend.
There should be an URL bar showing the current path. An “up” button should be on the left of it. It should only have an image, no text.
Allow changing the font size with Ctrl +/- in the whole application.
Allow sorting by clicking on the Column headers (name, size, type, date modified)
If a parameter is given like
flitz /home/foo/bar, then/home/foo/barshould be the path being set when starting flitz.Create a Config class using Pydantic as well as a static method “load” that returns a Config object. Load the configuration from “~/.flitz.yml”, if it exists. The class should have a single value “font_size: int” with a default of 14.
Pressing F2 when a file/folder is selected lets the user rename that object.
Allow opening a file (double click or Enter) or descend if it’s a folder
Open a search when pressing Ctrl+F
Pressing Esc should: (1) If the context menu is open, close it (2) If not, and if the search is active, deactivate the search
When pressing “DEL”, delete the selected file / folder. Ask for confirmation first.
When making a right-click, open a context menu:
Create Folder
Create Empty file
Rename…
Properties
Ctrl+C should copy the selection, Ctrl+v should paste the selection, Ctrl+x should cut the selection
Allow referencing
external_configin the Config file. Those get loaded just like any other configuration. They can (partially) override the existing config.Ctrl+h toggles the visibility of hidden files/folders