Skip to content

Last read indicator #150

Description

@matthewrfennell

It could be useful to let the user pass the last read message, e.g.

ChatView(messages: messages, lastRead: lastReadMessage) { draft in
    yourViewModel.send(draft: draft)
}

Where lastRead has type Message? and a default value of nil.

This could then show a view above or below that particular message, telling the user everything since then is unread.

I had a brief look at how I could implement it. Here's what I am thinking:

  • Introduce an enum Row that contains MessageRow and a new LastReadRow
  • Modify MessageSection's rows to be of type [Row]
  • Modify WrappingMessages to return this new Row instead of MessageRow
  • Modify UIList's tableView(_:cellForRowAt:) to take a Row and return a ChatMessageView or ChatLastReadView as appropriate

I think this refactoring could also be useful to allow other non-message cells in the future, such as status messages, which are not really messages but could still be shown in their own cells.

I'd be happy to work on this if you think it would be useful. Let me know what you think!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions