Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/**" }
]
},
{
Expand All @@ -78,7 +80,9 @@
"identifier": "fs:allow-write-file",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" }
{ "path": "$APPDATA/**" },
{ "path": "$DOWNLOAD/*" },
{ "path": "$DOWNLOAD/**" }
]
},
{
Expand Down
35 changes: 31 additions & 4 deletions apps/desktop/src/components/toolbar/buttons/share-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Button } from "@hypr/ui/components/ui/button";
import { Popover, PopoverContent, PopoverTrigger } from "@hypr/ui/components/ui/popover";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@hypr/ui/components/ui/select";
import { useSession } from "@hypr/utils/contexts";
import { exportToPDF } from "../utils/pdf-export";
import { exportToPDF, getAvailableThemes, type ThemeName } from "../utils/pdf-export";

export function ShareButton() {
const param = useParams({ from: "/app/note/$id", shouldThrow: false });
Expand All @@ -38,6 +38,7 @@ function ShareButtonInNote() {
const [open, setOpen] = useState(false);
const [expandedId, setExpandedId] = useState<string | null>(null);
const [selectedObsidianFolder, setSelectedObsidianFolder] = useState<string>("default");
const [selectedPdfTheme, setSelectedPdfTheme] = useState<ThemeName>("default");
const [includeTranscript, setIncludeTranscript] = useState(false);
const [copySuccess, setCopySuccess] = useState(false);
const hasEnhancedNote = !!session?.enhanced_memo_html;
Expand Down Expand Up @@ -161,7 +162,7 @@ function ShareButtonInNote() {
if (optionId === "copy") {
result = await exportHandlers.copy(session);
} else if (optionId === "pdf") {
result = await exportHandlers.pdf(session);
result = await exportHandlers.pdf(session, selectedPdfTheme);
} else if (optionId === "email") {
try {
// fetch participants directly, bypassing cache
Expand Down Expand Up @@ -331,6 +332,29 @@ function ShareButtonInNote() {
</button>
</div>

{option.id === "pdf" && (
<div className="mb-3">
<label className="block text-xs font-medium text-gray-700 mb-1">
Theme
</label>
<Select
value={selectedPdfTheme}
onValueChange={(value) => setSelectedPdfTheme(value as ThemeName)}
>
<SelectTrigger className="w-full h-8 text-xs">
<SelectValue placeholder="Select theme" />
</SelectTrigger>
<SelectContent className="max-h-48 overflow-y-auto">
{getAvailableThemes().map((theme: ThemeName) => (
<SelectItem key={theme} value={theme} className="text-xs">
{theme.charAt(0).toUpperCase() + theme.slice(1)}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)}

{option.id === "obsidian" && (
<>
<div className="mb-3">
Expand Down Expand Up @@ -440,8 +464,11 @@ const exportHandlers = {
}
},

pdf: async (session: Session): Promise<ExportResult> => {
const path = await exportToPDF(session);
pdf: async (session: Session, theme: ThemeName = "default"): Promise<ExportResult> => {
const path = await exportToPDF(session, theme);
if (path) {
await message(`Meeting summary saved to your 'Downloads' folder ("${path}")`);
}
return { type: "pdf", path };
},

Expand Down
Loading
Loading