Skip to content

Commit

Permalink
Merge main and resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
glassBead-tc committed Jan 20, 2025
1 parent 4782229 commit 5a67234
Show file tree
Hide file tree
Showing 3 changed files with 307 additions and 116 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages packages/
COPY srcbook srcbook/
COPY turbo.json ./
COPY srcbook_mcp_config.json ./

# Install dependencies
RUN pnpm install
Expand All @@ -18,6 +19,9 @@ RUN pnpm build
# Create necessary directories for volumes
RUN mkdir -p /root/.srcbook /root/.npm

# Set container environment variable
ENV CONTAINER=true

# Source code will be mounted at runtime
CMD [ "pnpm", "start" ]

Expand Down
49 changes: 12 additions & 37 deletions packages/web/src/routes/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,42 +67,17 @@ function Settings() {

// If we're in a containerized environment, handle the path differently
if (data.containerized) {
try {
// Request clipboard permission first
const clipboardPermission = await navigator.permissions.query({ name: 'clipboard-write' as PermissionName });

if (clipboardPermission.state === 'granted' || clipboardPermission.state === 'prompt') {
await navigator.clipboard.writeText(data.result);
toast.success('Path copied to clipboard');

// Show instructions
toast.message(
'To find your config file:\n' +
'1. Open Finder\n' +
'2. Press Cmd+Shift+G\n' +
'3. Paste the copied path',
{ duration: 10000 }
);
} else {
// Fallback if clipboard access is denied
toast.message(
`Please manually navigate to: ${data.result}\n\n` +
'1. Open Finder\n' +
'2. Press Cmd+Shift+G\n' +
'3. Enter the path above',
{ duration: 10000 }
);
}
} catch (_clipboardError: unknown) {
// Fallback if clipboard API is not available
toast.message(
`Please manually navigate to: ${data.result}\n\n` +
'1. Open Finder\n' +
'2. Press Cmd+Shift+G\n' +
'3. Enter the path above',
{ duration: 10000 }
);
}
// Copy the path to clipboard
await navigator.clipboard.writeText(data.result);
toast.success('Path copied to clipboard');

// Show instructions
toast.message(
'To find your config file:\n' +
'1. Open Finder\n' +
'2. Press Cmd+Shift+G\n' +
'3. Paste the copied path'
);
}
} catch (error) {
console.error('Failed to open MCP config:', error);
Expand Down Expand Up @@ -181,7 +156,7 @@ function Settings() {
<h2 className="text-base font-medium">MCP Configuration</h2>
<div>
<label className="opacity-70 text-sm" htmlFor="mcp-config">
Configure Model Context Protocol settings by editing the config file. Srcbook will give you the file's location on your machine when you push this button.
Configure Model Context Protocol settings by editing the config file.
</label>
<div className="flex gap-2 mt-3">
<Button
Expand Down
Loading

0 comments on commit 5a67234

Please sign in to comment.