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

Update docs for the website #523

Merged
merged 34 commits into from
Jul 28, 2023
Merged

Update docs for the website #523

merged 34 commits into from
Jul 28, 2023

Conversation

sockeqwe
Copy link
Collaborator

DON'T merge this yet.

I try to update the docs while we merge the changes into main. Once everything new is released, we can merge this PR too.

It updates:

  • condition block replaces inStateWithCondition.

@sockeqwe
Copy link
Collaborator Author

@gabrielittner I have a hard time finding a good example for untilIdentityChanged block for the docs. Do you have one?

@gabrielittner
Copy link
Member

The simplest one I can come up with is you have a screen with search. Then you can make the search query the identity and have a collectWhileInState that uses the input state which restarts the block whenever the query changes.

@@ -0,0 +1,61 @@
# untilIdentityChanged
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gabrielittner what do you think about this example and explanation about untilIdentityChanged?

Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me 👍

Copy link
Member

@gabrielittner gabrielittner left a comment

Choose a reason for hiding this comment

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

Thanks for updating all of this it's a great improvement. I still need to read the sub state machine and testing parts, but already wanted to leave comments.

docs/dsl-cheatsheet.md Outdated Show resolved Hide resolved
docs/dsl-cheatsheet.md Outdated Show resolved Hide resolved
docs/dsl-cheatsheet.md Outdated Show resolved Hide resolved
docs/dsl-cheatsheet.md Outdated Show resolved Hide resolved
docs/dsl-cheatsheet.md Outdated Show resolved Hide resolved
docs/user-guide/onEnter.md Outdated Show resolved Hide resolved
docs/user-guide/onAction.md Outdated Show resolved Hide resolved

```kotlin
data class Error(
val cause: Throwable,
Copy link
Member

Choose a reason for hiding this comment

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

extreme nit: I really dislike Throwables in state because they lead to all these technical error messages that a user should never see but some websites and apps show to users

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, it is also hard to test s data class with exceptions. Will change that example later tonight

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated with an error message instead of throwable. Was considering removing it completely, but then the docs would change from object Error to data class Error somewhen along the way (for the error countdown example) ... Maybe we change it later

@@ -0,0 +1,61 @@
# untilIdentityChanged
Copy link
Member

Choose a reason for hiding this comment

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

Looks good to me 👍

Copy link
Member

Choose a reason for hiding this comment

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

This part is really nice

@sockeqwe
Copy link
Collaborator Author

I have updated the navigation for the page (mkdocs.yml).

I am not 100% sure if it works as expected in "production" but I think we could simply merge this PR and find it out :) 😄

This is how it should look like (at least it looks like this on my machine:

Screenshot 2023-07-27 at 23 58 20

@sockeqwe sockeqwe marked this pull request as ready for review July 27, 2023 22:17
@gabrielittner gabrielittner merged commit 4b1ae32 into main Jul 28, 2023
4 checks passed
@gabrielittner gabrielittner deleted the update_docs branch July 28, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants