Skip to content

Commit

Permalink
small ui changes
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Nov 18, 2024
1 parent 478fb05 commit cbcd047
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/generate_changelog_md.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fi
mkdir -p content/changelogs

# Create a new file with the current release as the name
echo ${CONTENT//\"/} > content/changelogs/$CURRENT_RELEASE.md
echo -e ${CONTENT//\"/} > content/changelogs/$CURRENT_RELEASE.md
SHORT_COMMIT_LAST_RELEASE=$(echo $COMMIT_LAST_RELEASE | cut -c 1-5)
SHORT_COMMIT_CURRENT_RELEASE=$(echo $COMMIT_CURRENT_RELEASE | cut -c 1-5)

Expand Down
2 changes: 1 addition & 1 deletion examples/typescript/pipe-obsidian-time-logs/pipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
{
"name": "obsidianPath",
"type": "string",
"type": "path",
"default": "",
"description": "Path to the Obsidian vault where time entries will be saved"
},
Expand Down
16 changes: 4 additions & 12 deletions screenpipe-app-tauri/app/timeline/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ export default function Timeline() {
() =>
throttle((e: React.WheelEvent<HTMLDivElement>) => {
const isWithinAiPanel = document
.querySelector('.ai-panel')
.querySelector(".ai-panel")
?.contains(e.target as Node);
const isWithinAudioPanel = document
.querySelector('.audio-transcript-panel')
.querySelector(".audio-transcript-panel")
?.contains(e.target as Node);
const isWithinTimelineDialog = document
.querySelector('[role="dialog"]')
Expand Down Expand Up @@ -245,10 +245,10 @@ export default function Timeline() {
useEffect(() => {
const preventScroll = (e: WheelEvent) => {
const isWithinAiPanel = document
.querySelector('.ai-panel')
.querySelector(".ai-panel")
?.contains(e.target as Node);
const isWithinAudioPanel = document
.querySelector('.audio-transcript-panel')
.querySelector(".audio-transcript-panel")
?.contains(e.target as Node);
const isWithinTimelineDialog = document
.querySelector('[role="dialog"]')
Expand Down Expand Up @@ -302,14 +302,6 @@ export default function Timeline() {
<RotateCcw className="h-4 w-4" />
</button>

<div
className="fixed inset-0 pointer-events-none z-50"
style={{
background:
"repeating-linear-gradient(0deg, rgba(0,0,0,0.1) 0px, rgba(0,0,0,0.1) 1px, transparent 1px, transparent 2px)",
}}
/>

<div className="flex-1 relative min-h-0">
{isLoading && (
<div className="absolute inset-0 flex items-center justify-center">
Expand Down
Binary file modified screenpipe-app-tauri/bun.lockb
Binary file not shown.
85 changes: 80 additions & 5 deletions screenpipe-app-tauri/components/pipe-config-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { MemoizedReactMarkdown } from "./markdown";
import { CodeBlock } from "./ui/codeblock";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import { open } from "@tauri-apps/plugin-dialog";
import { FolderOpen } from "lucide-react";

type PipeConfigFormProps = {
pipe: Pipe;
Expand Down Expand Up @@ -64,13 +66,23 @@ export const PipeConfigForm: React.FC<PipeConfigFormProps> = ({

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
console.log("Submitting config:", config);
console.log("submitting config:", config);

if (!config?.fields) {
console.log("no config fields found, aborting");
return;
}

try {
toast({
title: "Updating pipe configuration",
description: "Please wait...",
title: "updating pipe configuration",
description: "please wait...",
});

if (!pipe.id) {
throw new Error("pipe id is missing");
}

const response = await fetch(`http://localhost:3030/pipes/update`, {
method: "POST",
headers: {
Expand All @@ -83,10 +95,14 @@ export const PipeConfigForm: React.FC<PipeConfigFormProps> = ({
});

if (!response.ok) {
throw new Error("Failed to update pipe config");
const errorText = await response.text();
throw new Error(`failed to update pipe config: ${errorText}`);
}

onConfigSave(config || {});
const result = await response.json();
console.log("update response:", result);

onConfigSave(config);

await new Promise((resolve) => setTimeout(resolve, 1500));

Expand Down Expand Up @@ -300,6 +316,65 @@ export const PipeConfigForm: React.FC<PipeConfigFormProps> = ({
</div>
</div>
);
case "path":
return (
<div className="flex items-center space-x-2">
<Input
id={field.name}
type="text"
value={value}
onChange={(e) => handleInputChange(field.name, e.target.value)}
autoCorrect="off"
spellCheck="false"
/>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button
size="icon"
variant="ghost"
onClick={async () => {
try {
const selectedPath = await open({
directory: true,
multiple: false,
});
if (selectedPath) {
handleInputChange(field.name, selectedPath);
}
} catch (error) {
console.error("failed to select path:", error);
}
}}
className="h-8 w-8"
>
<FolderOpen className="h-4 w-4" />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>Select folder</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button
size="icon"
variant="ghost"
onClick={resetToDefault}
className="h-8 w-8"
>
<RefreshCw className="h-4 w-4" />
</Button>
</TooltipTrigger>
<TooltipContent>
<p>Reset to default</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
);
default:
return (
<div className="flex items-center space-x-2">
Expand Down
2 changes: 1 addition & 1 deletion screenpipe-app-tauri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-tooltip": "^1.1.3",
"@tauri-apps/api": "^2.1.0",
"@tauri-apps/api": "^2.1.1",
"@tauri-apps/plugin-cli": "2.0.0",
"@tauri-apps/plugin-dialog": "2.0.0",
"@tauri-apps/plugin-fs": "2.0.0",
Expand Down

0 comments on commit cbcd047

Please sign in to comment.