-
Notifications
You must be signed in to change notification settings - Fork 32
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
[tips] prioritized bubble opening #625
base: master
Are you sure you want to change the base?
Conversation
Adds a `priority` parameter to `Os_tips.bubble`, and changes the tips system to open bubbles on a given order.
(* We wait for the elements to load, | ||
to be sure we have all waiters prioritized *) | ||
let%lwt () = onload_waiter () in | ||
if not !sorted then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ocamlformat failed. We should probably add a commit hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed? Do we have a .ocamlformat
in this repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damned. Only in the template 😭
src/os_tips.eliom
Outdated
to be sure we have all waiters prioritized *) | ||
let%lwt () = onload_waiter () in | ||
if not !sorted then | ||
(prioritized_waiters := List.rev !prioritized_waiters; sorted := true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not sorting in reverse order directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would reverse the call-order too. On priority equality, first calls are inserted first, thus later in the list. We have no other reliable way to keep this order than reversing the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, I'm currently sorting the list on every addition, which is suboptimal. I'll move the sort to this place so we only do it once (per batch)
Adds a
priority
parameter toOs_tips.bubble
,and changes the tips system to open bubbles on a given order.
Behaviour on absent
priority
is unchanged.