Overview
toni automatically saves your UI preferences to~/.toni/ui_prefs.json as you work. This includes column visibility, sort order, active columns, and filter state for each table view.
Preferences are defined in internal/ui/prefs.go:10 and persist across sessions.
Preferences File Location
Preferences Structure
The preferences file stores settings for each table view:Table Columns
Restaurants View
Frominternal/ui/restaurants.go:42, available columns:
- name - Restaurant name (width: 24)
- address - Street address (width: 20)
- city - City (width: 14)
- area - Neighborhood/area (width: 14)
- cuisine - Cuisine type (width: 14)
- price - Price range ($-$$$$, width: 10)
- rating - Average rating (width: 8)
- visits - Number of visits (width: 8)
- last - Last visit date (width: 14)
Visits View
Available columns for the visits table:- restaurant - Restaurant name
- visited_on - Visit date
- rating - Visit rating (1-10)
- notes - Visit notes
- would_return - Return preference
Want to Visit View
Available columns for the want-to-visit list:- restaurant - Restaurant name
- notes - Notes about why you want to visit
- priority - Priority (1-5)
Keyboard Controls
All table customization is done via keyboard shortcuts defined ininternal/ui/keys.go:48:
Column Navigation
- Tab - Next column
- Shift+Tab - Previous column
- 1-9 - Jump to column number (when in column jump mode)
Sorting
- s - Sort active column ascending
- S - Sort active column descending
- Press s again to cycle: ascending → descending → no sort
internal/ui/want_to_visit.go:234, sorting behavior:
- First press: sort ascending
- Second press: sort descending
- Third press: clear sorting
Column Visibility
- c - Hide active column
- C - Show all hidden columns
Filtering
- n - Filter by selected cell value
- N - Clear current filter
internal/ui/want_to_visit.go:295, filtering:
- Filters rows where the active column matches the selected cell’s value
- Case-insensitive matching
- Press n again on the same value to toggle filter off
Filtering is only available for columns with non-empty values in the selected row.
Customization Workflow
Navigate to a column
Use Tab or Shift+Tab to move between columns until you reach the one you want to customize.
Examples
Hide the Address Column in Restaurants
- Open restaurants view (r)
- Press Tab until “address” is highlighted
- Press c to hide
- Press C to show all columns again if needed
Sort Visits by Rating (Highest First)
- Open visits view (v)
- Press Tab until “rating” is highlighted
- Press S for descending sort
Filter Restaurants by City
- Open restaurants view (r)
- Navigate to a restaurant in your desired city
- Press Tab until “city” is highlighted
- Press n to filter by that city
- Press N to clear the filter
Manual Editing
You can manually edit~/.toni/ui_prefs.json if needed:
toni must be closed when editing this file. Changes are loaded on next launch.
Resetting Preferences
To reset all UI preferences to defaults:Reset Specific Table
To reset only one table’s preferences, edit the JSON file and remove that section:Column Width
Column widths are defined in code (frominternal/ui/restaurants.go:42) and cannot currently be customized through preferences. They are:
- Fixed per column type
- Optimized for terminal display
- Ensure data fits without excessive wrapping
Implementation Details
Preferences are managed through theTablePrefs struct in internal/ui/prefs.go:11:
ApplyPrefs(prefs TablePrefs)- Load saved preferencesPrefs() TablePrefs- Export current state for saving
tableController interface in internal/ui/table_controls.go:3.
Preferences are loaded automatically on startup and saved automatically on shutdown. No manual save command is needed.