feat: enhance background image handling with cache-busting

- Added a cache-busting query parameter to the background image URL to ensure the browser reloads the image when updated.
- Updated the AppState to include an optional imageVersion property for managing image updates.
- Modified the BoardBackgroundModal and BoardView components to utilize the new imageVersion for dynamic image loading.
This commit is contained in:
Cody Seibert
2025-12-12 23:09:51 -05:00
committed by Kacper
parent 6e7352e67e
commit 8621a3095d
3 changed files with 19 additions and 3 deletions

View File

@@ -373,6 +373,7 @@ export interface AppState {
string,
{
imagePath: string | null; // Path to background image in .automaker directory
imageVersion?: number; // Timestamp to bust browser cache when image is updated
cardOpacity: number; // Opacity of cards (0-100)
columnOpacity: number; // Opacity of columns (0-100)
columnBorderEnabled: boolean; // Whether to show column borders
@@ -1335,6 +1336,8 @@ export const useAppStore = create<AppState & AppActions>()(
[projectPath]: {
...existing,
imagePath,
// Update imageVersion timestamp to bust browser cache when image changes
imageVersion: imagePath ? Date.now() : undefined,
},
},
});
@@ -1535,6 +1538,7 @@ export const useAppStore = create<AppState & AppActions>()(
[projectPath]: {
...existing,
imagePath: null, // Only clear the image, preserve other settings
imageVersion: undefined, // Clear version when clearing image
},
},
});