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

docs: use_render_queue, use_liveness_scope, use_table_listener docs #1044

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

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Nov 26, 2024

- Adding some more missing hooks documentation
- Closes deephaven#823, closes deephaven#659
- Remove the API reference to use_render_queue. The autodoc doesn't work correctly if the function has no parameters
- Remove redundant information from the README at the base
- Update signature for use_table_listener
@@ -0,0 +1,31 @@
# use_row_data

`use_row_data` lets you use the data of the first row of a table. This is useful when you want to listen to an updating table and use the data in your component.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not entirely clear what the format of a row of data is here by just looking at the document. Perhaps a contrast with use_row_list as someone would likely be trying to figure out which they want of those two.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll specify one returns a dictionary and the other returns a list in the intro paragraph.

plugins/ui/docs/hooks/use_render_queue.md Show resolved Hide resolved
plugins/ui/docs/hooks/use_liveness_scope.md Outdated Show resolved Hide resolved
plugins/ui/docs/hooks/use_liveness_scope.md Outdated Show resolved Hide resolved
plugins/ui/docs/hooks/use_liveness_scope.md Outdated Show resolved Hide resolved
my_toast_table = toast_table(_source)
```

The above example listens to table updates and displays a toast message when the table updates. The `toast` function must be triggered on the render thread, whereas the listener is not fired on the render thread. Therefore, you must use the render queue to trigger the toast.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would useful to define toast or link to its docs - comes out of nowhere.

plugins/ui/docs/hooks/use_render_queue.md Outdated Show resolved Hide resolved
plugins/ui/docs/hooks/use_table_listener.md Outdated Show resolved Hide resolved
@@ -0,0 +1,84 @@
# use_table_listener

`use_table_listener` lets you listen to a table for updates. This is useful when you want to listen to a table and perform an action when the table updates.
Copy link
Contributor

Choose a reason for hiding this comment

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

The "this is an advanced feature" caveat should be mentioned in the paragraph, IMO. Stop someone in their tracks before getting to UI recommendations.

plugins/ui/docs/hooks/use_table_listener.md Outdated Show resolved Hide resolved
mofojed and others added 2 commits December 12, 2024 09:31
- Specify list or dict for the row_data vs row_list methods
- Add link to toast
- Add warning in the use_table_listener hook intro paragraph
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.

docs: use_liveness_scope deephaven.ui hooks documentation
3 participants