feat(tags): open the tag manager from Settings
Add an "Open tag manager" button under a new Tag library group in Settings → AI Workspace. It closes Settings and jumps to Explore's tag Manage mode. To make manage mode reachable from outside the Explore view, lift its flag out of TagCloud's local state into the store (tagManagerOpen / setTagManagerOpen) behind an openTagManager() action. Manage mode is reset whenever Explore is entered normally or the visual-cluster view is selected, so openTagManager() stays the only path that opens it programmatically.
This commit is contained in:
@@ -247,6 +247,7 @@ export function SettingsModal() {
|
||||
const openOnboarding = useGalleryStore((state) => state.openOnboarding);
|
||||
const theme = useGalleryStore((state) => state.theme);
|
||||
const setTheme = useGalleryStore((state) => state.setTheme);
|
||||
const openTagManager = useGalleryStore((state) => state.openTagManager);
|
||||
const lightboxAutoplay = useGalleryStore((state) => state.lightboxAutoplay);
|
||||
const setLightboxAutoplay = useGalleryStore((state) => state.setLightboxAutoplay);
|
||||
const lightboxAutoMute = useGalleryStore((state) => state.lightboxAutoMute);
|
||||
@@ -686,6 +687,17 @@ export function SettingsModal() {
|
||||
|
||||
{taggerQueueStatus ? <p className="pt-3 text-xs text-gray-500">{taggerQueueStatus}</p> : null}
|
||||
</SettingsGroup>
|
||||
|
||||
<SettingsGroup title="Tag library" description="Review and clean up the tags across your library.">
|
||||
<SettingsItem label="Manage tags" description="Open the tag manager in Explore to search, rename, and delete tags.">
|
||||
<button
|
||||
className="rounded-md border border-white/10 bg-white/[0.055] px-3 py-1.5 text-xs text-gray-300 transition-colors hover:bg-white/10 hover:text-white light-theme:border-gray-700/50 light-theme:bg-gray-900 light-theme:text-white light-theme:hover:bg-gray-800 light-theme:hover:text-white"
|
||||
onClick={openTagManager}
|
||||
>
|
||||
Open tag manager
|
||||
</button>
|
||||
</SettingsItem>
|
||||
</SettingsGroup>
|
||||
</div>
|
||||
) : (
|
||||
<div className="mt-8 space-y-9">
|
||||
|
||||
@@ -983,7 +983,9 @@ export function TagCloud() {
|
||||
const renameTag = useGalleryStore((state) => state.renameTag);
|
||||
const deleteTag = useGalleryStore((state) => state.deleteTag);
|
||||
const selectedFolderId = useGalleryStore((state) => state.selectedFolderId);
|
||||
const [manageTags, setManageTags] = useState(false);
|
||||
// Manage mode lives in the store so it can be opened from elsewhere (Settings).
|
||||
const manageTags = useGalleryStore((state) => state.tagManagerOpen);
|
||||
const setManageTags = useGalleryStore((state) => state.setTagManagerOpen);
|
||||
const handleDeleteTag = async (tag: string) => { await deleteTag(tag); };
|
||||
|
||||
useEffect(() => {
|
||||
@@ -1028,7 +1030,7 @@ export function TagCloud() {
|
||||
? "border-white/15 bg-white/10 text-white"
|
||||
: "border-white/8 bg-white/[0.03] text-gray-500 hover:text-gray-300"
|
||||
}`}
|
||||
onClick={() => setManageTags((v) => !v)}
|
||||
onClick={() => setManageTags(!manageTags)}
|
||||
>
|
||||
{manageTags ? "Done" : "Manage"}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user