feat: Star on github popup in Rill developer - #9787
Conversation
AdityaHegde
left a comment
There was a problem hiding this comment.
Approving with a couple of nits
| ), | ||
| ) {} | ||
|
|
||
| public get state() { |
There was a problem hiding this comment.
nit: do we need a getter here? Cant we just use this.store.value directly?
There was a problem hiding this comment.
store is private so can't be used in tests directly.
| * Recomputed whenever the state changes; re-reading on each app load is ample | ||
| * granularity for the one-day mute to expire. | ||
| */ | ||
| public get visible() { |
There was a problem hiding this comment.
nit: same here, we just add isVisible on this class that checks this.store.value
Or if we want reactivity on visible this might be better,
this.visible = $derived.by(() => {
const now = ...
if (this.store.value.status !== "armed") return false;
return !this.store.value.mutedUntil || this.store.value.mutedUntil <= now;
})
There was a problem hiding this comment.
Inlined it into the getter and dropped the standalone helper. Kept it as a getter rather than $derived: store.value is $state, so the getter already re-renders consumers on state changes, and $derived would cache the Date.now() comparison, so the one-day mute wouldn't expire until some unrelated state change invalidated it.
Checklist: