Skip to content

ui: animate onboarding#157

Merged
reez merged 1 commit intomainfrom
animate-onb
Jan 26, 2025
Merged

ui: animate onboarding#157
reez merged 1 commit intomainfrom
animate-onb

Conversation

@reez
Copy link
Copy Markdown
Owner

@reez reez commented Jan 26, 2025

Description

Animate onboarding ui elements
Simulator Screen Recording - iPhone SE (3rd generation) - 2025-01-26 at 19 20 21

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I have formatted my code with swift-format per .swift-format file

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

Summary by CodeRabbit

  • New Features

    • Enhanced onboarding screen with smooth animations for logo, text, and buttons
    • Added visual transitions to improve user experience during initial app launch
  • Style

    • Refined UI elements with opacity and offset animations
    • Simplified network settings button presentation

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 26, 2025

Walkthrough

The pull request modifies the OnboardingView.swift to introduce a new animation mechanism for the onboarding screen. A state variable animateContent is added to control the visual transitions of text, image, and button elements. The changes enhance the view's appearance by implementing opacity and offset animations that trigger when the view appears, creating a smoother and more dynamic user interface experience.

Changes

File Change Summary
LDKNodeMonday/View/Home/OnboardingView.swift - Added @State private var animateContent = false
- Implemented animation controls for text and image elements
- Added onAppear modifier to trigger animations
- Simplified network settings button configuration

Sequence Diagram

sequenceDiagram
    participant View as OnboardingView
    participant State as animateContent
    
    View->>State: Initialize as false
    View->>View: onAppear triggered
    View->>State: Set animateContent to true
    State-->>View: Trigger opacity/offset animations
    View->>View: Render animated elements
Loading

Possibly related PRs

Poem

🐰 Hop, skip, and animate away!
Onboarding view, now in ballet
Opacity dancing, offset so light
Smooth transitions bring pure delight
A rabbit's code, with flair so bright! 🎉


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>, 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. (Beta)
  • @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
Copy Markdown
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: 0

🧹 Nitpick comments (3)
LDKNodeMonday/View/Home/OnboardingView.swift (3)

32-45: Consider using relative offset values for better responsiveness.

The fixed offset of 100 points might be too large on smaller devices. Consider using a relative value or GeometryReader.

-   .offset(x: animateContent ? 0 : 100)
+   .offset(x: animateContent ? 0 : UIScreen.main.bounds.width * 0.25)

78-96: Consider staggering the button animations.

The buttons currently animate simultaneously with the network settings (0.6s delay). A slightly longer delay for the buttons would create a more polished sequence.

-   .animation(.easeOut(duration: 0.5).delay(0.6), value: animateContent)
+   .animation(.easeOut(duration: 0.5).delay(0.8), value: animateContent)

113-117: Consider specifying animation parameters in onAppear.

While the current implementation works, explicit animation parameters in the withAnimation block would ensure consistent timing.

-   withAnimation {
+   withAnimation(.easeOut(duration: 0.3)) {
        animateContent = true
    }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6e26c62 and 4010330.

📒 Files selected for processing (1)
  • LDKNodeMonday/View/Home/OnboardingView.swift (4 hunks)
🔇 Additional comments (2)
LDKNodeMonday/View/Home/OnboardingView.swift (2)

19-19: LGTM! Well-structured state variable.

The animateContent state variable is appropriately scoped and named.


55-71: Excellent animation choreography!

Great use of:

  • Spring animation for the logo with appropriate dampingFraction
  • Cascading animations with delayed text appearance
  • Group for efficient animation application

@reez reez merged commit a9d8989 into main Jan 26, 2025
@reez reez deleted the animate-onb branch January 26, 2025 19:46
@reez
Copy link
Copy Markdown
Owner Author

reez commented Jan 26, 2025

@danielnordh seemed uncontroversial (let me know if I'm wrong though!) so just merged. I'll want to fine-tune the timing a bit more and such, but I thought it was good enough to just do now.

@danielnordh
Copy link
Copy Markdown
Collaborator

I have some general thoughts on animation, but let's discuss on our regular call.

danielnordh added a commit to danielnordh/Monday that referenced this pull request Jan 30, 2025
reez added a commit that referenced this pull request Jan 30, 2025
* Add new LoadingView

* Use AppState for start/onboarding

* Remove unused StartView and viewModel

* Add ErrorView for showing startup errors

* Move stored network to BackupInfo

* Move serverURL into BackupInfo

* Fix Picker issue where Server would not be set correctly

* Refactor naming, user server instead of esplora for futureproofing

* Remove unused parameter

* WIP, separate viewModel for NetworkSettings

* Swift format

* Refactor networksettingsviewmodel

* Use NetworkSettingsView from Settings (but doesn't yet change)

* WIP restart, but UI doesn't respond

* Swift format

* Update LDKNodeMonday/Utilities/Constants.swift

Refactor

Co-authored-by: Matthew Ramsden <6657488+reez@users.noreply.github.com>

* Fail when there is no available server

* Fix error from github commit suggestion

* WIP, guard for no saved network/server

* Create global function for availableServers

* Use general function for getting availableServers

* Swift format

* Handle errors

* Implement WalletClient, network switching works

* Move delete() logic to walletClient

* Swift format

* Don't stop node if not running

* Set network and server on node start

* Add getServer()

* Use NetworkSettingsViewModel in onboarding, create wallet on WalletClient

* Use NetworkSettingsViewModel for selected network and server

* Swift format

* Remove TODO

* Add reset() to LightningClient to handle delete properly

* Don't save on networkSettingsViewModel switch

* Un-refactor SettingsView

* Further un-refactoring of settingsview

* Swift format

* Coderabbit suggestion

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Coderabbit suggestion

* Simplify by not using NetworkSettingsViewModel

* Simplify alert logic

* Correct ldk-node version

* Use appError from WalletClient

* LDK-node package

* Swift format

* Remove unnecessary setting of tempNetwork when setting tempServer, handled in alert

* Bugfix: start with saved server

* Refactor, coderabbit suggestion

* Swift format

* Apply Onboarding animations from #157

* Remove unused parameter

* Refactor handleRestart, partial Coderabbit suggestion

---------

Co-authored-by: Matthew Ramsden <6657488+reez@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.

2 participants