lycheedev 2.5.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/windows-amd64/lycheedev.exe +0 -0
- package/package.json +1 -1
- package/payload/addon/Bridge/ActivityView.lua +26 -12
- package/payload/addon/Bridge/InputProtection.lua +63 -0
- package/payload/addon/Bridge/InputSignal.lua +36 -0
- package/payload/addon/Bridge/InputState.lua +93 -0
- package/payload/addon/Bridge/MemoryProtocol.lua +31 -0
- package/payload/addon/Bridge/ProbeExecution.lua +147 -0
- package/payload/addon/Bridge/ReceiverBindings.lua +6 -0
- package/payload/addon/Bridge/SlotProtocol.lua +172 -0
- package/payload/addon/Bridge/SlotRuntime.lua +125 -0
- package/payload/addon/Bridge/StartupBeacon.lua +8 -11
- package/payload/addon/Core/Compat.lua +16 -0
- package/payload/addon/Core/Controls.lua +16 -0
- package/payload/addon/Core/Locale.lua +6 -4
- package/payload/addon/Core/Locale_enUS.lua +4 -2
- package/payload/addon/Core/Platform.lua +4 -2
- package/payload/addon/Core/Runtime.lua +17 -6
- package/payload/addon/Lychee Dev.toc +9 -2
- package/payload/addon/Modules/AutomationHistory.lua +119 -0
- package/payload/addon/Modules/AutomationView.lua +26 -6
- package/payload/addon/UI/Pages/About.lua +0 -3
- package/payload/addon/UI/Pages/Automation.lua +40 -27
- package/payload/addon/UI/Pages/Diagnostics.lua +2 -4
- package/payload/addon/UI/Pages/Object.lua +0 -1
- package/payload/addon/UI/Pages/Run.lua +2 -1
- package/payload/addon/UI/Pages/Trace.lua +0 -1
- package/payload/addon/UI/Theme.lua +3 -2
- package/payload/addon/UI/Widgets.lua +32 -22
- package/payload/addon/UI/Window.lua +3 -35
- package/payload/skill/SKILL.md +89 -162
- package/payload/skill/agents/openai.yaml +2 -2
- package/payload/skill/references/asset-export.md +1 -1
- package/payload/skill/references/commands.md +37 -35
- package/payload/skill/references/data-hotfix.md +112 -0
- package/payload/skill/references/data-investigation.md +74 -320
- package/payload/skill/references/data-recovery.md +55 -0
- package/payload/skill/references/data-tables.md +170 -0
- package/payload/skill/references/data-targets.md +93 -0
- package/payload/skill/references/error-diagnosis.md +8 -12
- package/payload/skill/references/installation.md +20 -13
- package/payload/skill/references/live-investigation.md +84 -367
- package/payload/skill/references/live-probes.md +160 -0
- package/payload/skill/references/live-recovery.md +190 -0
- package/payload/skill/references/live-startup.md +63 -133
- package/payload/skill/references/runtime-investigations.md +17 -3
- package/payload/skill/references/source-preparation.md +58 -0
- package/payload/skill/references/source-relations.md +51 -0
- package/payload/skill/references/source-research.md +66 -162
- package/payload/skill/references/source-value-flow.md +48 -0
- package/release.json +155 -75
- package/payload/addon/UI/Pages/Settings.lua +0 -82
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
local _, ns = ...
|
|
2
|
+
|
|
3
|
+
-- A bounded, per-character display history, not an execution/recovery journal.
|
|
4
|
+
-- SavedVariables flush on reload/logout. The CLI's project journal owns durable
|
|
5
|
+
-- evidence and retries; these records must never authorize execution.
|
|
6
|
+
local MAX_RECORDS, REPORT_BYTES = 100, 32 * 1024
|
|
7
|
+
local runtime, identity
|
|
8
|
+
local statuses = { loaded=true, running=true, reported=true, acknowledged=true, interrupted=true }
|
|
9
|
+
local phases = { prepared="loaded", running="running", reported="reported", released="acknowledged" }
|
|
10
|
+
local fields={requestId=true,runtime=true,nonce=true,observedAt=true,codeBytes=true,codeAdler32=true,
|
|
11
|
+
character=true,realm=true,guid=true,build=true,product=true,status=true,pending=true,hasReport=true,
|
|
12
|
+
reportBody=true,reportTruncated=true,probeStatus=true,errorCode=true}
|
|
13
|
+
local function safe(v) return not (issecretvalue and issecretvalue(v)) end
|
|
14
|
+
local function plain(v) return safe(v) and type(v)=="table" and getmetatable(v)==nil end
|
|
15
|
+
local function text(v,n) return safe(v) and type(v)=="string" and #v<=n end
|
|
16
|
+
local function number(v) return safe(v) and type(v)=="number" and v>=0 and v<math.huge and v%1==0 end
|
|
17
|
+
local function preview(body)
|
|
18
|
+
local last=math.min(#body,REPORT_BYTES)
|
|
19
|
+
-- CaptureWriter supplies UTF-8. Never persist half of its last codepoint.
|
|
20
|
+
if #body>last then
|
|
21
|
+
local nextByte=body:byte(last+1)
|
|
22
|
+
if nextByte>=128 and nextByte<192 then
|
|
23
|
+
while last>0 and body:byte(last)>=128 and body:byte(last)<192 do last=last-1 end
|
|
24
|
+
last=last-1
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
return body:sub(1,last)
|
|
28
|
+
end
|
|
29
|
+
local function valid(record)
|
|
30
|
+
if not plain(record) or not text(record.requestId,68) or not record.requestId:match("^MEM%-%x+$")
|
|
31
|
+
or not text(record.runtime,32) or not text(record.status,16) or not statuses[record.status]
|
|
32
|
+
or not number(record.observedAt) or not number(record.codeBytes) then return false end
|
|
33
|
+
for key in pairs(record) do if not safe(key) or not fields[key] then return false end end
|
|
34
|
+
for key,limit in pairs({nonce=32,character=256,realm=256,guid=128,build=64,product=32,
|
|
35
|
+
codeAdler32=16,reportBody=REPORT_BYTES,probeStatus=16,errorCode=128}) do
|
|
36
|
+
if record[key]~=nil and not text(record[key],limit) then return false end
|
|
37
|
+
end
|
|
38
|
+
for _,key in ipairs({"pending","hasReport","reportTruncated"}) do
|
|
39
|
+
if not safe(record[key]) or (record[key]~=nil and type(record[key])~="boolean") then return false end
|
|
40
|
+
end
|
|
41
|
+
return true
|
|
42
|
+
end
|
|
43
|
+
local function store(create)
|
|
44
|
+
local root,reason=ns.Persistence.Bridge()
|
|
45
|
+
if not root then return nil,reason end
|
|
46
|
+
local saved=root.automationHistory
|
|
47
|
+
if saved==nil and create then saved={schema=1,records={}};root.automationHistory=saved end
|
|
48
|
+
if saved==nil then return nil end
|
|
49
|
+
if not plain(saved) or not safe(saved.schema) or saved.schema~=1 or not plain(saved.records) then
|
|
50
|
+
return nil,"automation_history_invalid"
|
|
51
|
+
end
|
|
52
|
+
local count=0
|
|
53
|
+
for key,record in pairs(saved.records) do
|
|
54
|
+
count=count+1
|
|
55
|
+
if count>MAX_RECORDS or not number(key) or key<1 or key>MAX_RECORDS or not valid(record) then
|
|
56
|
+
return nil,"automation_history_invalid"
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
if count~=#saved.records then return nil,"automation_history_invalid" end
|
|
60
|
+
return saved
|
|
61
|
+
end
|
|
62
|
+
local function changed()
|
|
63
|
+
if ns.AutomationView then ns.AutomationView.Changed() end
|
|
64
|
+
end
|
|
65
|
+
local function begin(current,actor)
|
|
66
|
+
runtime,identity=current,actor
|
|
67
|
+
local saved=store(false)
|
|
68
|
+
if not saved then return end
|
|
69
|
+
for _,record in ipairs(saved.records) do
|
|
70
|
+
if record.runtime~=runtime then
|
|
71
|
+
record.pending=false;record.hasReport=false
|
|
72
|
+
if record.status=="loaded" or record.status=="running" then
|
|
73
|
+
record.status="interrupted";record.errorCode="runtime_changed"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
local function observe(op)
|
|
79
|
+
if not runtime or not identity then return nil,"automation_history_not_started" end
|
|
80
|
+
local saved,reason=store(true);if not saved then return nil,reason end
|
|
81
|
+
local requestId="MEM-"..op.envelope.ticket
|
|
82
|
+
local record
|
|
83
|
+
for _,item in ipairs(saved.records) do if item.requestId==requestId and item.runtime==runtime then record=item;break end end
|
|
84
|
+
if not record then
|
|
85
|
+
if #saved.records>=MAX_RECORDS then
|
|
86
|
+
local removed=false
|
|
87
|
+
for i,item in ipairs(saved.records) do
|
|
88
|
+
if not item.pending then table.remove(saved.records,i);removed=true;break end
|
|
89
|
+
end
|
|
90
|
+
if not removed then return nil,"automation_history_full" end
|
|
91
|
+
end
|
|
92
|
+
record={requestId=requestId,runtime=runtime,nonce=op.envelope.nonce,
|
|
93
|
+
observedAt=(time and time()) or 0,codeBytes=op.envelope.codeBytes or 0,
|
|
94
|
+
codeAdler32=string.format("%08x",op.envelope.codeChecksum or 0),
|
|
95
|
+
character=identity.character,realm=identity.realm,guid=identity.guid,build=identity.build,product=identity.product}
|
|
96
|
+
saved.records[#saved.records+1]=record
|
|
97
|
+
end
|
|
98
|
+
record.status=phases[op.state]
|
|
99
|
+
record.pending=op.state~="released"
|
|
100
|
+
record.hasReport=op.state=="reported"
|
|
101
|
+
if op.payload then
|
|
102
|
+
record.reportBody=preview(op.payload)
|
|
103
|
+
record.reportTruncated=#op.payload>REPORT_BYTES
|
|
104
|
+
record.probeStatus=op.ok and "completed" or "failed"
|
|
105
|
+
end
|
|
106
|
+
changed()
|
|
107
|
+
return true
|
|
108
|
+
end
|
|
109
|
+
ns.AutomationHistory={
|
|
110
|
+
MAX_RECORDS=MAX_RECORDS,REPORT_BYTES=REPORT_BYTES,Begin=begin,Observe=observe,
|
|
111
|
+
List=function()local saved,reason=store(false);return saved and saved.records or {},reason end,
|
|
112
|
+
Remove=function(id)
|
|
113
|
+
local saved=store(false);if not saved then return false end
|
|
114
|
+
for i,record in ipairs(saved.records) do
|
|
115
|
+
if record.requestId==id and not record.pending then table.remove(saved.records,i);return true end
|
|
116
|
+
end
|
|
117
|
+
return false
|
|
118
|
+
end,
|
|
119
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
local ADDON_NAME, ns = ...
|
|
2
2
|
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
-- records, and Execute routes through ProbeQueue.Load + ProbeRunner.Dispatch,
|
|
8
|
-
-- the exact functions the /dev bridge verbs call.
|
|
3
|
+
-- Workbench view over legacy queue records and the current memory-slot
|
|
4
|
+
-- history. Native history persists per character and is strictly read-only;
|
|
5
|
+
-- manual Execute remains solely for legacy queue entries. Neither provider
|
|
6
|
+
-- makes this page a second executor or a transport recovery journal.
|
|
9
7
|
--
|
|
10
8
|
-- Real status vocabulary (derived from the bridge surface):
|
|
11
9
|
-- queued lycheedev.queue.v1 entry registered, nothing loaded yet
|
|
@@ -147,6 +145,7 @@ local function DeriveStatus(requestId)
|
|
|
147
145
|
end
|
|
148
146
|
|
|
149
147
|
local function ApplyDerived(record)
|
|
148
|
+
if record.transport == "memory-slot" then return record end
|
|
150
149
|
record.status, record.errorCode = nil, nil
|
|
151
150
|
record.receipt, record.reportBody, record.hasReport = nil, nil, nil
|
|
152
151
|
record.probeStatus, record.probeError = nil, nil
|
|
@@ -206,6 +205,21 @@ local function Observe(incoming)
|
|
|
206
205
|
end
|
|
207
206
|
|
|
208
207
|
local function Collect()
|
|
208
|
+
if ns.AutomationHistory then
|
|
209
|
+
local current = {}
|
|
210
|
+
for _,stored in ipairs(ns.AutomationHistory.List()) do
|
|
211
|
+
local incoming={transport="memory-slot",kind=KIND_LUA}
|
|
212
|
+
for key,value in pairs(stored) do incoming[key]=value end
|
|
213
|
+
current[incoming.requestId]=true
|
|
214
|
+
Observe(incoming)
|
|
215
|
+
end
|
|
216
|
+
for index=#records,1,-1 do
|
|
217
|
+
local record=records[index]
|
|
218
|
+
if record.transport=="memory-slot" and not current[record.requestId] then
|
|
219
|
+
recordIndex[record.requestId]=nil;table.remove(records,index)
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
209
223
|
if not ns.ProbeQueue and not ns.ReportStore and not ns.Persistence then
|
|
210
224
|
return 0
|
|
211
225
|
end
|
|
@@ -300,6 +314,7 @@ local function Execute(target)
|
|
|
300
314
|
if not record then
|
|
301
315
|
return nil, "auto_execution_unknown"
|
|
302
316
|
end
|
|
317
|
+
if record.transport=="memory-slot" then return nil,"auto_history_read_only" end
|
|
303
318
|
if not ns.ProbeQueue or type(ns.ProbeQueue.Load) ~= "function"
|
|
304
319
|
or not ns.ProbeRunner or type(ns.ProbeRunner.Dispatch) ~= "function" then
|
|
305
320
|
return nil, "bridge_unavailable"
|
|
@@ -316,6 +331,7 @@ local function ShowNotice(target)
|
|
|
316
331
|
if not record then
|
|
317
332
|
return nil, "auto_execution_unknown"
|
|
318
333
|
end
|
|
334
|
+
if record.transport=="memory-slot" then return nil,"auto_notice_unavailable" end
|
|
319
335
|
local receipt = record.receipt
|
|
320
336
|
if not receipt then
|
|
321
337
|
receipt = ReportRead(record.requestId)
|
|
@@ -355,6 +371,9 @@ local function GetReportText(target)
|
|
|
355
371
|
if type(body) ~= "string" then
|
|
356
372
|
return nil, ns.L.AUTO_NO_REPORT
|
|
357
373
|
end
|
|
374
|
+
if record.reportTruncated then
|
|
375
|
+
return body .. "\n... " .. string.format(ns.L.AUTO_REPORT_HISTORY_LIMIT, ns.AutomationHistory.REPORT_BYTES / 1024)
|
|
376
|
+
end
|
|
358
377
|
if #body > REPORT_DISPLAY_BYTES then
|
|
359
378
|
return body:sub(1, REPORT_DISPLAY_BYTES)
|
|
360
379
|
.. "\n... " .. string.format(ns.L.AUTO_REPORT_DISPLAY_LIMIT, REPORT_DISPLAY_BYTES / 1024)
|
|
@@ -370,6 +389,7 @@ local function ClearRecords()
|
|
|
370
389
|
for index = #records, 1, -1 do
|
|
371
390
|
local record = records[index]
|
|
372
391
|
if not IsProtected(record) and not IsPending(record) then
|
|
392
|
+
if record.transport=="memory-slot" then ns.AutomationHistory.Remove(record.requestId) end
|
|
373
393
|
table.remove(records, index)
|
|
374
394
|
recordIndex[record.requestId] = nil
|
|
375
395
|
removed = removed + 1
|
|
@@ -100,9 +100,6 @@ local function BuildAboutPage(parent)
|
|
|
100
100
|
hasGrabber and L.ABOUT_DEPENDENCY_DETAIL or L.BUGGRABBER_UNAVAILABLE,
|
|
101
101
|
-358, hasGrabber)
|
|
102
102
|
|
|
103
|
-
CreateEnvironmentRow(page, L.ABOUT_SAFETY, L.ABOUT_SAFETY_STATUS,
|
|
104
|
-
L.ABOUT_SAFETY_TEXT, -423, false)
|
|
105
|
-
|
|
106
103
|
local githubButton = CreateFrame("Button", nil, page)
|
|
107
104
|
githubButton:SetSize(32, 32)
|
|
108
105
|
githubButton:SetPoint("BOTTOMLEFT", 17, 17)
|
|
@@ -10,7 +10,9 @@ local L = ns.L
|
|
|
10
10
|
local W = ns.Widgets
|
|
11
11
|
local view = ns.AutomationView
|
|
12
12
|
|
|
13
|
-
local ROW_HEIGHT =
|
|
13
|
+
local ROW_HEIGHT = 60
|
|
14
|
+
local ROW_GAP = 4
|
|
15
|
+
local ROW_STRIDE = ROW_HEIGHT + ROW_GAP
|
|
14
16
|
local LIST_WIDTH = 256
|
|
15
17
|
local VISIBLE_ROWS = 8
|
|
16
18
|
|
|
@@ -26,6 +28,7 @@ local STATUS_LABELS = {
|
|
|
26
28
|
acknowledged = "AUTO_STATUS_ACKNOWLEDGED",
|
|
27
29
|
cleared = "AUTO_STATUS_CLEARED",
|
|
28
30
|
unavailable = "AUTO_STATUS_UNAVAILABLE",
|
|
31
|
+
interrupted = "AUTO_STATUS_INTERRUPTED",
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
local KIND_LABELS = {
|
|
@@ -47,7 +50,7 @@ local function ShownText(value, fallback)
|
|
|
47
50
|
return tostring(value)
|
|
48
51
|
end
|
|
49
52
|
|
|
50
|
-
local function
|
|
53
|
+
local function GetLifecycleText(record)
|
|
51
54
|
if record.status == "unavailable" and record.errorCode then
|
|
52
55
|
return ShownText(record.errorCode)
|
|
53
56
|
end
|
|
@@ -55,6 +58,14 @@ local function GetStatusText(record)
|
|
|
55
58
|
return key and L[key] or ShownText(record.status, L.UNKNOWN)
|
|
56
59
|
end
|
|
57
60
|
|
|
61
|
+
local function GetStatusText(record)
|
|
62
|
+
if record.status == "reported" or record.status == "acknowledged" then
|
|
63
|
+
if record.probeStatus == "failed" then return L.AUTO_STATUS_FAILED end
|
|
64
|
+
if record.probeStatus == "completed" then return L.AUTO_STATUS_SUCCEEDED end
|
|
65
|
+
end
|
|
66
|
+
return GetLifecycleText(record)
|
|
67
|
+
end
|
|
68
|
+
|
|
58
69
|
local function GetKindLabel(kind)
|
|
59
70
|
local key = KIND_LABELS[kind]
|
|
60
71
|
return key and L[key] or L.EXPORT_KIND_UNKNOWN
|
|
@@ -131,11 +142,13 @@ function ns.CreateAutomationPage(parent)
|
|
|
131
142
|
end, "secondary")
|
|
132
143
|
clearButton:SetPoint("BOTTOMLEFT", 14, 14)
|
|
133
144
|
|
|
134
|
-
local hideNoticeButton
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
145
|
+
local hideNoticeButton, showNoticeButton
|
|
146
|
+
if not ns.SlotRuntime then
|
|
147
|
+
hideNoticeButton = W.CreateButton(page, 118, L.AUTO_HIDE_NOTICE, "secondary")
|
|
148
|
+
hideNoticeButton:SetPoint("BOTTOMRIGHT", -14, 14)
|
|
149
|
+
showNoticeButton = W.CreateButton(page, 128, L.AUTO_SHOW_NOTICE, "secondary")
|
|
150
|
+
showNoticeButton:SetPoint("RIGHT", hideNoticeButton, "LEFT", -8, 0)
|
|
151
|
+
end
|
|
139
152
|
|
|
140
153
|
local executeButton = W.CreateButton(page, 96, L.AUTO_EXECUTE, "primary")
|
|
141
154
|
executeButton:SetPoint("TOPRIGHT", -14, -84)
|
|
@@ -147,7 +160,7 @@ function ns.CreateAutomationPage(parent)
|
|
|
147
160
|
|
|
148
161
|
local listScroll = W.CreateScrollArea(listPanel, 8, 8, 7, 8)
|
|
149
162
|
local listContent = CreateFrame("Frame", nil, listScroll)
|
|
150
|
-
listContent:SetWidth(LIST_WIDTH -
|
|
163
|
+
listContent:SetWidth(LIST_WIDTH - 31)
|
|
151
164
|
listContent:SetHeight(1)
|
|
152
165
|
listScroll:SetScrollChild(listContent)
|
|
153
166
|
|
|
@@ -200,7 +213,7 @@ function ns.CreateAutomationPage(parent)
|
|
|
200
213
|
end)
|
|
201
214
|
|
|
202
215
|
local function StatusColor(record)
|
|
203
|
-
if record.status == "unavailable" or record.probeStatus == "failed" then
|
|
216
|
+
if record.status == "unavailable" or record.status == "interrupted" or record.probeStatus == "failed" then
|
|
204
217
|
return ns.Theme.danger[1], ns.Theme.danger[2], ns.Theme.danger[3], 1
|
|
205
218
|
elseif record.status == "reported" or record.probeStatus == "completed" then
|
|
206
219
|
return ns.Theme.success[1], ns.Theme.success[2], ns.Theme.success[3], 1
|
|
@@ -235,14 +248,14 @@ function ns.CreateAutomationPage(parent)
|
|
|
235
248
|
end
|
|
236
249
|
requestValue:SetText(hasRecord and ShownText(record.requestId) or "")
|
|
237
250
|
kindValue:SetText(hasRecord and GetKindLabel(record.kind) or "")
|
|
238
|
-
statusValue:SetText(hasRecord and
|
|
251
|
+
statusValue:SetText(hasRecord and GetLifecycleText(record) or "")
|
|
239
252
|
codeValue:SetText(hasRecord and FormatCode(record) or "")
|
|
240
253
|
timeValue:SetText(hasRecord and FormatRecorded(record) or "")
|
|
241
254
|
errorValue:SetText(hasRecord
|
|
242
255
|
and ShownText(record.actionError or record.probeError or record.errorCode, L.NOT_AVAILABLE) or "")
|
|
243
256
|
|
|
244
|
-
W.SetButtonEnabled(executeButton, hasRecord and (record.status == "queued" or record.status == "loaded"))
|
|
245
|
-
W.SetButtonEnabled(showNoticeButton, hasRecord and record.receipt ~= nil)
|
|
257
|
+
W.SetButtonEnabled(executeButton, hasRecord and record.transport~="memory-slot" and (record.status == "queued" or record.status == "loaded"))
|
|
258
|
+
if showNoticeButton then W.SetButtonEnabled(showNoticeButton, hasRecord and record.receipt ~= nil) end
|
|
246
259
|
W.SetButtonEnabled(viewReportButton, hasRecord)
|
|
247
260
|
W.SetButtonEnabled(detailsButton, hasRecord)
|
|
248
261
|
end
|
|
@@ -268,14 +281,14 @@ function ns.CreateAutomationPage(parent)
|
|
|
268
281
|
return row
|
|
269
282
|
end
|
|
270
283
|
|
|
271
|
-
row = W.CreateListRow(listContent, ROW_HEIGHT)
|
|
284
|
+
row = W.CreateListRow(listContent, ROW_HEIGHT, true)
|
|
272
285
|
row:SetPoint("TOPLEFT", 0, 0)
|
|
273
286
|
row:SetPoint("TOPRIGHT", 0, 0)
|
|
274
287
|
row.hovered = false
|
|
275
288
|
|
|
276
289
|
local title = row:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
|
277
290
|
ns.Theme.SetFont(title, 12, ns.Theme.text)
|
|
278
|
-
title:SetPoint("TOPLEFT",
|
|
291
|
+
title:SetPoint("TOPLEFT", 14, -11)
|
|
279
292
|
title:SetPoint("TOPRIGHT", -100, -10)
|
|
280
293
|
title:SetJustifyH("LEFT")
|
|
281
294
|
title:SetWordWrap(false)
|
|
@@ -283,14 +296,14 @@ function ns.CreateAutomationPage(parent)
|
|
|
283
296
|
|
|
284
297
|
local status = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
285
298
|
ns.Theme.SetFont(status, 11, ns.Theme.textDim)
|
|
286
|
-
status:SetPoint("TOPRIGHT", -
|
|
299
|
+
status:SetPoint("TOPRIGHT", -12, -11)
|
|
287
300
|
status:SetJustifyH("RIGHT")
|
|
288
301
|
row.status = status
|
|
289
302
|
|
|
290
303
|
local meta = row:CreateFontString(nil, "OVERLAY", "GameFontDisableSmall")
|
|
291
304
|
ns.Theme.SetFont(meta, 11, ns.Theme.textDim)
|
|
292
|
-
meta:SetPoint("BOTTOMLEFT",
|
|
293
|
-
meta:SetPoint("BOTTOMRIGHT", -
|
|
305
|
+
meta:SetPoint("BOTTOMLEFT", 14, 10)
|
|
306
|
+
meta:SetPoint("BOTTOMRIGHT", -12, 10)
|
|
294
307
|
meta:SetJustifyH("LEFT")
|
|
295
308
|
meta:SetWordWrap(false)
|
|
296
309
|
meta:SetTextColor(unpack(ns.Theme.textDim))
|
|
@@ -327,7 +340,7 @@ function ns.CreateAutomationPage(parent)
|
|
|
327
340
|
if Restricted(scrollOffset) then
|
|
328
341
|
scrollOffset = 0
|
|
329
342
|
end
|
|
330
|
-
local firstIndex = math.floor((scrollOffset or 0) /
|
|
343
|
+
local firstIndex = math.floor((scrollOffset or 0) / ROW_STRIDE) + 1
|
|
331
344
|
local lastIndex = math.min(#order, firstIndex + VISIBLE_ROWS - 1)
|
|
332
345
|
local poolIndex = 0
|
|
333
346
|
for orderIndex = firstIndex, lastIndex do
|
|
@@ -336,17 +349,17 @@ function ns.CreateAutomationPage(parent)
|
|
|
336
349
|
local row = rows[poolIndex] or AcquireRow(poolIndex)
|
|
337
350
|
row.requestId = record.requestId
|
|
338
351
|
row:ClearAllPoints()
|
|
339
|
-
row:SetPoint("TOPLEFT", 0, -((orderIndex - 1) *
|
|
340
|
-
row:SetPoint("TOPRIGHT", 0, -((orderIndex - 1) *
|
|
352
|
+
row:SetPoint("TOPLEFT", 0, -((orderIndex - 1) * ROW_STRIDE))
|
|
353
|
+
row:SetPoint("TOPRIGHT", 0, -((orderIndex - 1) * ROW_STRIDE))
|
|
341
354
|
row.title:SetText(GetKindLabel(record.kind))
|
|
342
355
|
row.status:SetText(GetStatusText(record))
|
|
343
356
|
row.status:SetTextColor(StatusColor(record))
|
|
344
|
-
row.meta:SetText(FormatTime(record.observedAt)
|
|
357
|
+
row.meta:SetText(FormatTime(record.observedAt))
|
|
345
358
|
ApplyRowState(row)
|
|
346
359
|
row:Show()
|
|
347
360
|
end
|
|
348
361
|
|
|
349
|
-
listContent:SetHeight(math.max(1, #order *
|
|
362
|
+
listContent:SetHeight(math.max(1, #order * ROW_STRIDE - ROW_GAP))
|
|
350
363
|
listScroll:UpdateScrollChildRect()
|
|
351
364
|
|
|
352
365
|
-- Newest record first: when the selection is gone, fall back to the
|
|
@@ -356,8 +369,8 @@ function ns.CreateAutomationPage(parent)
|
|
|
356
369
|
end
|
|
357
370
|
if not selectedRequestId and order[1] then
|
|
358
371
|
selectedRequestId = order[1]
|
|
359
|
-
ShowSelectedReport()
|
|
360
372
|
end
|
|
373
|
+
if selectedRequestId then ShowSelectedReport() end
|
|
361
374
|
for index = 1, #rows do
|
|
362
375
|
ApplyRowState(rows[index])
|
|
363
376
|
end
|
|
@@ -390,7 +403,7 @@ function ns.CreateAutomationPage(parent)
|
|
|
390
403
|
Refresh()
|
|
391
404
|
end)
|
|
392
405
|
|
|
393
|
-
showNoticeButton:SetScript("OnClick", function()
|
|
406
|
+
if showNoticeButton then showNoticeButton:SetScript("OnClick", function()
|
|
394
407
|
if ns.Safety.IsCombatBlocked() then
|
|
395
408
|
ns.Safety.PrintBlocked()
|
|
396
409
|
return
|
|
@@ -398,12 +411,12 @@ function ns.CreateAutomationPage(parent)
|
|
|
398
411
|
if selectedRequestId then
|
|
399
412
|
view.ShowNotice(selectedRequestId)
|
|
400
413
|
end
|
|
401
|
-
end)
|
|
414
|
+
end) end
|
|
402
415
|
|
|
403
416
|
-- Hiding the notice is teardown and must stay available in every state.
|
|
404
|
-
hideNoticeButton:SetScript("OnClick", function()
|
|
417
|
+
if hideNoticeButton then hideNoticeButton:SetScript("OnClick", function()
|
|
405
418
|
view.HideNotice()
|
|
406
|
-
end)
|
|
419
|
+
end) end
|
|
407
420
|
|
|
408
421
|
viewReportButton:SetScript("OnClick", function()
|
|
409
422
|
metadata:Hide();reportArea:Show()
|
|
@@ -45,11 +45,9 @@ local function BuildDiagnosticsPage(parent)
|
|
|
45
45
|
status:SetWidth(ERROR_LIST_WIDTH - 10)
|
|
46
46
|
status:SetJustifyH("LEFT")
|
|
47
47
|
local function SetStatus(text, errorState)
|
|
48
|
-
local
|
|
49
|
-
local g = errorState and accent[2] or 0.60
|
|
50
|
-
local b = errorState and accent[3] or 0.65
|
|
48
|
+
local color = errorState and ns.Theme.danger or ns.Theme.textMuted
|
|
51
49
|
status:SetText(text or "")
|
|
52
|
-
status:SetTextColor(
|
|
50
|
+
status:SetTextColor(color[1], color[2], color[3], 1)
|
|
53
51
|
end
|
|
54
52
|
|
|
55
53
|
local errorsView = CreateFrame("Frame", nil, page)
|
|
@@ -419,7 +419,8 @@ Workbench.RegisterPage{
|
|
|
419
419
|
build = BuildRunPage,
|
|
420
420
|
activate = function(page)
|
|
421
421
|
page.RefreshHistory()
|
|
422
|
-
page.
|
|
422
|
+
-- Opening a page is not a request to capture keyboard input. In
|
|
423
|
+
-- particular, an Agent showing results must still be able to finish.
|
|
423
424
|
end,
|
|
424
425
|
suspend = function(page)
|
|
425
426
|
page.inputPanel.editBox:ClearFocus()
|
|
@@ -3,8 +3,9 @@ local ADDON_NAME, ns = ...
|
|
|
3
3
|
-- Visual constants from Design.md. Loading this table creates no UI objects.
|
|
4
4
|
ns.Theme = {
|
|
5
5
|
window = { .055, .055, .063 },
|
|
6
|
-
surfaceHover = { .
|
|
7
|
-
surfaceSelected = { .
|
|
6
|
+
surfaceHover = { .125, .123, .130 },
|
|
7
|
+
surfaceSelected = { .175, .170, .180 },
|
|
8
|
+
listSelected = { .135, .125, .140 },
|
|
8
9
|
field = { .085, .085, .095 },
|
|
9
10
|
fieldBorder = { .400, .400, .420 },
|
|
10
11
|
sidebar = { .075, .073, .078 },
|
|
@@ -60,7 +60,7 @@ end
|
|
|
60
60
|
local function CreateScrollArea(parent, leftInset, topInset, rightInset, bottomInset, useNativeScrollFrame)
|
|
61
61
|
local scroll = CreateFrame(useNativeScrollFrame and "ScrollFrame" or "Frame", nil, parent)
|
|
62
62
|
scroll:SetPoint("TOPLEFT", leftInset, -topInset)
|
|
63
|
-
scroll:SetPoint("BOTTOMRIGHT", -(rightInset +
|
|
63
|
+
scroll:SetPoint("BOTTOMRIGHT", -(rightInset + 16), bottomInset)
|
|
64
64
|
scroll:SetClipsChildren(true)
|
|
65
65
|
scroll:EnableMouseWheel(true)
|
|
66
66
|
scroll.verticalOffset = 0
|
|
@@ -68,33 +68,29 @@ local function CreateScrollArea(parent, leftInset, topInset, rightInset, bottomI
|
|
|
68
68
|
|
|
69
69
|
local scrollbar = CreateFrame("Slider", nil, parent)
|
|
70
70
|
scrollbar:SetOrientation("VERTICAL")
|
|
71
|
-
scrollbar:SetPoint("TOPRIGHT", -rightInset, -topInset)
|
|
72
|
-
scrollbar:SetPoint("BOTTOMRIGHT", -rightInset, bottomInset)
|
|
73
|
-
scrollbar:SetWidth(
|
|
71
|
+
scrollbar:SetPoint("TOPRIGHT", -rightInset, -topInset - 2)
|
|
72
|
+
scrollbar:SetPoint("BOTTOMRIGHT", -rightInset, bottomInset + 2)
|
|
73
|
+
scrollbar:SetWidth(12)
|
|
74
74
|
scrollbar:SetMinMaxValues(0, 0)
|
|
75
75
|
scrollbar:SetValue(0)
|
|
76
76
|
scrollbar:SetValueStep(1)
|
|
77
77
|
scrollbar:SetObeyStepOnDrag(false)
|
|
78
|
-
scrollbar:SetHitRectInsets(
|
|
78
|
+
scrollbar:SetHitRectInsets(0, 0, 0, 0)
|
|
79
79
|
scrollbar.syncing = false
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
track:SetPoint("TOP", 0, 0)
|
|
84
|
-
track:SetPoint("BOTTOM", 0, 0)
|
|
85
|
-
track:SetWidth(2)
|
|
86
|
-
|
|
81
|
+
-- Match Lychee's quiet, trackless red thumb with a wider drag target.
|
|
82
|
+
-- Keep native Slider input; no custom per-frame drag loop is needed.
|
|
87
83
|
local thumb = scrollbar:CreateTexture(nil, "ARTWORK")
|
|
88
|
-
thumb:SetColorTexture(
|
|
89
|
-
thumb:SetSize(
|
|
84
|
+
thumb:SetColorTexture(ACCENT_R, ACCENT_G, ACCENT_B, 1)
|
|
85
|
+
thumb:SetSize(3, 32)
|
|
90
86
|
scrollbar:SetThumbTexture(thumb)
|
|
91
87
|
scrollbar.thumb = thumb
|
|
92
88
|
|
|
93
89
|
scrollbar:SetScript("OnEnter", function(self)
|
|
94
|
-
self.thumb:SetColorTexture(
|
|
90
|
+
self.thumb:SetColorTexture(Theme.accentHover[1], Theme.accentHover[2], Theme.accentHover[3], 1)
|
|
95
91
|
end)
|
|
96
92
|
scrollbar:SetScript("OnLeave", function(self)
|
|
97
|
-
self.thumb:SetColorTexture(
|
|
93
|
+
self.thumb:SetColorTexture(ACCENT_R, ACCENT_G, ACCENT_B, 1)
|
|
98
94
|
end)
|
|
99
95
|
scrollbar:SetScript("OnValueChanged", function(self, value)
|
|
100
96
|
if not self.syncing then
|
|
@@ -188,7 +184,7 @@ local function CreateScrollArea(parent, leftInset, topInset, rightInset, bottomI
|
|
|
188
184
|
if not (issecretvalue and issecretvalue(trackHeight))
|
|
189
185
|
and trackHeight and trackHeight > 0 and viewHeight > 0 then
|
|
190
186
|
local contentHeight = math.max(viewHeight, viewHeight + range)
|
|
191
|
-
scrollbar.thumb:SetHeight(math.max(
|
|
187
|
+
scrollbar.thumb:SetHeight(math.min(trackHeight, 48, math.max(24, math.floor(trackHeight * viewHeight / contentHeight + 0.5))))
|
|
192
188
|
end
|
|
193
189
|
scrollbar:Show()
|
|
194
190
|
end
|
|
@@ -351,14 +347,17 @@ local function ApplyButtonState(button, state)
|
|
|
351
347
|
local selected = variant == "selected"
|
|
352
348
|
local primary = variant == "primary" or variant == "danger"
|
|
353
349
|
local field = variant == "field"
|
|
354
|
-
local
|
|
355
|
-
|
|
350
|
+
local secondary = variant == "secondary"
|
|
351
|
+
local interacting = enabled and (state == "hover" or state == "pressed")
|
|
352
|
+
local background = field and Theme.field or selected and Theme.surfaceSelected
|
|
353
|
+
or interacting and Theme.surfaceSelected or Theme.action
|
|
354
|
+
button.lycheeSurface:SetColor(background, (field or selected or primary or secondary or interacting) and 1 or 0)
|
|
356
355
|
local color = not enabled and Theme.disabled
|
|
357
|
-
or
|
|
356
|
+
or interacting and (primary and Theme.accentHover or Theme.text)
|
|
358
357
|
or variant == "danger" and Theme.danger
|
|
359
358
|
or primary and Theme.accentHover
|
|
360
359
|
or selected and Theme.text
|
|
361
|
-
or Theme.textMuted
|
|
360
|
+
or secondary and Theme.text or Theme.textMuted
|
|
362
361
|
button.label:SetTextColor(color[1], color[2], color[3], 1)
|
|
363
362
|
end
|
|
364
363
|
|
|
@@ -545,14 +544,18 @@ local function CreatePageHeading(parent, title, help)
|
|
|
545
544
|
return label
|
|
546
545
|
end
|
|
547
546
|
|
|
548
|
-
local function CreateListRow(parent, height)
|
|
547
|
+
local function CreateListRow(parent, height, quiet)
|
|
549
548
|
local row = CreateFrame("Button", nil, parent)
|
|
550
549
|
row:SetHeight(height)
|
|
551
550
|
|
|
552
551
|
local background = row:CreateTexture(nil, "BACKGROUND")
|
|
553
|
-
background:
|
|
552
|
+
background:SetPoint("TOPLEFT", 0, -2)
|
|
553
|
+
background:SetPoint("BOTTOMRIGHT", 0, 2)
|
|
554
554
|
background:SetColorTexture(0, 0, 0, 0)
|
|
555
555
|
row.background = background
|
|
556
|
+
if quiet then
|
|
557
|
+
row.selectionSurface = Theme.CreateRoundedSurface(row, {0, 0, 0, 0}, {radius = 6, inset = 2})
|
|
558
|
+
end
|
|
556
559
|
|
|
557
560
|
local accent = row:CreateTexture(nil, "ARTWORK")
|
|
558
561
|
accent:SetColorTexture(ACCENT_R, ACCENT_G, ACCENT_B, 1)
|
|
@@ -560,6 +563,7 @@ local function CreateListRow(parent, height)
|
|
|
560
563
|
accent:SetSize(2, 22)
|
|
561
564
|
accent:Hide()
|
|
562
565
|
row.accent = accent
|
|
566
|
+
if quiet then accent:SetPoint("LEFT", 4, 0);accent:SetHeight(18) end
|
|
563
567
|
|
|
564
568
|
row.divider = row:CreateTexture(nil, "ARTWORK")
|
|
565
569
|
row.divider:SetColorTexture(0, 0, 0, 0)
|
|
@@ -567,6 +571,12 @@ local function CreateListRow(parent, height)
|
|
|
567
571
|
end
|
|
568
572
|
|
|
569
573
|
local function SetListRowState(row, selected, hovered)
|
|
574
|
+
if row.selectionSurface then
|
|
575
|
+
row.background:SetColorTexture(0, 0, 0, 0)
|
|
576
|
+
row.selectionSurface:SetColor(selected and Theme.listSelected or hovered and Theme.surfaceHover or {0, 0, 0, 0})
|
|
577
|
+
row.accent:SetShown(selected == true)
|
|
578
|
+
return
|
|
579
|
+
end
|
|
570
580
|
if selected then
|
|
571
581
|
row.background:SetColorTexture(unpack(Theme.surfaceSelected))
|
|
572
582
|
row.accent:Show()
|