Skip to content
Merged
8 changes: 6 additions & 2 deletions apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
"identifier": "opener:allow-open-path",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" }
{ "path": "$APPDATA/**" },
{ "path": "$DOWNLOAD/*" },
{ "path": "$DOWNLOAD/**" }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing unrestricted write-file access to the entire Downloads directory is overly permissive and could let a compromised app modify or remove any user download

Prompt for AI agents
Address the following comment on apps/desktop/src-tauri/capabilities/default.json at line 65:

<comment>Allowing unrestricted write-file access to the entire Downloads directory is overly permissive and could let a compromised app modify or remove any user download</comment>

<file context>
@@ -60,7 +60,9 @@
       &quot;identifier&quot;: &quot;opener:allow-open-path&quot;,
       &quot;allow&quot;: [
         { &quot;path&quot;: &quot;$APPDATA/*&quot; },
-        { &quot;path&quot;: &quot;$APPDATA/**&quot; }
+        { &quot;path&quot;: &quot;$APPDATA/**&quot; },
+        { &quot;path&quot;: &quot;$DOWNLOAD/*&quot; },
+        { &quot;path&quot;: &quot;$DOWNLOAD/**&quot; }
       ]
     },
</file context>

]
},
{
Expand All @@ -78,7 +80,9 @@
"identifier": "fs:allow-write-file",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" }
{ "path": "$APPDATA/**" },
{ "path": "$DOWNLOAD/*" },
{ "path": "$DOWNLOAD/**" }
]
},
{
Expand Down
41 changes: 23 additions & 18 deletions apps/desktop/src/components/editor-area/note-header/chips/index.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
import { useRightPanel } from "@/contexts";
import { MessageCircleMore } from "lucide-react";
// Temporarily commented out chat functionality
// import { useRightPanel } from "@/contexts";
// import { MessageCircleMore } from "lucide-react";
import { EventChip } from "./event-chip";
import { ParticipantsChip } from "./participants-chip";
import { PastNotesChip } from "./past-notes-chip";
import { ShareChip } from "./share-chip";
import { TagChip } from "./tag-chip";

function StartChatButton({ isVeryNarrow }: { isVeryNarrow: boolean }) {
const { togglePanel } = useRightPanel();
// Temporarily commented out StartChatButton
// function StartChatButton({ isVeryNarrow }: { isVeryNarrow: boolean }) {
// const { togglePanel } = useRightPanel();

const handleChatClick = () => {
togglePanel("chat");
};
// const handleChatClick = () => {
// togglePanel("chat");
// };

return (
<button
onClick={handleChatClick}
className="flex flex-row items-center gap-1 rounded-md px-2 py-1.5 hover:bg-neutral-100 flex-shrink-0 text-xs transition-colors"
>
<MessageCircleMore size={14} className="flex-shrink-0" />
{!isVeryNarrow && <span className="truncate">Chat</span>}
</button>
);
}
// return (
// <button
// onClick={handleChatClick}
// className="flex flex-row items-center gap-1 rounded-md px-2 py-1.5 hover:bg-neutral-100 flex-shrink-0 text-xs transition-colors"
// >
// <MessageCircleMore size={14} className="flex-shrink-0" />
// {!isVeryNarrow && <span className="truncate">Chat</span>}
// </button>
// );
// }

export default function NoteHeaderChips({
sessionId,
Expand All @@ -45,7 +48,9 @@ export default function NoteHeaderChips({
<EventChip sessionId={sessionId} isVeryNarrow={isVeryNarrow} isNarrow={isNarrow} />
<ParticipantsChip sessionId={sessionId} isVeryNarrow={isVeryNarrow} isNarrow={isNarrow} />
<TagChip sessionId={sessionId} hashtags={hashtags} isVeryNarrow={isVeryNarrow} isNarrow={isNarrow} />
<StartChatButton isVeryNarrow={isVeryNarrow} />
<ShareChip isVeryNarrow={isVeryNarrow} />
{/* Temporarily commented out chat button */}
{/* <StartChatButton isVeryNarrow={isVeryNarrow} /> */}
<PastNotesChip sessionId={sessionId} isVeryNarrow={isVeryNarrow} isNarrow={isNarrow} />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { Popover, PopoverContent, PopoverTrigger } from "@hypr/ui/components/ui/popover";
import { Share2, TextSelect } from "lucide-react";
import { useState } from "react";
import { SharePopoverContent, useShareLogic } from "../share-button-header";

interface ShareChipProps {
isVeryNarrow?: boolean;
}

export function ShareChip({ isVeryNarrow = false }: ShareChipProps) {
const [open, setOpen] = useState(false);
const { hasEnhancedNote, handleOpenStateChange } = useShareLogic();

const handleOpenChange = (newOpen: boolean) => {
setOpen(newOpen);
if (hasEnhancedNote) {
handleOpenStateChange(newOpen);
}
};

return (
<Popover open={open} onOpenChange={handleOpenChange}>
<PopoverTrigger asChild>
<button
className={`flex flex-row items-center gap-1 rounded-md px-2 py-1.5 hover:bg-neutral-100 flex-shrink-0 text-xs transition-colors ${
open ? "bg-neutral-100" : ""
}`}
>
<Share2 size={14} className="flex-shrink-0" />
{!isVeryNarrow && <span className="truncate">Share</span>}
</button>
</PopoverTrigger>
<PopoverContent
className="w-80 p-3 focus:outline-none focus:ring-0 focus:ring-offset-0"
align="start"
sideOffset={7}
>
{hasEnhancedNote ? <SharePopoverContent /> : <SharePlaceholderContent />}
</PopoverContent>
</Popover>
);
}

function SharePlaceholderContent() {
return (
<div className="flex flex-col gap-3">
<div className="text-sm font-medium text-neutral-700">Share Enhanced Note</div>
<div className="flex flex-col items-center justify-center py-8 px-4 text-center">
<div className="w-12 h-12 rounded-full bg-neutral-100 flex items-center justify-center mb-4">
<TextSelect size={24} className="text-neutral-400" />
</div>
<h3 className="text-sm font-medium text-neutral-900 mb-2">
Enhanced Note Required
</h3>
<p className="text-xs text-neutral-500 leading-relaxed">
Complete your meeting to generate an enhanced note, then share it via PDF, email, Obsidian, and more.
</p>
</div>
</div>
);
}
Loading
Loading