Skip to content
Draft
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
1 change: 1 addition & 0 deletions e2e/tests/consumer_groups.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const consumerGroups: APISIXType['ConsumerGroupPut'][] = Array.from(

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllConsumerGroups(e2eReq);
await Promise.all(
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/consumers.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const consumers: APISIXType['ConsumerPut'][] = Array.from({ length: 11 }, (_, i)

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllConsumers(e2eReq);
await Promise.all(consumers.map((d) => putConsumerReq(e2eReq, d)));
Expand Down
3 changes: 3 additions & 0 deletions e2e/tests/hot-path.upstream-service-route.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test('can create upstream -> service -> route', async ({ page }) => {
scheme: 'https',
nodes: [{ host: 'httpbin.org', port: 443 }],
};

await test.step('create upstream', async () => {
// Navigate to the upstream list page
await upstreamsPom.toIndex(page);
Expand Down Expand Up @@ -158,6 +159,7 @@ test('can create upstream -> service -> route', async ({ page }) => {
},
},
} satisfies Partial<APISIXType['Service']>;

await test.step('create service', async () => {
// upstream id should be set
expect(service.upstream_id).not.toBeUndefined();
Expand Down Expand Up @@ -275,6 +277,7 @@ test('can create upstream -> service -> route', async ({ page }) => {
},
},
};

await test.step('create route', async () => {
// service id should be set
expect(route.service_id).not.toBeUndefined();
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/plugin_configs.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const pluginConfigs: APISIXType['PluginConfigPut'][] = Array.from(

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllPluginConfigs(e2eReq);
await Promise.all(pluginConfigs.map((d) => putPluginConfigReq(e2eReq, d)));
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/protos.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ message TestMessage${i + 1} {

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
// Delete all existing protos
const existingProtos = await e2eReq
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/routes.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const routes: APISIXType['Route'][] = Array.from({ length: 11 }, (_, i) => ({

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllRoutes(e2eReq);
await Promise.all(routes.map((d) => putRouteReq(e2eReq, d)));
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/services.crud-required-fields.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test('should CRUD service with required fields', async ({ page }) => {

await servicesPom.getAddServiceBtn(page).click();
await servicesPom.isAddPage(page);

await test.step('submit with required fields', async () => {
await uiFillServiceRequiredFields(page, {
name: serviceName,
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/services.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const services: APISIXType['Service'][] = Array.from({ length: 11 }, (_, i) => (

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllServices(e2eReq);
await Promise.all(
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/stream_routes.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const streamRoutes: APISIXType['StreamRoute'][] = Array.from(

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllStreamRoutes(e2eReq);
await Promise.all(
Expand Down
1 change: 1 addition & 0 deletions e2e/tests/upstreams.list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const upstreams: APISIXType['Upstream'][] = Array.from(

test.describe('page and page_size should work correctly', () => {
test.describe.configure({ mode: 'serial' });

test.beforeAll(async () => {
await deleteAllUpstreams(e2eReq);
await Promise.all(upstreams.map((d) => putUpstreamReq(e2eReq, d)));
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@mantine/hooks": "^8.0.0",
"@mantine/modals": "^8.0.0",
"@mantine/notifications": "^8.0.0",
"@mantine/spotlight": "^8.3.15",
"@monaco-editor/react": "^4.7.0",
Comment on lines 20 to 24

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

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

@mantine/spotlight is pinned to 8.3.15, but the repo is currently locked to @mantine/core/@mantine/hooks 8.3.12 (see pnpm-lock peer deps). Please align Mantine package versions (core/hooks/spotlight/store) to the same patch version to avoid peer-dependency mismatches and potential runtime issues.

Copilot uses AI. Check for mistakes.
"@tanstack/react-query": "^5.74.4",
"@tanstack/react-router": "^1.116.0",
Expand Down Expand Up @@ -102,11 +103,12 @@
"overrides": {
"lodash": ">=4.17.21",
"minimatch": ">=3.0.5",
"@swc/core": "1.10.0"
"@swc/core": "1.10.0",
"@iconify/utils": "3.0.1"
},
"onlyBuiltDependencies": [
"@swc/core",
"esbuild"
]
}
}
}
28 changes: 28 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions src/components/GlobalSpotlight.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ActionIcon } from '@mantine/core';
import { Spotlight, spotlight } from '@mantine/spotlight';
import { useNavigate } from '@tanstack/react-router';
import { useTranslation } from 'react-i18next';

import { navRoutes } from '@/config/navRoutes';
import IconClose from '~icons/material-symbols/close';
import IconDashboard from '~icons/material-symbols/dashboard-outline';
import IconSearch from '~icons/material-symbols/search';

export const GlobalSpotlight = () => {
const { t } = useTranslation();
const navigate = useNavigate();

const actions = navRoutes.map((route) => ({
id: route.to,
label: t(`sources.${route.label}`),
description: t('spotlight.jumpToDashboard', { resource: t(`sources.${route.label}`) }),
leftSection: <IconDashboard style={{ width: 18, height: 18, opacity: 0.7 }} />,
onClick: () => {
navigate({ to: route.to });
},
}));

return (
<Spotlight
actions={actions}
nothingFound={t('noData')}
highlightQuery
scrollAreaProps={{ type: 'always', offsetScrollbars: true, mah: 400 }}
searchProps={{
leftSection: <IconSearch style={{ width: 22, height: 22 }} />,
placeholder: 'Search resources... (Ctrl + K)',
rightSectionPointerEvents: 'all',
Comment on lines +48 to +50

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

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

The search input placeholder is hard-coded English and advertises only "Ctrl + K" even though the shortcut is typically platform-dependent (Cmd on macOS). This should be localized and either display a neutral "Mod + K" label or render the correct key combo per platform.

Copilot uses AI. Check for mistakes.
rightSection: (
<ActionIcon
variant="subtle"
color="gray"
onClick={(e) => {
e.preventDefault();
spotlight.close();
}}
>
<IconClose style={{ width: 18, height: 18 }} />
</ActionIcon>
),
}}
/>
);
};
1 change: 1 addition & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
import '@mantine/core/styles.css';
import '@mantine/notifications/styles.css';
import '@mantine/spotlight/styles.css';
import './styles/global.css';

import { createTheme, MantineProvider } from '@mantine/core';
Expand Down
2 changes: 2 additions & 0 deletions src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { createRootRoute, HeadContent, Outlet } from '@tanstack/react-router';
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools';
import { I18nextProvider } from 'react-i18next';

import { GlobalSpotlight } from '@/components/GlobalSpotlight';
import { Header } from '@/components/Header';
import { Navbar } from '@/components/Navbar';
import { SettingsModal } from '@/components/page/SettingsModal';
Expand Down Expand Up @@ -55,6 +56,7 @@ const Root = () => {
<TanStackRouterDevtools />
<ReactQueryDevtools initialIsOpen={false} />
<SettingsModal />
<GlobalSpotlight />
</I18nextProvider>
Comment on lines 56 to 60

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

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

The new global Spotlight feature is user-facing but has no automated coverage. Given the existing Playwright e2e suite, add a test that triggers the palette via the keyboard shortcut and verifies selecting an action navigates to the expected page.

Copilot uses AI. Check for mistakes.
);
};
Expand Down
Loading