Skip to content
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

feat(devtools): enhance UI/UX components and update package versions #171

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

cstrnt
Copy link
Member

@cstrnt cstrnt commented Mar 9, 2025

Summary by CodeRabbit

  • New Features

    • Enhanced the developer tools interface with collapsible sections, persistent state for expanded areas, and clear empty state messages.
    • Added an option to disable telemetry, offering improved control over data collection in preview environments.
  • Style

    • Refined component designs—including modal, input, select, switch, and chevron icons—with smoother transitions, updated labels, and modernized layouts.

Copy link

vercel bot commented Mar 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
abby-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 9, 2025 1:14pm

Copy link
Contributor

coderabbitai bot commented Mar 9, 2025

Walkthrough

This pull request updates version information and changelogs for both the web and devtools packages, adds a new Storybook configuration option, and restructures several UI components and corresponding test stories across the devtools package. The changes include switching from primitive to object-based data for certain flags and remote configuration values, enhancing the devtools interface with toggle functionality and state persistence, and refining component markup and styling.

Changes

File(s) Change Summary
apps/web/CHANGELOG.md
packages/devtools/CHANGELOG.md
Added new version entries (0.2.42 for web and 8.0.2 for devtools) with patch change details and dependency updates.
apps/web/package.json
packages/devtools/package.json
Updated package versions from "0.2.41" to "0.2.42" (web) and from "8.0.1" to "8.0.2" (devtools).
packages/devtools/.storybook/main.ts Added a new configuration option (core: { disableTelemetry: true }) to disable telemetry data collection.
packages/devtools/src/Devtools.stories.ts Modified the structure of flags and remoteConfig so that values are encapsulated in objects with a value property instead of using raw primitives.
packages/devtools/src/Devtools.svelte Introduced state management (openSections) using getSections and setSections, implemented a toggleSection function for handling section visibility, and updated animation durations.
packages/devtools/src/components/ChevronIcon.svelte
packages/devtools/src/components/Input.svelte
packages/devtools/src/components/Modal.svelte
packages/devtools/src/components/Select.svelte
packages/devtools/src/components/Switch.svelte
Added a new ChevronIcon component and restructured existing UI components with markup and style updates to improve visual presentation and interactivity.
packages/devtools/src/lib/storage.ts Added a new Sections type along with getSections and setSections functions to manage the persistence of UI section states in localStorage.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant DS as Devtools.svelte
    participant ST as Storage (getSections/setSections)
    participant LS as localStorage

    U->>DS: Load devtools interface
    DS->>ST: getSections()
    ST->>LS: Retrieve "sections" data
    LS-->>ST: Return sections state
    ST-->>DS: Return sections state
    DS->>U: Render sections (open/closed)

    U->>DS: Click toggle section button
    DS->>DS: Update openSections state
    DS->>ST: setSections(updatedState)
    ST->>LS: Store updated state
Loading

Possibly related PRs

  • feat(cli): use proper filepaths #153: Updates related to version and dependency documentation in changelogs and package files, aligning closely with the dependency management changes in this PR.
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
packages/devtools/.storybook/main.ts (1)

3-5: Good privacy practice

Adding the disableTelemetry: true option to the Storybook configuration is a positive change that enhances privacy by preventing collection of usage data.

Consider adding a comment explaining why telemetry is disabled (e.g., for privacy reasons, company policy, etc.) to provide context for other developers:

 core: {
+  // Disabled for privacy reasons
   disableTelemetry: true,
 },
packages/devtools/src/lib/storage.ts (1)

33-39: Clean implementation of section state persistence

The setSections function provides a clean way to persist section visibility state with proper error handling. Consider adding a third parameter to the localStorage key similar to how DEVTOOLS_KEY is used for showing devtools.

+ const SECTIONS_KEY = "abby-sections";
- localStorage.getItem("sections");
+ localStorage.getItem(SECTIONS_KEY);
- localStorage.setItem("sections", JSON.stringify(sections));
+ localStorage.setItem(SECTIONS_KEY, JSON.stringify(sections));
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b49a0ef and 800e0e6.

📒 Files selected for processing (13)
  • apps/web/CHANGELOG.md (1 hunks)
  • apps/web/package.json (1 hunks)
  • packages/devtools/.storybook/main.ts (1 hunks)
  • packages/devtools/CHANGELOG.md (1 hunks)
  • packages/devtools/package.json (1 hunks)
  • packages/devtools/src/Devtools.stories.ts (1 hunks)
  • packages/devtools/src/Devtools.svelte (6 hunks)
  • packages/devtools/src/components/ChevronIcon.svelte (1 hunks)
  • packages/devtools/src/components/Input.svelte (2 hunks)
  • packages/devtools/src/components/Modal.svelte (2 hunks)
  • packages/devtools/src/components/Select.svelte (1 hunks)
  • packages/devtools/src/components/Switch.svelte (1 hunks)
  • packages/devtools/src/lib/storage.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (49)
packages/devtools/CHANGELOG.md (1)

3-7: Version update properly documented

The changelog entry for version 8.0.2 clearly indicates the patch change for UI/UX improvements, which matches the version update in package.json.

apps/web/package.json (1)

3-3: Version bump looks good

The version update from 0.2.41 to 0.2.42 properly reflects the integration of updated dependencies as documented in the CHANGELOG.md.

packages/devtools/package.json (1)

3-3: Version update is consistent

The version update to 8.0.2 matches the changelog entry and follows semantic versioning principles for a patch release with UI/UX improvements.

apps/web/CHANGELOG.md (1)

3-9: Dependencies update properly documented

The changelog correctly documents the update of dependencies to @tryabby/devtools@8.0.2 and @tryabby/next@7.0.1, maintaining consistent version tracking across the project.

packages/devtools/src/components/ChevronIcon.svelte (1)

1-33: Well-structured and clean implementation of the chevron icon component

The component is cleanly implemented with a proper TypeScript prop definition, semantic HTML structure, and well-organized CSS. The icon gracefully transitions between states with a rotation animation.

packages/devtools/src/Devtools.stories.ts (2)

12-14: Object-based flag values improve extensibility

The change from primitive boolean values to objects with a value property creates a more consistent data structure that can be extended with additional metadata in the future if needed.


16-19: Consistent structure for remote config values

Similar to the flags, the remote config values have been updated to use objects with a value property, maintaining consistency across different types of data (string, number, object).

packages/devtools/src/components/Input.svelte (3)

9-28: Improved input component structure with better semantics

The new container wrapping the label and input elements creates a more cohesive UI component. The added type indicator in the label provides valuable context to users about the expected input format.


31-54: Enhanced styling with visual feedback for interaction

The new container styling with hover effects and proper spacing improves the user experience by providing visual feedback during interaction. The label styling is well-defined with appropriate font sizes and color contrast.


56-74: Refined input field styling with improved focus states

The input field styling has been refined with better padding, border-radius, and a more distinctive focus state using a colored border and subtle box shadow. The placeholder styling improves readability.

packages/devtools/src/lib/storage.ts (2)

15-19: Well-defined type for section visibility state

The Sections type clearly defines the structure for tracking visibility state of the three main sections in the devtools UI.


21-31: Robust implementation of section state retrieval

The getSections function properly handles localStorage retrieval with appropriate error handling and fallback to default values. The use of TypeScript's satisfies operator ensures type safety.

packages/devtools/src/components/Modal.svelte (18)

3-3: Good addition of fade transition to complement scale.

The addition of the fade transition provides a more polished visual effect when showing/hiding components. This complements the existing scale transition well.


9-10: Improved dialog implementation with Melt UI.

Good implementation of the more structured Melt UI dialog API. This approach creates a more accessible and standard dialog implementation.


14-14: Better button label for clarity.

Changing from "JSON Editor" to "Edit JSON" makes the button purpose clearer and follows action-verb convention for buttons.


17-17: Improved backdrop with fade transition.

Adding the fade transition to the backdrop creates a smoother opening/closing effect with proper duration.


19-19: Smoother animation with adjusted duration and scale.

Increasing the duration to 200ms and setting a more natural starting scale (0.95) creates a more polished animation effect.


24-42: Well-structured modal header with proper accessibility.

The addition of a proper header section with title and close button improves the modal's usability and accessibility. The SVG icon for close is well-implemented with appropriate attributes.


43-50: Better container structure for the editor.

Wrapping the JsonEditor in a container with fixed height and overflow settings improves the user experience by making the content area more manageable.


60-60: More descriptive button text.

Changing from "Save" to "Save Changes" provides clearer context to users about the action being performed.


70-91: Improved trigger button styling with proper states.

The updated styling for the trigger button creates a more polished and interactive UI element with proper hover and focus states for better accessibility.


98-101: Enhanced backdrop with blur effect.

The increased opacity and addition of backdrop filter creates a more modern and visually appealing overlay effect.


110-121: Improved modal content styling.

The updated styling for the content area with new background color, border radius, and shadow creates a more polished and cohesive design.


122-127: Consistent font styling.

Applying the same monospace font family to both the content and buttons ensures visual consistency throughout the component.


129-162: Well-designed modal header with good visual hierarchy.

The modal header implementation is clean with good spacing, alignment, and visual separation. The close button has proper hover states and accessibility considerations.


164-168: Fixed height container helps constrain content.

Adding a fixed height with overflow handling for the editor container improves usability by preventing the modal from growing too large.


173-176: Improved button spacing and background.

The updated button area styling with proper gap, background, and border creates a more polished and separated action area.


180-186: More modern button styling.

The updated styling for the buttons with better border radius, padding, and transitions creates a more modern and interactive design.


189-194: Enhanced cancel button.

The improved styling for the cancel button with better hover effects provides a more cohesive experience.


198-204: Visually distinctive save button.

The save button now has stronger visual weight with better color and hover effect, making the primary action more apparent.

packages/devtools/src/components/Select.svelte (5)

8-39: Improved select component structure with custom dropdown indicator.

The restructured select component with nested containers provides better layout control and adds a custom dropdown indicator for improved usability. The SVG icon clearly indicates the dropdown functionality.


42-58: Better container styling with hover effects.

The select container now has proper padding, border-radius, and a subtle hover effect that improves user interaction feedback.


60-76: Improved layout for the select wrapper and icon.

The positioning of the select wrapper and icon creates a more polished UI with proper alignment and spacing.


80-96: Enhanced select element styling with better focus state.

The select element now has improved styling with proper appearance reset, padding, border, and a distinctive focus state using the theme color.


99-102: Consistent styling for option elements.

The option elements now have consistent styling with the overall theme, improving the visual cohesion of the dropdown.

packages/devtools/src/components/Switch.svelte (5)

8-26: Improved switch component with modern toggle design.

The restructured switch component replaces the basic checkbox with a more modern toggle track and thumb design. The new structure properly associates the label with the input for better accessibility.


29-58: Enhanced container and label styling.

The switch container now has proper padding, border-radius, and hover effects. The label styling is improved with proper text overflow handling and cursor indicator.


60-66: Better hidden input implementation.

The checkbox input is properly hidden while maintaining accessibility by using opacity instead of visibility.


73-92: Well-designed toggle track and thumb.

The toggle track and thumb have appropriate dimensions, colors, and transitions for a smooth, modern toggle effect.


94-104: Proper styling for checked and focus states.

The checked and focus states are well-implemented with appropriate color changes and transitions. The focus state includes a subtle box shadow for accessibility.

packages/devtools/src/Devtools.svelte (9)

12-21: Good addition of slide transition and storage utilities.

The addition of the slide transition and storage utilities will help create smoother UI transitions and maintain state between sessions.


37-46: Well-implemented section state management.

The introduction of an object to track the open/closed state of sections with a toggle function is a good approach for managing UI state. Persisting this state through setSections enhances the user experience.


71-72: Good use of persistent storage for section state.

Loading saved section states from storage ensures user preferences are maintained between sessions.


92-92: Animation duration increase for smoother transitions.

Increasing the crossfade duration to 300ms creates smoother transitions between states.


135-138: Added environment indicator for better context.

The environment tag provides important context to users about which environment they're working with, using appropriate styling to draw attention.


141-292: Excellent section organization with collapsible UI.

The implementation of collapsible sections with headers, chevron indicators, and slide transitions creates a more organized and user-friendly interface. The empty state handling for each section provides useful feedback when there are no items to display.


294-302: Good global empty state handling.

The global empty state message provides clear guidance when no items are found across all sections.


325-325: Simplified toggle button label.

Using "Ab" as the toggle button label is concise and recognizable.


330-341: Good use of CSS variables for theming.

The introduction of CSS variables for colors, spacing, and other design elements creates a more maintainable and consistent styling approach.

Comment on lines +98 to +104
const flagsEntries = Object.entries(flags || {});
const remoteConfigEntries = Object.entries(remoteConfig || {});
const testsEntries = Object.entries(tests || {});

$: {
console.log(remoteConfigEntries);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Unnecessary console.log statement.

There's a console.log statement in a reactive block that should be removed before production.

-$: {
-  console.log(remoteConfigEntries);
-}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const flagsEntries = Object.entries(flags || {});
const remoteConfigEntries = Object.entries(remoteConfig || {});
const testsEntries = Object.entries(tests || {});
$: {
console.log(remoteConfigEntries);
}
const flagsEntries = Object.entries(flags || {});
const remoteConfigEntries = Object.entries(remoteConfig || {});
const testsEntries = Object.entries(tests || {});

@cstrnt cstrnt merged commit eab9b36 into main Mar 9, 2025
6 checks passed
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