aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/ui_lib.txt
blob: 0f2c1f91b93b345fb1d45f0d20713da06fcb8842 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

User interface library
======================

Possible targets
* Desktop app (GTK, QT, Win32, ...)?
* CLI
* Voice
* Configuration file / Macro etc.
* Mobile app
* Tablet app
* Web (desktop/mobile/tablet)

UI "areas":
* Action with input (e.g. "Add contact")
    - Can have multiple steps or groups
      (targets with small screens might represent an action with steps,
       while desktop targets might 
    - There can be different levels of grouping, for example
      ((username),(password,repeat,save-pwd)),(other-field-1,...)
    - Standard actions like "Search"
      (there can be target specific ways of accessing standard actions)
    - Actions can have different types of "windows":
        - "Search" might be just a small one line entry.
        - "Add contact" might be a "wizard"
        - "Settings" might be a tabbed dialog on desktop,
          or a menu hierarchy on mobile.
    - Actions may not always be applicable
* Main task with "view areas"
    - On mobile, only the main one might be visible
      (others need to be swiped in, or accessed via a menu)
    - On desktop, non-main views might be sidebars etc.
    - Some extra views may be target specific
    - There can also be multiple tabs.
* Mode-sensitive view areas. Examples:
    - Inbox -> View message -> Reply
    - Calendar month view -> Day view -> Add item

ui:
- tasks:
    - main view:
        - tabs
    - extra views
- actions:
    - steps/groups:
        - inputs

Examples of UIs
---------------

 UI type        Main view   Tabbed  Extra views     Actions (excl. Settings)
 ---------------------------------------------------------------------------
 Text editor    Text        Yes     File list       Search, Replace, Go to line, Open, Save as
 Terminal       Console     Yes     -               Search
 Calculator     Calculator  No      Extra operators Plot graph, Unit conversion
 Mail client    Mail list   No      Folders         Search, New message, Reply, Forward
 Read e-mail    Text        No      Recip., Attactm Add contact
 Write e-mail   Text        No      Recip., Attachm Attach, Search/add recipient
 Chat           Messages    No      Channel list    Search message, Add contact, Send file/photo
 Web browser    Web page    Yes     Tabs, Bookmarks Search/enter URL, Search on page, Bookmark
 Calendar       Calendar    No      -               Add, Search, Import, Export


Backend stuff
-------------
Actions have two phases:
* Requesting input
* Operating

"Requesting input" phase is usually cancellable, and should be non-modal (but
"stay on stop") on desktop in relation to the main view (e.g. you can scroll
around in a document while deciding what name to give it when the "Save as"
action is active). But when an action that "changes" something is active,
it may or may not be possible to make changes (e.g. you can change the
document background color and change table borders at the same time, but you
might not be able to edit a document while a search is in progress)

This gives us X types of "requesting input" properties:
* Modality: Full, View-only, No
* Cancellability: Yes, No

The "operating" phase has those properties as well.

The UI should run from one thread, and any operations should spawn separate
threads and/or run in a thread pool (or asynchronously). Instead of full-blown
threads, we could also use green threads.