about summary refs log tree commit diff stats
path: root/browse-slack/environment.mu
diff options
context:
space:
mode:
Diffstat (limited to 'browse-slack/environment.mu')
-rw-r--r--browse-slack/environment.mu26
1 files changed, 26 insertions, 0 deletions
diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu
new file mode 100644
index 00000000..8f68a3fa
--- /dev/null
+++ b/browse-slack/environment.mu
@@ -0,0 +1,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 {
+}