Skip to content

Commit b55d4b4

Browse files
port(src/ui/tea/gsa_gui.affine): ReScript surface -> AffineScript (Refs #229) (#14)
Oracle-validated Tier-1 port (affinescript main @ #229 canonical map, docs/RESCRIPT-ELIMINATION.adoc): - List(T) -> [T] (1 occurrence) - expression-position record literals { ... } -> #{ ... } (the record sigil, spec.md:414-421). Match record-PATTERNS and struct/enum/type decl bodies correctly left as { } (sigil is expression-literal-only, oracle-confirmed). - ReScript string `+` -> AffineScript `++` where present (concat is `++`; `+` is numeric — left a String/Int unify error beneath the parse wall; numeric `+`/`-` untouched). Verified: `affinescript main check src/ui/tea/gsa_gui.affine` -> Type checking passed (was: parse error / DRIFT-SYNTAX pre-port). Self-contained file, no imports. Refs #229 (estate-wide, sequenced, human-gated — not Closes). Co-authored-by: hyperpolymath <hyperpolymath@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a07de18 commit b55d4b4

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

src/ui/tea/gsa_gui.affine

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct GameServer {
3939

4040
struct Model {
4141
current_panel: Panel,
42-
managed_servers: List(GameServer),
42+
managed_servers: [GameServer],
4343
selected_server_id: String,
4444
search_query: String,
4545
is_loading: Bool,
@@ -60,7 +60,7 @@ enum Msg {
6060
// ── TEA Logic ────────────────────────────────────────────────────────────────
6161

6262
fn gsa_init() -> Model {
63-
{
63+
#{
6464
current_panel: Panel::ServerBrowser,
6565
managed_servers: [],
6666
selected_server_id: "",
@@ -75,7 +75,7 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
7575
{ current_panel: p, managed_servers: s, selected_server_id: id, search_query: q, is_loading: l, history_depth: h } => {
7676
match msg {
7777
Navigate(new_panel) => {
78-
{
78+
#{
7979
current_panel: new_panel,
8080
managed_servers: s,
8181
selected_server_id: id,
@@ -86,7 +86,7 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
8686
}
8787

8888
SelectServer(new_id) => {
89-
{
89+
#{
9090
current_panel: p,
9191
managed_servers: s,
9292
selected_server_id: new_id,
@@ -97,7 +97,7 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
9797
}
9898

9999
UpdateSearch(new_query) => {
100-
{
100+
#{
101101
current_panel: p,
102102
managed_servers: s,
103103
selected_server_id: id,
@@ -109,7 +109,7 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
109109

110110
ServerAction(sid, action) => {
111111
// This would trigger an FFI call via Command in a full impl
112-
{
112+
#{
113113
current_panel: p,
114114
managed_servers: s,
115115
selected_server_id: sid,
@@ -120,7 +120,7 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
120120
}
121121

122122
RefreshServers => {
123-
{
123+
#{
124124
current_panel: p,
125125
managed_servers: s,
126126
selected_server_id: id,
@@ -132,7 +132,7 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
132132

133133
PopState => {
134134
if h > 0 {
135-
{
135+
#{
136136
current_panel: Panel::ServerBrowser,
137137
managed_servers: s,
138138
selected_server_id: "",
@@ -141,7 +141,7 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
141141
history_depth: h - 1
142142
}
143143
} else {
144-
{
144+
#{
145145
current_panel: p,
146146
managed_servers: s,
147147
selected_server_id: id,
@@ -159,11 +159,11 @@ fn gsa_update(@linear msg: Msg, @linear model: Model) -> Model {
159159
fn gsa_view(model: Model) -> String {
160160
match model.current_panel {
161161
ServerBrowser => "GAME HUB: Discovery & Lifecycle",
162-
ConfigEditor => "CONFIG EDITOR: " + model.selected_server_id,
163-
ServerActions => "SERVER ACTIONS: " + model.selected_server_id,
164-
LiveLogs => "LIVE LOGS: " + model.selected_server_id,
162+
ConfigEditor => "CONFIG EDITOR: " ++ model.selected_server_id,
163+
ServerActions => "SERVER ACTIONS: " ++ model.selected_server_id,
164+
LiveLogs => "LIVE LOGS: " ++ model.selected_server_id,
165165
HealthDashboard => "HEALTH DASHBOARD",
166-
ConfigHistory => "CONFIG HISTORY: " + model.selected_server_id,
166+
ConfigHistory => "CONFIG HISTORY: " ++ model.selected_server_id,
167167
CrossSearch => "CROSS-SERVER SEARCH"
168168
}
169169
}

0 commit comments

Comments
 (0)