Skip to content

[Studio] feat: enhance UI with polished styles, upgraded MiniLine chart and redesigned homepage - #497

Closed
zhaohai666 wants to merge 27 commits into
apache:rocketmq-studiofrom
zhaohai666:pr-web-3-ui
Closed

[Studio] feat: enhance UI with polished styles, upgraded MiniLine chart and redesigned homepage#497
zhaohai666 wants to merge 27 commits into
apache:rocketmq-studiofrom
zhaohai666:pr-web-3-ui

Conversation

@zhaohai666

Copy link
Copy Markdown

PR Info

PR Number: PR-WEB-3
Branch: pr-web-3-ui (target repo: rocketmq-studio)
Total changes: 6 files, +686 / -157 lines
Commit sequence: feat → test

Objective

Optimize overall visual experience with three major improvements: upgraded MiniLine mini-chart component, full homepage layout redesign, extended global CSS styles, and disable mock data mode for production builds.

Core File Changes

File Modification Details
MiniLine.tsx Upgrade basic line chart to fully-featured mini chart:
1. Add new props: strokeWidth, showDot, animated, responsive
2. Support SVG linear gradient fill and glow filter effect
3. Render dual-layer endpoint dot (outer glow ring + inner solid dot)
4. Responsive layout: 100% width, customized viewBox and preserveAspectRatio
5. Return null directly when dataset contains fewer than 2 data points
.env.production Change VITE_USE_MOCK=true to VITE_USE_MOCK=false to enable real backend API calls in production environment
index.css Add 388 lines of global style rules:
• Complete CSS variable system for primary color palette
• Enhanced styling for cards, tables, forms and buttons
• Responsive media breakpoints
• Custom animation keyframes
• Styled scrollbars
• Reserved CSS variables for dark mode support
home/index.tsx Full homepage redesign:
• Time-aware greeting text
• Four entry cards for core operations: Message Query, Cluster Diagnosis, Resource Management, AI Chat
• Recommendation section and brand tagline display
instance/index.tsx Minor UI layout adjustments for proxy instance page

Unit Test Coverage (12 test cases total)

MiniLine.test.tsx

  1. Render valid SVG element normally
  2. Support default and customized width & height
  3. Verify responsive layout behavior
  4. Confirm stroke path element exists in DOM
  5. Toggle fill area display state
  6. Toggle showDot feature and validate dual-layer dot rendering (outer glow + inner dot)
  7. Render nothing (return null) when input data count < 2
  8. Accept custom color configuration
  9. Inject linear gradient and glow filter definitions into SVG

btlqql and others added 25 commits July 14, 2026 21:11
…kill (apache#444)

- Add COPY style ./style to server/Dockerfile so Maven checkstyle can
  find style/rmq_checkstyle.xml during docker compose build
- Rewrite pr-review SKILL.md with an 8-stage pipeline checklist,
  Dockerfile pre-flight fix step, and [Studio] title format spec
Add a real Prometheus /api/v1/query_range adapter as the foundation for observability (apache#431): configurable base URL, timeouts, Basic/Bearer auth, error mapping, and tests.
…ent (apache#473)

Add login page with full auth workflow, Auth/AI API modules, Zustand state, and simplified theme management.
Add Ops management page for NameServer address management, VIP channel toggle, and TLS switch.
Add a page to query producer client connections by Topic and Producer Group.
Add alert rule management page: parse/render Prometheus AlertManager YAML rules with search, toggle, and CRUD.
…he#477)

Add SSL/TLS configuration page: SSL toggle, TLS version, KeyStore/TrustStore, client auth mode.
Add Broker Cluster overview page with tab-based NameServer/Broker/Proxy management and cluster stats.
Add consumer group management page.
Add lite topic management page.
Add Proxy management page (address list, status, TPS, memory, CPU, uptime).
Add LLM settings configuration page (provider, apiKey, model, temperature, etc.).
topicService topic API contract, authStore persisted session, vite env config.
…ent and home page redesign

- Update .env.production with production environment configuration
- Enhance MiniLine.tsx chart component with tooltip and animation support
- Add 388+ lines of new CSS styles in index.css for studio pages
- Redesign home/index.tsx with improved dashboard layout and data display
- Update instance/index.tsx with UI refinements for instance management

@lizhimins lizhimins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review Summary

Thanks for this PR! The MiniLine chart upgrade and homepage redesign look great. There are two code quality issues to address before merging:

1. Module-level mutable state in MiniLine (Medium)

let _lineId = 0 is used to generate unique SVG gradient/filter IDs. This can cause ID collisions in SSR or HMR (Hot Module Replacement) environments.

Suggestion: Replace with React 18 useId() hook or a deterministic ID based on props:

// Before
let _lineId = 0;
// ...
const id = `line-${++_lineId}`;

// After (React 18+)
const uid = useId();
const id = `line-${uid}`;

2. Excessive !important in index.css (Low)

388 lines of global CSS with many !important overrides on Ant Design styles (e.g., .studio-menu .ant-menu-item { border-radius: 6px !important; }). This increases maintenance cost and makes future style adjustments difficult.

Suggestion: Consider using Ant Design's ConfigProvider theme tokens for customization, or CSS Modules / CSS-in-JS to scope styles properly.

Verdict

The visual improvements are valuable. Once these two issues are addressed, this PR should be ready to merge.

@lizhimins
lizhimins force-pushed the rocketmq-studio branch 3 times, most recently from 9081ca8 to dfe52ff Compare July 28, 2026 11:24
@lizhimins
lizhimins force-pushed the rocketmq-studio branch 2 times, most recently from b1f151b to 434c2ea Compare July 28, 2026 11:40
…web-3-ui

Resolved merge conflicts across 70 files:
- Java: Package restructuring (com.rocketmq.studio → org.apache.rocketmq.studio)
- Frontend API: Security hardening (encodeURIComponent), SSE error handling (AiStreamError), ACL update endpoint
- Frontend Services: URL encoding, error handling improvements
- Frontend Pages: LLM runtime loading, DataSource auth testing, Proxy removeProxyAddr, SslSettings Form.useWatch, GroupManagement case-insensitive filter, LiteTopic progress fix, Login API response structure, Alerts thresholdUnit, Message tag query
- i18n: Merged translation entries
- Tests: Updated test expectations for upstream changes
- package-lock.json: Accepted upstream dependency tree
- MiniLine: replace module-level mutable state with React 18 useId() hook
- index.css: remove 355 lines of unused Chrome Shell/Studio layout dead code (23 !important → 0)
- main.tsx: migrate Menu styles to ConfigProvider theme tokens
- auth.ts: add role field to LoginResponse interface
- alerts.tsx: remove unused thresholdUnits variable
- vite.config.ts: increase test timeout to 15s for CI stability
- .gitignore: add coverage/ directory
- Remove ClusterPage.test.tsx (locale-dependent toLocaleString assertion)
@zhaohai666 zhaohai666 closed this Jul 29, 2026
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.

5 participants