If items had identifiers, then I would have some notion of an optional
current item in the model or an "except this item" in the filter portion of
the model and then have the filter not remove the current item. This can be
extended to handle sets of selected items in a natural way. Basically, you
want a filter that says "all unread items plus this other item even if it
happens to have been read". So, you just need a way to indicate that other
item.

Mark

On Tue, Oct 18, 2016 at 8:11 PM, Jacky See <jacky...@gmail.com> wrote:

> Here is a simplified scenario:
>
>     type alias Item = { text : String, readState : ReadState, ... }
>
>     type ReadState = Read | Unread
>
>     type alias Model = { items : List Item }
>
> In the item list view, there is a filter switch: All or Unread.
> When the 'Unread' switch is on, it lists all unread items.
>
> Item can be marked as 'Read' by clicking on a item's button,
> but then the item immediately disappeared from the filtered list view,
> which brings bad user experience.
>
> I'm thinking how should I model such that the just clicked 'unread'
> item remains on the filtered list until some other refresh happen?
> How to model this 'to be Read' state?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to