Skip to content

Conversation

@calycekr
Copy link

Why submit this pull request?

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What changes will this PR take into?

This PR enhances the dashboard's UI/UX for better operator experience.

Screenshots

image image image

1. JSON View for Advanced Users

  • Add JSON editing mode for all Add and Detail pages
  • Direct JSON editing for power users who prefer raw configuration
  • Toggle between Form View and JSON View with unsaved changes warning
  • Preview JSON output while in Form mode

2. Form View Improvements

  • Inline editing from list pages via action menu (no page navigation needed)
  • Form/JSON edit drawers for quick modifications
  • Improved button layout and form sections
  • Better field descriptions and placeholders

3. Table View Improvements

  • Add search functionality with debounced input
  • Enable table options: reload, density toggle, column visibility
  • Add informative columns:
    • Routes: Methods, Hosts, Status
    • SSLs: Type, Expiration (with color-coded badges)
    • Consumers: Group ID, Plugins
    • Upstreams: Type, Nodes count
  • Fix tooltip overflow causing layout shift

New Components

Component Description
FormEditDrawer Form editing in side drawer
JSONEditDrawer JSON editing in side drawer
JSONEditorView JSON editor with Monaco
PreviewJSONModal Preview JSON output from form
SafeTabSwitch Tab switch with unsaved changes warning
TableActionMenu Kebab menu for table row actions
RouteList Reusable route list component
StreamRouteList Reusable stream route list component
ToAddPageBtn Add button with Form/JSON dropdown

New Hooks

Hook Description
useDirtyState Track form dirty/unsaved state
useTableSearch Reusable table search logic
useUnifiedResourceState Unified state management for resources
useUnifiedRouteState Route-specific state management

New Utils

Utility Description
json-transformer.ts JSON transformation utilities
route-transformer.ts Route data transformation

Related issues

N/A (improvement based on user experience)

Checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

- Add Form/JSON mode toggle for all Add pages via ?mode=json search param
- Add Form/JSON mode toggle for all Detail pages with edit capability
- Add TableActionMenu component with kebab dropdown for list pages
- Add FormEditDrawer and JSONEditDrawer for inline editing from lists
- Add PreviewJSONButton to preview JSON output in Form mode
- Simplify JSON templates to contain only required fields
- Improve button layout: Preview JSON on left, Cancel/Save on right
- Add resource-specific name placeholders (my-route-name, my-service-name, etc.)

New components:
- FormEditDrawer, JSONEditDrawer, JSONEditorView
- PreviewJSONModal, SafeTabSwitch, TableActionMenu
- Add toolbar search with debounced input across all list pages
- Enable ProTable options (reload, density, column settings)
- Add new columns: Methods, Hosts, Status for Routes; Type, Expiration for SSLs;
  Group ID, Plugins for Consumers; Type, Nodes for Upstreams
- Add ellipsis for long text columns to prevent overflow
- Fix tooltip overflow causing layout shift via CSS
- Reduce PageHeader spacing for tighter layout
- Extract RouteList and StreamRouteList as reusable components
- Add useTableSearch custom hook for code reuse
- Fix RespStreamRouteItem type referencing wrong schema
- Add validity_start/validity_end to SSL schema
- Add id, uri search params to pageSearchSchema
- Improve detail page button layout (Preview JSON left, Cancel/Save right)
- Add translations for table.methods, table.hosts in all locales
The onSuccess callback from page components returns a Promise from
queryClient.invalidateQueries(). Without awaiting it, the drawer
closes before the list query invalidation completes, causing the
table to not refresh after saving.
Copilot AI review requested due to automatic review settings January 29, 2026 18:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR significantly enhances the APISIX Dashboard's UI/UX by introducing dual-mode editing (Form/JSON), inline table editing via drawers, improved search functionality, and better table views with additional informative columns. The changes affect list pages, add pages, and introduce several reusable components and hooks for consistent behavior across resources.

Changes:

  • Added JSON editing mode for all resource pages alongside the traditional form view
  • Introduced inline editing drawers (Form and JSON) accessible from table action menus for quick modifications
  • Enhanced table views with search, additional columns (methods, hosts, status, plugins, etc.), and better visual indicators
  • Created reusable components and hooks for consistent state management and UI patterns

Reviewed changes

Copilot reviewed 82 out of 82 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/route-transformer.ts Route data transformation utilities for API/Form/JSON conversions
src/utils/json-transformer.ts Generic JSON transformation utilities
src/hooks/useDirtyState.ts Hook for tracking unsaved changes with deep comparison
src/hooks/useTableSearch.ts Reusable table search with debouncing
src/hooks/useUnifiedRouteState.ts Route-specific unified state management
src/components/page/FormEditDrawer.tsx Form editing in side drawer
src/components/page/JSONEditDrawer.tsx JSON editing in side drawer
src/components/page/JSONEditorView.tsx Monaco-based JSON editor component
src/components/page/PreviewJSONModal.tsx JSON preview modal for form data
src/components/page/SafeTabSwitch.tsx Tab switching with unsaved changes warning
src/components/page/TableActionMenu.tsx Kebab menu for table row actions
src/components/page/RouteList.tsx Reusable route list component
src/components/page/StreamRouteList.tsx Reusable stream route list component
src/components/page/ToAddPageBtn.tsx Enhanced with dropdown for Form/JSON selection
src/routes/**/*.tsx Multiple routes updated with Form/JSON mode support and inline editing
src/types/schema/*.ts Schema updates for SSL expiration, StreamRoute type fix, pageSearch extensions
src/locales/**/common.json Translation additions for new UI features
src/styles/global.css CSS fixes for tooltips and editor styling
src/components/form-slice/**/*.tsx Form improvements with descriptions and better styling
e2e/tests/**/*.spec.ts Minor formatting improvements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

calycekr and others added 2 commits January 30, 2026 03:19
- Set sensible defaults for upstream node: port=80, weight=1
- Remove placeholder from Service ID field

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Previously, upstream nodes were only synced to react-hook-form when
clicking outside the table (useClickOutside). This caused data loss
when users edited nodes and clicked Save without clicking elsewhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant