# Where Is the Main UI Code Located in FluidVoice? A Complete SwiftUI Architecture Guide

> Discover the main UI code location in FluidVoice. Explore the SwiftUI architecture and find the application entry point in Sources/Fluid/fluidApp.swift and ContentView.swift.

- Repository: [ALTIC/FluidVoice](https://github.com/altic-dev/FluidVoice)
- Tags: architecture
- Published: 2026-07-08

---

**The main UI code in FluidVoice is located in the `Sources/Fluid` directory, with the application entry point defined in [`Sources/Fluid/fluidApp.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/fluidApp.swift) and the root view hierarchy managed by [`Sources/Fluid/ContentView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/ContentView.swift).**

FluidVoice is a macOS voice application built entirely with **SwiftUI**. If you are exploring the altic-dev/FluidVoice repository to understand how the interface is structured or to customize the user experience, you will find the main UI code organized under specific directories that handle everything from the initial app launch to individual screen components.

## Entry Point and App Bootstrap

The `FluidApp` struct serves as the primary entry point for the FluidVoice user interface. Located in [`Sources/Fluid/fluidApp.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/fluidApp.swift), this `@main` annotated struct creates the application window and injects shared services before presenting the root view.

```swift
@main
struct FluidApp: App {
    @StateObject private var menuBarManager = MenuBarManager()
    @StateObject private var appServices: AppServices
    
    var body: some Scene {
        WindowGroup(id: "main") {
            AdaptiveAppTheme(accent: self.settings.accentColor) {
                ContentView()
                    .environmentObject(self.menuBarManager)
                    .environmentObject(self.appServices)
            }
        }
    }
}

```

This bootstrap sequence initializes the `MenuBarManager` and `AppServices` as state objects, then passes them down through the SwiftUI environment using `environmentObject`. The `ContentView` is wrapped in an `AdaptiveAppTheme` to ensure consistent styling across the application.

## Root View Architecture

The `ContentView` struct, defined in [`Sources/Fluid/ContentView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/ContentView.swift), functions as the primary container for the entire UI. It implements a `NavigationSplitView` that manages the sidebar navigation and detail pane rendering.

```swift
struct ContentView: View {
    @EnvironmentObject private var appServices: AppServices
    
    var body: some View {
        Group {
            if self.settings.shouldShowOnboarding {
                self.onboardingOnlyView
            } else {
                NavigationSplitView(columnVisibility: self.$columnVisibility) {
                    self.sidebarView
                } detail: {
                    self.detailView
                }
            }
        }
        .onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in
            self.refreshAccessibilityPermissionState()
        }
    }
}

```

The view handles critical system integration through modifiers like `onReceive`, which listens for `NSApplication.didBecomeActiveNotification` to refresh accessibility permissions. The `sidebarView` property renders a `List` that drives `selectedSidebarItem`, while `detailView` swaps the content based on the current selection.

## Primary UI Screens by Function

Each major feature in FluidVoice corresponds to a dedicated SwiftUI view file. The sidebar items map to specific files under `Sources/Fluid/UI` and `Sources/Fluid/Views`:

- **Welcome Screen**: [`Sources/Fluid/UI/WelcomeView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/UI/WelcomeView.swift) handles the onboarding flow with a quick-setup checklist.
- **Command Mode**: [`Sources/Fluid/Views/CommandModeView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/Views/CommandModeView.swift) contains the voice-driven command interface.
- **Rewrite Mode**: [`Sources/Fluid/Views/RewriteModeView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/Views/RewriteModeView.swift) manages the edit-mode workflow for text rewriting.
- **AI Enhancements**: `Sources/Fluid/UI/AISettingsView+AIConfiguration.swift` and related `AISettings*` files configure post-processing options.

The `preferences` UI is constructed dynamically within [`ContentView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/ContentView.swift) rather than residing in a separate file, allowing direct access to the app's environment objects.

## Overlay and Visualization Components

Beyond the main window, FluidVoice implements specialized UI components for system integration. These files reside in `Sources/Fluid/UI`:

- **[`NotchContentViews.swift`](https://github.com/altic-dev/FluidVoice/blob/main/NotchContentViews.swift)**: Renders interface elements within the macOS notch area.
- **[`BottomOverlayView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/BottomOverlayView.swift)**: Provides the floating container used during command and edit modes.
- **[`Visualization/AudioVisualizationShared.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Visualization/AudioVisualizationShared.swift)**: Supplies the shared audio visualizer view used across different screens.

These components support the core voice functionality by providing visual feedback without requiring the main application window to remain focused.

## Summary

- The **main UI code** for FluidVoice is located in the `Sources/Fluid` directory of the altic-dev/FluidVoice repository.
- The **entry point** is [`Sources/Fluid/fluidApp.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/fluidApp.swift), which initializes services and launches `ContentView`.
- The **root view** in [`Sources/Fluid/ContentView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/ContentView.swift) uses `NavigationSplitView` to manage sidebar navigation and detail panes.
- **Individual screens** are organized under `Sources/Fluid/UI` and `Sources/Fluid/Views`, with specific files for Welcome, Command Mode, Rewrite Mode, and AI Settings.
- **System overlays** including notch content and audio visualization are handled by specialized files in `Sources/Fluid/UI`.

## Frequently Asked Questions

### What framework does FluidVoice use for its user interface?

FluidVoice is built entirely with **SwiftUI**, Apple's declarative framework for building interfaces across Apple platforms. The codebase uses modern SwiftUI patterns including `StateObject`, `EnvironmentObject`, and `NavigationSplitView` to manage state and navigation.

### Where is the entry point that launches the FluidVoice UI?

The entry point is the `FluidApp` struct in [`Sources/Fluid/fluidApp.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/fluidApp.swift). This `@main` annotated struct conforms to the `App` protocol and defines the `WindowGroup` scene that contains the root `ContentView`.

### How does FluidVoice handle navigation between different screens?

Navigation is managed by the `ContentView` struct using a `NavigationSplitView` with a sidebar and detail pane. The `sidebarView` property contains a `List` that updates `selectedSidebarItem`, which determines which view the `detailView` renders. This architecture supports both the main application flow and the onboarding sequence.

### Which files control the audio visualization and overlay UI?

The audio visualization is defined in [`Sources/Fluid/UI/Visualization/AudioVisualizationShared.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/UI/Visualization/AudioVisualizationShared.swift). The floating overlay UI used during voice commands is managed by [`Sources/Fluid/UI/BottomOverlayView.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/UI/BottomOverlayView.swift), while the macOS notch integration is handled by [`Sources/Fluid/UI/NotchContentViews.swift`](https://github.com/altic-dev/FluidVoice/blob/main/Sources/Fluid/UI/NotchContentViews.swift).