diff --git a/apps/desktop/src/components/finder/views/contact-view.tsx b/apps/desktop/src/components/finder/views/contact-view.tsx index 522e5c3580..511633a1b0 100644 --- a/apps/desktop/src/components/finder/views/contact-view.tsx +++ b/apps/desktop/src/components/finder/views/contact-view.tsx @@ -1,6 +1,6 @@ import { RiCornerDownLeftLine } from "@remixicon/react"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import { Building2, CircleMinus, FileText, Pencil, Plus, SearchIcon, TrashIcon, User } from "lucide-react"; +import { ArrowUpAZ, Building2, CircleMinus, FileText, Pencil, Plus, SearchIcon, TrashIcon, User } from "lucide-react"; import React, { useEffect, useRef, useState } from "react"; import { commands as dbCommands } from "@hypr/plugin-db"; @@ -27,6 +27,7 @@ export function ContactView({ userId, initialPersonId, initialOrgId }: ContactVi const [editingPerson, setEditingPerson] = useState(null); const [editingOrg, setEditingOrg] = useState(null); const [showNewOrg, setShowNewOrg] = useState(false); + const [sortAlphabetically, setSortAlphabetically] = useState(true); const queryClient = useQueryClient(); // Load organizations once and keep cached (global data) @@ -117,9 +118,21 @@ export function ContactView({ userId, initialPersonId, initialOrgId }: ContactVi return name !== null && name !== "" && name !== "Null"; }; - const displayPeople = (selectedOrganization - ? allPeopleWithUser.filter(person => person.organization_id === selectedOrganization) - : allPeopleWithUser).filter(person => person.id === userId || isValidName(person.full_name)); + const displayPeople = React.useMemo(() => { + let filtered = (selectedOrganization + ? allPeopleWithUser.filter(person => person.organization_id === selectedOrganization) + : allPeopleWithUser).filter(person => person.id === userId || isValidName(person.full_name)); + + if (sortAlphabetically) { + filtered = [...filtered].sort((a, b) => { + const nameA = (a.full_name || a.email || "").toLowerCase(); + const nameB = (b.full_name || b.email || "").toLowerCase(); + return nameA.localeCompare(nameB); + }); + } + + return filtered; + }, [selectedOrganization, allPeopleWithUser, userId, sortAlphabetically]); const selectedPersonData = displayPeople.find(p => p.id === selectedPerson); @@ -240,28 +253,40 @@ export function ContactView({ userId, initialPersonId, initialOrgId }: ContactVi

People

- +
+ + +
diff --git a/owhisper/schema.json b/owhisper/schema.json index b9f86809d5..4a69cf752d 100644 --- a/owhisper/schema.json +++ b/owhisper/schema.json @@ -47,8 +47,11 @@ "type" ], "properties": { - "access_key_id": { - "type": "string" + "type": { + "type": "string", + "enum": [ + "aws" + ] }, "id": { "type": "string" @@ -56,14 +59,11 @@ "region": { "type": "string" }, - "secret_access_key": { + "access_key_id": { "type": "string" }, - "type": { - "type": "string", - "enum": [ - "aws" - ] + "secret_access_key": { + "type": "string" } } }, @@ -75,6 +75,15 @@ "type" ], "properties": { + "type": { + "type": "string", + "enum": [ + "deepgram" + ] + }, + "id": { + "type": "string" + }, "api_key": { "type": [ "string", @@ -83,15 +92,6 @@ }, "base_url": { "type": "string" - }, - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "deepgram" - ] } } }, @@ -103,17 +103,17 @@ "type" ], "properties": { - "id": { - "type": "string" - }, - "model_path": { - "type": "string" - }, "type": { "type": "string", "enum": [ "whisper-cpp" ] + }, + "id": { + "type": "string" + }, + "model_path": { + "type": "string" } } }