docs(design): move game folder selection into settings
Move the design contract for choosing the library game folder out of the top bar and into Settings > Library. The launcher chrome now reserves the right edge for the kebab/menu controls, while Settings owns the required folder path and its set/unset states. The reference mock now persists `gameFolder: string | null` instead of a boolean, adds an exercisable GameFolderField, and includes matching CSS so the prototype reflects the documented interaction. This is still design/reference only; no runtime Tauri settings code changes here. Test Plan: - git diff --cached --check Refs: none
This commit is contained in:
@@ -524,6 +524,31 @@ function SegmentedRadio({ value, options, onChange, accent }) {
|
||||
);
|
||||
}
|
||||
|
||||
function GameFolderField({ value, onChange, accent }) {
|
||||
const isSet = !!(value && value.trim());
|
||||
const handleChange = () => {
|
||||
// In production: open native folder picker via Tauri.
|
||||
// For the prototype, prompt for a path so the field is exercisable.
|
||||
const next = window.prompt('Game folder path (leave empty to clear)', value || '');
|
||||
if (next == null) return;
|
||||
onChange(next.trim());
|
||||
};
|
||||
return (
|
||||
<div className={`folder-field ${isSet ? 'is-set' : 'is-unset'}`}
|
||||
style={{ '--accent': accent }}>
|
||||
<span className="folder-field-icon" aria-hidden="true"><Icon.folder/></span>
|
||||
<div className="folder-field-path" title={isSet ? value : 'No folder selected'}>
|
||||
{isSet
|
||||
? <bdi>{value}</bdi>
|
||||
: <span className="folder-field-empty">Not set</span>}
|
||||
</div>
|
||||
<button type="button" className="folder-field-btn" onClick={handleChange}>
|
||||
{isSet ? 'Change\u2026' : 'Choose\u2026'}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ColorSwatchPicker({ value, options, onChange }) {
|
||||
return (
|
||||
<div className="swatch-row">
|
||||
@@ -582,6 +607,11 @@ function SettingsDialog({ settings, onChange, onClose }) {
|
||||
</div>
|
||||
<div className="settings-section">
|
||||
<div className="settings-section-title">Library</div>
|
||||
<SettingsRow label="Game folder" hint="Parent directory where games are downloaded and installed">
|
||||
<GameFolderField value={settings.gameFolder}
|
||||
onChange={(v) => onChange('gameFolder', v)}
|
||||
accent={settings.accent}/>
|
||||
</SettingsRow>
|
||||
<SettingsRow label="Grid density" hint="How tightly cards are packed">
|
||||
<SegmentedRadio value={settings.density}
|
||||
options={SETTING_OPTIONS.density}
|
||||
|
||||
Reference in New Issue
Block a user