Skip to content

feat(status): Implement global status bar and request body in get val… #665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

BalaSubramaniam12007
Copy link
Contributor

@BalaSubramaniam12007 BalaSubramaniam12007 commented Mar 13, 2025

PR Description

This PR introduces a Global Status Bar to provide real-time feedback on API request configurations. . The system validates and displays informative messages through a persistent status bar.

Key Features

  1. Global Status Bar: A persistent UI component that displays validation messages with appropriate visual indicators (colors and icons)
  2. State Management: Riverpod-based state management for seamless status updates throughout the application
  3. Request Validation: Initial implementation focuses on validating GET
  4. Dynamic UI: Status messages adapt their appearance based on message type (info, warning, error)

Implementation Details
The implementation follows a clean architecture pattern with clear separation of concerns:

  1. StatusMessage: Data class holding message content and type
  2. GlobalStatusBarManager: StateNotifier for managing status message state
  3. StatusValidator: Contains validation logic for API requests
  4. GlobalStatusBar: UI component for displaying status messages

Related Issues

Demonstration

demo.mp4

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: Tests will be added after implementation approach is finalized and reviewed.

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

Sorry, something went wrong.

…idation

-  Create StatusMessage model with support for info/warning/error types
- Design GlobalStatusBar UI component with dynamic styling based on status type and located at the bottom of the editorpane
-Implement GlobalStatusBarManager for state management via Riverpod
- Add StatusValidator with initial validation for GET requests with bodies

Signed-off-by: Balasubramaniam12007 <[email protected]>
@BalaSubramaniam12007
Copy link
Contributor Author

@ashitaprasad Could you please review this PR when you get a chance? This is an initial implementation with enhanced, future-extendable notifiers. Your feedback would be really valuable in improving the implementation. Thanks in advance! 😊

@animator
Copy link
Member

Does not work in dark mode

@BalaSubramaniam12007
Copy link
Contributor Author

BalaSubramaniam12007 commented Apr 27, 2025

Thanks for the feedback! I’ll fix the dark mode support and update the PR soon.

- Add JSON validation to StatusValidator for ContentType.json requests
- Implement expandable multi-line messages in GlobalStatusBar
- Optimize GlobalStatusBar with memoization and Riverpod select
- Prevent redundant state updates in GlobalStatusBarManager
- Update GET request validation to use warning type
- Supports both dark and light mode

Signed-off-by: Balasubramaniam12007 <[email protected]>
@BalaSubramaniam12007
Copy link
Contributor Author

@animator @ashitaprasad I've enhanced the GlobalStatusBar widget and its components in this PR to improve performance, add new features, and ensure compatibility with both dark and light modes. Here's a summary of the changes:

  • JSON Validation: Added simple JSON validation in StatusValidator for ContentType.json requests, detecting syntax errors and displaying error-type messages.

  • Expandable Multi-line Messages: Implemented support for multi-line messages in GlobalStatusBar with a toggle icon to expand/collapse additional lines.

  • Performance Optimizations:

    • Added memoization (_cachedLines, _lastMessage) to cache message.split('\n'), reducing redundant computations.
    • Used Riverpod select to watch message and type separately, minimizing unnecessary rebuilds.
  • Dark/Light Mode Support: Ensured GlobalStatusBar adapts colors and backgrounds dynamically based on the theme (isDarkMode), using appropriate colors (e.g., white for dark mode, black for light mode) and theme-aware surfaces.

  • These changes improve user feedback, performance, and visual consistency across themes.

Please review and let me know if any adjustments are needed. Thanks for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Global status bar in API Dash GET -> POST when user adds request body
2 participants