From 4eaf7e50d78ec436af9283cae6af35595e505c03 Mon Sep 17 00:00:00 2001 From: Kelly Date: Sat, 13 Dec 2025 23:06:42 -0700 Subject: [PATCH] feat(ui): Add dropdown for Add User/Origin button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Single dropdown button shows both options - Selecting an option switches to that tab and opens modal - Cleaner UX than separate buttons per tab 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cannaiq/src/pages/Users.tsx | 51 +++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/cannaiq/src/pages/Users.tsx b/cannaiq/src/pages/Users.tsx index a09ebdbf..f7457ba2 100644 --- a/cannaiq/src/pages/Users.tsx +++ b/cannaiq/src/pages/Users.tsx @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react'; import { Layout } from '../components/Layout'; import { api } from '../lib/api'; import { useAuthStore } from '../store/authStore'; -import { Users as UsersIcon, Plus, Pencil, Trash2, X, Check, AlertCircle, Globe, Shield, Power, PowerOff } from 'lucide-react'; +import { Users as UsersIcon, Plus, Pencil, Trash2, X, Check, AlertCircle, Globe, Shield, Power, PowerOff, ChevronDown } from 'lucide-react'; interface User { id: number; @@ -56,6 +56,9 @@ export function Users() { const [originsLoading, setOriginsLoading] = useState(true); const [originsError, setOriginsError] = useState(null); const [showOriginModal, setShowOriginModal] = useState(false); + + // Add dropdown state + const [showAddDropdown, setShowAddDropdown] = useState(false); const [editingOrigin, setEditingOrigin] = useState(null); const [originFormData, setOriginFormData] = useState({ name: '', origin_type: 'domain', origin_value: '', description: '' }); const [originFormError, setOriginFormError] = useState(null); @@ -344,23 +347,45 @@ export function Users() {

Manage users and trusted origins

- {activeTab === 'users' ? ( +
- ) : ( - - )} + {showAddDropdown && ( +
+ + +
+ )} +
{/* Tabs */}