Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(309): visibleView without importing View, so uiStore and features form no import cycle (D13b)

purple0d2c3bd17e4f
diff --git a/src/lib/features.ts b/src/lib/features.ts
index b80aefa8..1843bb7d 100644
--- a/src/lib/features.ts
+++ b/src/lib/features.ts
@@ -1,5 +1,3 @@
-import type { View } from '../stores/uiStore'
-
/**
* Neurons (the Neuron tweaker, P11) is hidden in 3.0.9 (David, 04.11.2026):
* the tool gets reworked for 3.1.0. This one switch hides every way in
@@ -10,7 +8,9 @@ import type { View } from '../stores/uiStore'
export const NEURONS_ENABLED = false
/** The view to show for `view`: a hidden view falls back to Chat, so a
- * stale button, link or saved state never lands on a page that is off. */
-export function visibleView(view: View): View {
+ * stale button, link or saved state never lands on a page that is off.
+ * Generic over the view name instead of importing `View`: uiStore imports
+ * this file, and the type import back made an import cycle (`npm run cycles`). */
+export function visibleView<V extends string>(view: V): V | 'chat' {
return view === 'neuron' && !NEURONS_ENABLED ? 'chat' : view
}