@@ -58,12 +58,22 @@ Using a reactive-first approach, we'll design and implement a client-server chat
58
58
2 . In-proc service
59
59
60
60
#### Client Design
61
+ ##### Startup
62
+ 1 . Start the GUI in the following state:
63
+ 1 . Server URL and Connect button are enabled.
64
+ 2 . Chat GUI elements are disabled (including the message list and the Send button).
65
+ 2 . Load the user's settings.
66
+ 3 . If the last user name was saved, prepopulate the user name textbox.
67
+ 4 . If the last service URL was saved, prepopulate the service URL textbox.
68
+ 5 . If enabled, verify that the user's configured sound is available and it can be played.
69
+ 1 . If it cannot, display a warning to the user.
70
+
61
71
##### Connecting to the Server
62
72
1 . The user can set their "user name" before connecting.
63
73
1 . The user name from their last session is displayed by default.
64
74
2 . The user must enter a service URL and click a Connect button.
65
- 1 . When the Connect button is pressed:
66
- 1 . Disable it .
75
+ 1 . When the Connect button is pressed, and the user name is valid, and the service URL is a valid URI :
76
+ 1 . Disable the Connect button .
67
77
1 . Display a waiting animation and a Cancel button.
68
78
1 . Try connecting to the specified URL.
69
79
1 . If the connection cannot be established, or if the service URL is invalid:
@@ -81,20 +91,31 @@ Using a reactive-first approach, we'll design and implement a client-server chat
81
91
1 . If the server rejects the password:
82
92
1 . Enable the Connect button. (goto #2 )
83
93
1 . Otherwise, change the Connect button into a Disconnect button and enable it.
94
+ 1 . Enable the chat GUI so that messages may be sent and received.
95
+ 2 . Save the user name and service URL in the user's settings.
84
96
1 . When the Disconnect button is pressed:
85
97
1 . Disable it.
86
98
1 . Try disconnecting from the specified URL.
87
99
1 . If the program fails to disconnect gracefully, then log any errors and continue.
88
100
1 . Change the Disconnect button into a Connect button and enable it. (goto #2 )
101
+ 1 . Disable the chat GUI to prevent messages from being sent or received.
89
102
90
103
##### Receiving Messages
91
- 1 . TODO
104
+ 1 . When a message is received:
105
+ 1 . If the user's status is not "busy" and the message matches the user's current filter criteria (if any):
106
+ 1 . Append the message to the message list.
107
+ 1 . Include the date and/or time based on the user's current settings.
108
+ 1 . Render the message in the font, size and color received with the message. If none received, use defaults.
109
+ 1 . If the option to play a sound is enabled, and the chat window is not currently in focus:
110
+ 1 . Play the user's configured sound.
92
111
93
112
##### Sending Messages
94
- 1 . TODO
113
+ 1 . When the 'Enter' key is pressed or the 'Send' button is clicked:
114
+ 1 . If the message is not entirely whitespace:
115
+ 1 . Send the message to the server.
116
+ 1 . Include the current font, size and color with the message. Omit them if they are currently the defaults.
95
117
96
118
#### Server Design
97
-
98
119
##### Startup and Configuration
99
120
1 . TODO
100
121
0 commit comments