cwtch-ui/SPEC.md

5.5 KiB

Specification

This document outlines the minimal functionality necessary for us to consider Flwtch the canonical Cwtch UI implementation.

This functionality is implemented in libCwtch and so this work captures just the UI work required - any new Cwtch work is beyond the scope of this initial spec.

Functional Requirements

  • Kill all processes / isolates on exit (Blocked - P1)
  • Android Service? (P1)

Splash Screen

Custom Styled Widgets

  • Label Widget
    • Initial
    • With Accessibility / Zoom Integration (P1)
  • Text Field Widget
  • Password Widget
  • Text Button Widget (for Copy)

Home Pane (formally Profile Pane)

  • Unlock a profile with a password
  • Create a new Profile
    • With a password
    • Without a password
  • Display all unlocked profiles
    • Profile Picture
      • default images
      • custom images (P3)
      • coloured ring border (P2)
    • Profile Name
    • Edit Button
    • [X Unread messages badge (P2)
  • Navigate to a specific Profile Contacts Pane (when clicking on a Profile row)
  • Navigate to a specific Profile Management Pane (edit Button)
  • Navigate to the Settings Pane (Settings Button in Action bar)

Settings Pane

  • Save/Load
  • Switch Dark / Light Theme
  • Switch Language
  • Enable/Disable Experiments
  • Accessibility Settings (Zoom etc. - needs a deep dive into flutter) (P1)
  • Display Build & Version Info
  • Acknowledgements & Credits

Profile Management Pane

  • Update Profile Name
  • Update Profile Password
  • Error Message When Attempting to Update Password with Wrong Old Password (P2)
  • Easy Transition from Unencrypted Profile -> Encrypted Profile (P3)
  • Delete a Profile (P2)
    • Dialog Acknowledgement (P2)
    • Require Old Password Gate (P2)
    • Async Checking of Password (P2)
  • Copy Profile Onion Address

Profile Pane (formally Contacts Pane)

  • Display Profile-specific status
    • Profile Name
    • Online Status
    • Add Contact Button Navigates to Add Contact Pane
  • Search Bar (P2)
    • Search by name
    • Search by Onion
  • Display all Peer Contacts
    • Profile Picture
    • Name
    • Onion
    • Online Status
    • Unread Messages Badge (P1)
    • In Order of Most Recent Message / Activity (P1)
    • With Accept / Reject Heart/Trash Bin Option (P1)
    • Separate list area for Blocked Contacts (P1)
  • Display all Group Contacts (if experiment is enabled)
  • Navigate to a specific Contact or Group Message Pane (Contact Row)
  • Pressing Back should go back to the home pane

Add Contact Pane

  • Allowing Copying the Profile Onion Address for Sharing
  • Allowing Pasting a Peer Onion Address for adding to Contacts
    • (with optional name field)
  • Allowing Pasting a Group Invite / Server Address
    • (if group experiment is enabled)

Message Overlay

  • Display Messages from Contacts
  • Allowing copying the text of a specific message (on mobile) (P2)
  • Send a message to the specific Contact / Group
  • [~] Display the Acknowledgement status of a message (P1)
  • Navigate to the specific Contact or Group Settings Pane ( Settings Button in Action bar)
  • Emoji Support (P1)
    • Display in-message emoji text labels e.g. :label: as emoji. (P1)
    • Functional Emoji Drawer Widget for Selection (P2)
    • Mutant Standard? (P2)
  • Display a warning if Contact / Server is offline (Broken Heart) (P1)
  • Display a warning for configuring peer history (P2)
  • Pressing Back should go back to the contacts pane

List Overlay (P3)

  • Add Item to List (P3)
  • mark Item as Complete (P3)
  • Delete Item from List (P3)
  • Search List (P3)

Bulletin Overlay (P4)

Contact Settings Pane

  • Update local name of contact
  • Copy contact onion address
  • Block/Unblock a contact
  • Configure Peer History Saving
  • Pressing Back should go back to the message pane

Group Settings Pane (experimental - P3)

  • Gated behind group experiment
  • Update local name of group
  • Get Group Invite
  • Leave Group
  • Pressing Back should go back to the message pane for the group

Android Requirements Notes

What are our expectations here?

  • Can we periodically check groups in the background to power notifications?

  • Either way we need networking in the service not the main/UI thread.

  • We probably don't want to and very likely can't persist tor connections to peers indefinitely.

  • Neither google nor apple are very tolerant of apps that try to create their own push message infrastructure.

  • "Aside": Retrieving a CallbackHandle for a method from PluginUtilities.getCallbackHandle has the side effect of populating a callback cache within the Flutter engine, as seen in the diagram above. This cache maps information required to retrieve callbacks to raw integer handles, which are simply hashes calculated based on the properties of the callback. This cache persists across launches, but be aware that callback lookups may fail if the callback is renamed or moved and PluginUtilities.getCallbackHandle is not called for the updated callback.

  • The above seems to imply that there is a persistent cache somewhere that can affect code between launches...the ramifications of this are ?!?!