feat(windows): add Open data folder button to General tab#7
Open
tmchow wants to merge 1 commit into
Open
Conversation
Users asked for a one-click way to grab `settings.json`, audio recordings, and the history DB out of `%APPDATA%\FreeFlow` when sharing troubleshooting evidence with support. A new **Data Folder** section at the bottom of the General tab (below Custom Vocabulary) has a short label telling the reader where the files live and an *Open data folder* button that opens the folder in Explorer. Implementation: - New `_open_data_folder` handler calls `os.startfile(str(Config.app_ data_dir()))`. `Config._app_data_dir()` already mkdir's the folder at import time, so the path always exists by the time the button is clickable. `os.startfile` hands the path to the shell and returns, so the settings window stays responsive per the acceptance criteria. - Failure path: if `os.startfile` raises `OSError` (e.g. shell can't open the path), a `messagebox.showerror` with the settings window as parent reports the error without crashing the app. Acceptance criteria from aruneshvv#6: - [x] Button opens Explorer at the FreeFlow data folder - [x] Works when the folder already exists (always, per `_app_data_dir`) - [x] Does not block the settings window while Explorer is open (`os.startfile` is non-blocking) Closes aruneshvv#6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an Open data folder button to the General tab of the Windows settings window (#6). Clicking the button opens
%APPDATA%\FreeFlowin Explorer so users can quickly grabsettings.json, an audio recording, orhistory.sqlitewhen sharing troubleshooting evidence.Why this matters
Users troubleshooting FreeFlow end up typing out the
%APPDATA%\FreeFlowpath into Explorer repeatedly. The issue asks for a one-click shortcut in the UI. The path is already managed internally byConfig.app_data_dir()/Config._app_data_dir(), and_app_data_diralreadymkdir's the folder eagerly -- so the entire feature is hooking a button in the General tab to a four-line handler.Changes
windows/freeflow/settings_window.pyonly:import osandfrom .config import Configto the imports block (no new third-party deps)._build_general_tab, after the Custom Vocabulary section, add a newData FolderLabelFramewith:ttk.Labelexplaining the path (%APPDATA%\FreeFlow)Open data folderttk.Buttonwired toself._open_data_folder_open_data_folder:os.startfile(str(Config.app_data_dir()))inside atry/except OSErrorthat shows amessagebox.showerrorwithself._rootas the parent, so a failure surfaces cleanly instead of crashing the app.Acceptance (from #6)
os.startfileon the path returned byConfig.app_data_dir().Config._app_data_dir()eagerlymkdir(parents=True, exist_ok=True)s at import, so the folder is guaranteed to exist.os.startfilehands the path to the Windows shell and returns immediately, no subprocess join.Testing
python -c "import ast; ast.parse(open('windows/freeflow/settings_window.py').read())"-- clean syntax.tests/holds only integration artefacts). The tkinter code path mirrors the existing_build_general_tabpatterns forLabelFrame/ttk.Button/messagebox.showerror(parent=self._root).os.startfileonly exists on Windows). It lives underwindows/freeflow/so platform gating is handled by the existing module layout.Closes #6
This contribution was developed with AI assistance (Claude Code).