Skip to content

Commit cf2dff1

Browse files
toolhive-studio-ci[bot]github-actions[bot]reyortiz3claude
authored
fix(root): add always-present drag region so window is movable on chrome-less routes (#2316) (#2317)
* fix(root): add always-present drag region so window is movable on chrome-less routes (#2316) * fix(security): override hono >=4.12.25, dompurify, @opentelemetry/core Bump hono override to >=4.12.25 and add dompurify >=3.4.7 and @opentelemetry/core >=2.8.0 overrides to clear pnpm audit findings (GHSA-88fw-hqm2-52qc and others). Resolves 14 transitive vulns to 1 low. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(security): dedupe overrides after merging main The PR-merge ref combined this branch's dompurify/@opentelemetry/core overrides with main's, producing duplicate YAML keys that pnpm rejected during setup. Drop the duplicates (keep main's higher dompurify >=3.4.9), retaining only the unique hono >=4.12.25 bump from this branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(security): cap @babel/core override below 8.0 to fix build The unbounded '@babel/core': '>=7.29.6' override (merged from main) resolved to the just-published Babel 8.0.0, whose breaking removal of Scope#references crashes the Vite/Babel transform during electron-forge make on all platforms. Bound the range to '>=7.29.6 <8.0.0' so it still patches GHSA-4x5r-pxfx-6jf8 while staying on the 7.x line. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Reynier Ortiz Vega <reynier@stacklok.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent baf046a commit cf2dff1

4 files changed

Lines changed: 127 additions & 15 deletions

File tree

pnpm-lock.yaml

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ overrides:
3939
fast-uri: '>=3.1.2'
4040
fast-xml-builder: '>=1.2.0'
4141
fast-xml-parser: 5.8.0
42-
hono: '>=4.12.23'
42+
hono: '>=4.12.25'
4343
ip-address: '>=10.2.0'
4444
lodash-es: '>=4.18.0'
4545
mermaid: '>=11.15.0'
46-
'@babel/core': '>=7.29.6'
46+
'@babel/core': '>=7.29.6 <8.0.0'
4747
dompurify: '>=3.4.9'
4848
js-yaml: '>=4.2.0'
4949
'@opentelemetry/core': '>=2.8.0'

renderer/src/routes/__root.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ function RootComponent() {
4646

4747
return (
4848
<NewsletterModalProvider>
49+
<div
50+
className="app-region-drag pointer-events-none fixed top-0 right-0
51+
left-0 z-50 h-9"
52+
/>
4953
{!hideNav && <TopNav />}
5054
{!hideNav && import.meta.env.DEV && <CustomSocketBanner />}
5155
<Main>
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import { render, waitFor } from '@testing-library/react'
2+
import { describe, it, expect, vi } from 'vitest'
3+
import {
4+
createMemoryHistory,
5+
createRootRoute,
6+
createRoute,
7+
RouterProvider,
8+
Router,
9+
} from '@tanstack/react-router'
10+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
11+
12+
vi.mock('@/common/hooks/use-restart-shutdown-servers', () => ({
13+
useRestartShutdownServers: () => undefined,
14+
}))
15+
16+
vi.mock('@/common/hooks/use-mcp-optimizer-startup-cleanup', () => ({
17+
useMcpOptimizerStartupCleanup: () => undefined,
18+
}))
19+
20+
vi.mock('../root/hooks/use-registry-error-toast', () => ({
21+
useRegistryErrorToast: () => undefined,
22+
}))
23+
24+
vi.mock('@/common/components/expert-consultation-banner', () => ({
25+
ExpertConsultationBanner: () => null,
26+
}))
27+
28+
vi.mock('@/common/components/newsletter-modal', () => ({
29+
NewsletterModal: () => null,
30+
}))
31+
32+
vi.mock('@/common/components/custom-socket-banner', () => ({
33+
CustomSocketBanner: () => null,
34+
}))
35+
36+
vi.mock('@/common/components/layout/top-nav/window-controls', () => ({
37+
WindowControls: () => null,
38+
}))
39+
40+
vi.mock('@/common/lib/os-design', () => ({
41+
getOsDesignVariant: () => 'mac',
42+
}))
43+
44+
import { Route as RootRoute } from '../__root'
45+
46+
function renderRouterAt(path: string) {
47+
const rootRoute = createRootRoute({
48+
component: RootRoute.options.component,
49+
})
50+
51+
const shutdownRoute = createRoute({
52+
getParentRoute: () => rootRoute,
53+
path: '/shutdown',
54+
component: () => <div data-testid="shutdown-content">Shutting down</div>,
55+
})
56+
57+
const cliIssueRoute = createRoute({
58+
getParentRoute: () => rootRoute,
59+
path: '/cli-issue',
60+
component: () => <div data-testid="cli-issue-content">CLI issue</div>,
61+
})
62+
63+
const indexRoute = createRoute({
64+
getParentRoute: () => rootRoute,
65+
path: '/',
66+
component: () => <div data-testid="index-content">Home</div>,
67+
})
68+
69+
const router = new Router({
70+
routeTree: rootRoute.addChildren([
71+
shutdownRoute,
72+
cliIssueRoute,
73+
indexRoute,
74+
]),
75+
history: createMemoryHistory({ initialEntries: [path] }),
76+
defaultNotFoundComponent: () => null,
77+
})
78+
79+
const queryClient = new QueryClient({
80+
defaultOptions: { queries: { retry: false } },
81+
})
82+
83+
return render(
84+
<QueryClientProvider client={queryClient}>
85+
<RouterProvider router={router} />
86+
</QueryClientProvider>
87+
)
88+
}
89+
90+
describe('Bug: window cannot be moved on chrome-less routes (macOS)', () => {
91+
it('renders a draggable region (app-region-drag) on /shutdown so the window can be moved', async () => {
92+
const { container } = renderRouterAt('/shutdown')
93+
94+
await waitFor(() => {
95+
const dragElements = container.querySelectorAll('.app-region-drag')
96+
expect(dragElements.length).toBeGreaterThan(0)
97+
})
98+
})
99+
100+
it('renders a draggable region (app-region-drag) on /cli-issue so the window can be moved', async () => {
101+
const { container } = renderRouterAt('/cli-issue')
102+
103+
await waitFor(() => {
104+
const dragElements = container.querySelectorAll('.app-region-drag')
105+
expect(dragElements.length).toBeGreaterThan(0)
106+
})
107+
})
108+
})

0 commit comments

Comments
 (0)