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

Fix/query page mobile #1090

Merged
merged 7 commits into from
Aug 20, 2024
Merged

Fix/query page mobile #1090

merged 7 commits into from
Aug 20, 2024

Conversation

jennieramida
Copy link
Collaborator

@jennieramida jennieramida commented Aug 15, 2024

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced mobile layout for the query page, improving overall user experience on mobile devices.
    • Added a new optional isFullWidth property to the SubmitButton, allowing it to adapt its width based on user preference.
    • Condition-based rendering of the "Format JSON" button and other components for mobile users, enhancing usability.
    • Improved interactivity in the WasmCodeSnippet component with new state management and layout customization options.
  • Bug Fixes

    • Improved responsiveness and layout adjustments for various components, ensuring better accessibility on different screen sizes.
  • Documentation

    • Updated changelog to include recent changes and improvements for user reference.

Fixes CFE-591

Copy link

vercel bot commented Aug 15, 2024

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

Name Status Preview Comments Updated (UTC)
celatone-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 5:01am
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
celatone-frontend-main ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2024 5:01am
initia-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2024 5:01am
neutron-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2024 5:01am
osmosis-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2024 5:01am
sei-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2024 5:01am
terra-celatone-frontend ⬜️ Ignored (Inspect) Visit Preview Aug 19, 2024 5:01am

Copy link

coderabbitai bot commented Aug 15, 2024

Walkthrough

This update enhances user experience on mobile devices by refining the layout and functionality of multiple components. Key improvements include conditional rendering based on device type, the introduction of new properties for greater component flexibility, and enhanced user interface elements, such as responsive buttons and modals. These changes ensure more intuitive and accessible interactions, particularly for mobile users.

Changes

Files Change Summary
src/lib/components/button/SubmitButton.tsx,
src/lib/pages/interact-contract/components/query-area/JsonQuery.tsx
Added isFullWidth property to SubmitButtonProps for full-width options; integrated into JsonQuery for improved responsiveness based on device type.
src/lib/components/json/JsonInput.tsx Integrated useMobile hook to conditionally display the "Format JSON" button, enhancing usability by hiding it on mobile devices.
src/lib/components/modal/WasmCodeSnippet.tsx Updated to include FlexProps, added optional w property to WasmCodeSnippetProps, and improved interactivity with new state management for code snippets and tabs.
src/lib/pages/interact-contract/components/query-area/JsonQuery.tsx Enhanced layout for responsiveness using useMobile, introduced a JSON formatting button that displays conditionally for mobile users, ensuring improved functionality.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant JsonQuery
    participant JsonInput
    participant WasmCodeSnippet
    participant SubmitButton

    User->>JsonQuery: Access query area
    JsonQuery->>JsonInput: Render input field
    JsonQuery->>WasmCodeSnippet: Show code snippets
    JsonQuery->>SubmitButton: Render button based on isMobile
    alt Mobile
        JsonInput->>User: Hide "Format JSON" button
        SubmitButton->>User: Display full-width button
    else Desktop
        JsonInput->>User: Show "Format JSON" button
        SubmitButton->>User: Display default width button
    end
Loading

Poem

🐇 In the fields where code snippets play,
A button now stretches, brightening the day!
With JSON formatted just right on the go,
Mobile users rejoice, their joy in full flow!
Hopping through changes, our interface gleams,
A wondrous new world, fulfilling our dreams! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@songwongtp
Copy link
Collaborator

@coderabbitai review

Copy link

coderabbitai bot commented Aug 16, 2024

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@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: 0

Outside diff range, codebase verification and nitpick comments (1)
src/lib/components/button/SubmitButton.tsx (1)

12-12: Add a description for the new property.

Consider adding a comment to describe the purpose of the isFullWidth property in the SubmitButtonProps interface. This helps maintain clarity for future developers.

// Determines if the button should take the full width of its container.
isFullWidth?: boolean;
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7bee529 and bb55bf5.

Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • src/lib/components/button/SubmitButton.tsx (2 hunks)
  • src/lib/components/json/JsonInput.tsx (3 hunks)
  • src/lib/components/modal/WasmCodeSnippet.tsx (8 hunks)
  • src/lib/pages/interact-contract/components/query-area/JsonQuery.tsx (3 hunks)
Additional comments not posted (16)
src/lib/components/button/SubmitButton.tsx (2)

20-20: Ensure backward compatibility.

The default value for isFullWidth is set to false, which is good for maintaining backward compatibility. Verify that this change does not inadvertently affect existing layouts.


41-41: Conditional width setting is appropriate.

The conditional setting of the button's width based on isFullWidth is implemented correctly. This enhances the component's flexibility in different layout scenarios.

src/lib/components/json/JsonInput.tsx (3)

6-6: New dependency on useMobile.

The addition of useMobile is appropriate for enhancing the component's responsiveness. Ensure that this hook is correctly implemented and tested across different devices.


84-84: Ensure consistent behavior with useMobile.

The integration of useMobile is well-placed for determining device type. Verify that this does not cause any unexpected behavior on non-mobile devices.


146-161: Conditional rendering of the "Format JSON" button.

The logic to hide the "Format JSON" button on mobile devices is correctly implemented. This change improves usability by simplifying the interface for mobile users.

src/lib/pages/interact-contract/components/query-area/JsonQuery.tsx (5)

7-7: New import of useMobile.

The import of useMobile is appropriate for determining device type and adapting the component's behavior. Ensure that this hook is correctly utilized throughout the component.


42-42: Appropriate use of useMobile.

The isMobile constant is correctly used to determine the device type, allowing for responsive design adjustments. This enhances the component's adaptability.


128-133: Responsive layout adjustments.

The use of responsive layout properties in the Flex component is well-implemented. This ensures better alignment and spacing, particularly for mobile views.


154-164: Conditional rendering for mobile devices.

The conditional rendering of the "Format JSON" button for mobile devices is correctly implemented. This improves the user interface by providing relevant functionality based on the device type.


172-172: Adaptive width for SubmitButton.

The use of the isFullWidth prop for the SubmitButton component ensures it occupies the full width on mobile devices, enhancing usability.

src/lib/components/modal/WasmCodeSnippet.tsx (5)

1-1: Import statement update looks good.

The addition of FlexProps from @chakra-ui/react enhances the component's layout flexibility.


51-52: Interface update is appropriate.

The addition of the w property to WasmCodeSnippetProps allows for better customization of the component's width.


79-80: State management additions are well-implemented.

The introduction of activeSnippet and activeTabIndex state variables effectively manages the currently active code snippet and tab index.


286-295: Conditional rendering logic is effective.

The use of useMobile to conditionally render the CopyButton enhances the component's responsiveness for mobile devices.


302-314: Mobile-specific rendering is well-handled.

The addition of a ModalFooter with a CopyButton for mobile devices ensures that functionality remains accessible.

CHANGELOG.md (1)

51-51: Changelog entry looks good.

The entry for PR #1090 is well-formatted and appropriately categorized under "Improvements." Including the PR number helps with traceability.

Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bb55bf5 and 4223f9c.

Files selected for processing (1)
  • src/lib/pages/interact-contract/components/query-area/JsonQuery.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/lib/pages/interact-contract/components/query-area/JsonQuery.tsx

Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4223f9c and e4a72cb.

Files selected for processing (1)
  • src/lib/components/modal/WasmCodeSnippet.tsx (8 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/lib/components/modal/WasmCodeSnippet.tsx

Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e4a72cb and 48496f0.

Files selected for processing (1)
  • src/lib/components/modal/WasmCodeSnippet.tsx (8 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/lib/components/modal/WasmCodeSnippet.tsx

@songwongtp songwongtp merged commit 4446969 into develop Aug 20, 2024
13 checks passed
@songwongtp songwongtp deleted the fix/query-page-mobile branch August 20, 2024 10:33
Copy link

linear bot commented Aug 22, 2024

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.

3 participants