Aller au contenu
login
arrow_backRetour aux issues
IsmaelMartinez/teams-for-linux #2885

[Feat]: Add an "Open config file" menu entry

ecoDébutant enhancement good first issue awaiting user feedback configuration

descriptionDescription

## Problem There is no way to reach `config.json` from inside the app. `git grep` over `app/menus/` finds no `shell.openPath` or `showItemInFolder` anywhere, so a user who wants to change any of the 68 restart-only options has to know the file exists, know its name, and know where their packaging format puts it. That last part is the real friction, because the location is different for every format: | Install | Config directory | | --- | --- | | deb / rpm / tar.gz / AppImage | `~/.config/teams-for-linux` | | snap | `~/snap/teams-for-linux/current/.config/teams-for-linux/` | | flatpak (`--user`) | `~/.var/app/com.github.IsmaelMartinez.teams_for_linux/config/teams-for-linux` | | from source | `~/.config/Electron/` | The Flatpak and Snap paths in particular are not somewhere anyone guesses. ## Proposal Two entries under the existing **Settings** submenu in `app/menus/appMenu.js` (`getSettingsMenu`), next to Save and Restore: - **Open config file** — `shell.openPath(getConfigFilePath(configPath))` - **Open config folder** — `shell.openPath(configPath)` The directory is already available as `AppConfiguration.configPath` (`app/appConfiguration/index.js:43`), and `app/config/index.js` has `getConfigFilePath(configPath)` for the file itself. `app/menus/index.js` already destructures from `electron`, so this is adding `shell` to that import plus the two handlers. ## Worth deciding **Settled:** `config.json` frequently does not exist. The startup log says `No config file found (user or system-wide), using default values`, and `shell.openPath` on a missing path just returns an error string rather than doing anything useful. So "Open config file" writes an empty `{}` stub first when the file is absent, then opens it. Creating the directory if needed is part of that. Also worth checking before implementing: whether `shell.openPath` actually escapes the sandbox on Flatpak and Snap. It goes through the portal on Flatpak, which normally handles `~/.var/app/...` fine since the app owns that directory, but it is worth confirming on both rather than assuming. ## Context Came out of #2830, which proposed a full in-app settings window and was closed. 68 of the 74 config options are `applyMode: restart` and the 6 `live` ones are already exposed as menu toggles, so a settings window was mostly a GUI for options that need a restart anyway. Discoverability was the part of that idea actually worth keeping, and this is the cheap version of it.
codeOuvre sur GitHub