about summary refs log tree commit diff stats
path: root/browse_slack/environment.mu
blob: 8f68a3fa98d735d0cfb76ca293a9f1f0deb1e26c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# The environment is a thin layer in this app, just a history of 'tabs' that
# are fully specified by the operations used to generate them.

type environment {
  tabs: (handle array tab)
  current: int  # index into tabs
}

type tab {
  type: int
  # type 0: items by a user
  # type 1: items in a channel
  # type 2: comments for a post
  # type 3: items containing a search (TODO)
  root-index: int  # into either users, items or comments
  item-index: int  # what item in the corresponding list we start rendering
                   # the current page at
  grapheme-index: int  # what character in the item we start rendering
                       # the current page at
}

fn render-environment env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr array item) {
}

fn update-environment env: (addr environment), key: byte {
}