# UX Reference: User Profile Dashboard Filter

**Feature Branch**: `024-user-dashboard-filter`
**Created**: 2026-03-04
**Status**: Draft

## 1. User Persona & Context

*   **Who is the user?**: Data Analyst or Dashboard Developer who works with Apache Superset dashboards
*   **What is their goal?**: Quickly find and access only the dashboards they own or have modified, reducing clutter from irrelevant dashboards
*   **Context**: Browsing the dashboard list in a web application, wanting to personalize their view to focus on their own work

## 2. The "Happy Path" Narrative

The user navigates to their profile page, sees a clean settings section with a clearly labeled field for their Apache Superset username, and chooses a Superset environment for account lookup. The system loads available Superset accounts, the user selects their account (or enters manually if needed), toggles "Show only my dashboards" to "On", and clicks Save. The system confirms the change with a brief success message. When they return to the dashboard list, they immediately see only their own dashboards - no clutter, no scrolling through hundreds of irrelevant items. The experience feels instant, intuitive, and personalized.

## 3. Interface Mockups

### UI Layout & Flow

**Screen**: User Profile Page

*   **Layout**: Single-column layout with clear sections. Header shows user information, followed by a "Dashboard Preferences" section.
*   **Key Elements**:
    *   **Section Title**: "Dashboard Preferences" - Bold, prominent
    *   **Superset Environment Selector**: Dropdown for selecting environment used for account lookup. Label: "Superset Environment"
    *   **Apache Superset Username Input**: Text field with placeholder "Enter your Apache Superset username". Label: "Your Apache Superset Account"
    *   **Superset Account Suggestions**: Searchable list loaded from selected environment, allowing account selection for binding
    *   **Toggle Switch**: "Show only my dashboards by default" - Large, easy to tap/click. Default: Off
    *   **Save Button**: Primary action. Color: Blue. Text: "Save Preferences"
    *   **Cancel Button**: Secondary action. Text: "Cancel"
*   **States**:
    *   **Default**: Fields populated with current settings (if any), Save button enabled
    *   **Lookup Loading**: Account suggestions show loading indicator after environment selection
    *   **Loading**: Save button shows spinner, text changes to "Saving..."
    *   **Success**: Toast notification appears top-right: "✓ Preferences saved!" (Green). Button returns to normal state
    *   **Error**: Toast notification appears top-right: "✗ Failed to save. Please try again." (Red)

**Screen**: Dashboard List (After Filter Applied)

*   **Layout**: Grid or list view of dashboards
*   **Key Elements**:
    *   **Filter Indicator**: Small badge showing "My Dashboards Only" with an "X" to clear filter
    *   **Dashboard Cards**: Each shows dashboard name, owner, last modified date
    *   **Empty State**: If no dashboards match, shows friendly message: "No dashboards found for your account. Try adjusting your filter settings."

## 4. The "Error" Experience

**Philosophy**: Don't just report the error; guide the user to the fix.

### Scenario A: Invalid Username Format

*   **User Action**: Enters "John Doe" (with spaces) in the username field
*   **System Response**:
    *   Input border turns Red. Message below input: "Username should not contain spaces. Please enter a valid Apache Superset username."
    *   Save button becomes disabled until error is resolved
*   **Recovery**: User can immediately correct the username without page refresh

### Scenario B: Username Not Found in Superset

*   **User Action**: Enters username that doesn't exist in connected Apache Superset instance
*   **System Response**:
    *   Toast notification: "⚠ Username 'johndoe' not found in Apache Superset. Please verify your username."
    *   Settings are still saved, but filter may return no results
*   **Recovery**: User can correct the username and try again, or disable the filter

### Scenario C: Connection Error to Superset

*   **User Action**: Clicks Save while system cannot connect to Apache Superset
*   **System Response**:
    *   Toast notification: "⚠ Cannot connect to Apache Superset. Your preferences were saved, but dashboard filtering may not work until connection is restored."
    *   Button returns to normal state
*   **Recovery**: User can retry saving later, or contact administrator

### Scenario D: Account Lookup Failed for Selected Environment

*   **User Action**: Selects a Superset environment, but account lookup request fails
*   **System Response**:
    *   Inline warning near account field: "Cannot load Superset accounts for this environment right now. You can enter username manually."
    *   Username input stays editable, Save remains available
*   **Recovery**: User enters username manually or retries environment lookup

## 5. Tone & Voice

*   **Style**: Concise, Professional, User-friendly
*   **Terminology**: 
    *   Use "Apache Superset" (full name) on first mention, "Superset" thereafter
    *   Use "Dashboard" not "Dash" or "Board"
    *   Use "Username" not "User ID" or "Account Name"
    *   Use "Filter" not "Filtering" when referring to the feature