refactor: remove stale import understanding surfaces

This commit is contained in:
kris
2026-04-05 07:53:03 +08:00
parent 50d5327afd
commit 28f692706b
4 changed files with 13 additions and 190 deletions

View File

@@ -24,8 +24,6 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
private @Nullable JSONObject currentDraft;
private @Nullable JSONObject currentResolution;
private @Nullable JSONObject currentReviewTask;
private @Nullable JSONArray currentUnderstandingTasks;
private @Nullable JSONArray currentProjectUnderstandings;
private final LinkedHashSet<String> selectedCandidateIds = new LinkedHashSet<>();
private final Runnable reviewPollRunnable = this::reload;
@@ -55,9 +53,7 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
runOnUiThread(() -> applyPayload(
response.json.optJSONObject("draft"),
response.json.optJSONObject("resolution"),
response.json.optJSONObject("reviewTask"),
response.json.optJSONArray("understandingTasks"),
response.json.optJSONArray("projectUnderstandings")
response.json.optJSONObject("reviewTask")
));
} catch (Exception error) {
runOnUiThread(() -> {
@@ -71,15 +67,11 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
private void applyPayload(
@Nullable JSONObject draft,
@Nullable JSONObject resolution,
@Nullable JSONObject reviewTask,
@Nullable JSONArray understandingTasks,
@Nullable JSONArray projectUnderstandings
@Nullable JSONObject reviewTask
) {
currentDraft = draft;
currentResolution = resolution;
currentReviewTask = reviewTask;
currentUnderstandingTasks = understandingTasks;
currentProjectUnderstandings = projectUnderstandings;
selectedCandidateIds.clear();
JSONArray selected = draft == null ? null : draft.optJSONArray("selectedCandidateIds");
if (selected != null) {
@@ -117,8 +109,6 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
JSONObject draft = currentDraft;
JSONObject resolution = currentResolution;
JSONObject reviewTask = currentReviewTask;
JSONArray understandingTasks = currentUnderstandingTasks;
JSONArray projectUnderstandings = currentProjectUnderstandings;
contentLayout.removeCallbacks(reviewPollRunnable);
replaceContent();
appendContent(BossUi.buildSoftPanel(
@@ -237,40 +227,6 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
));
}
if (understandingTasks != null && understandingTasks.length() > 0) {
int completedCount = 0;
for (int i = 0; i < understandingTasks.length(); i++) {
JSONObject task = understandingTasks.optJSONObject(i);
if (task != null && "completed".equals(task.optString("status", ""))) {
completedCount += 1;
}
}
appendContent(BossUi.buildCard(
this,
"项目理解",
completedCount == understandingTasks.length()
? "主 Agent 已经拿到活跃线程的项目目标、进度和技术架构。"
: "主 Agent 正在向活跃线程追问项目目标、进度和技术架构。",
"已完成 " + completedCount + " / " + understandingTasks.length()
));
}
if (projectUnderstandings != null) {
for (int i = 0; i < projectUnderstandings.length(); i++) {
JSONObject understanding = projectUnderstandings.optJSONObject(i);
if (understanding == null) continue;
appendContent(BossUi.buildCard(
this,
understanding.optString("threadDisplayName", "项目理解"),
"目标:" + understanding.optString("projectGoal", "未提供")
+ "\n进度" + understanding.optString("currentProgress", "未提供")
+ "\n架构" + understanding.optString("technicalArchitecture", "未提供"),
"阻塞:" + understanding.optString("currentBlockers", "")
+ " · 下一步:" + understanding.optString("recommendedNextStep", "继续联调")
));
}
}
JSONArray appliedProjectNames = draft.optJSONArray("appliedProjectNames");
if (appliedProjectNames != null && appliedProjectNames.length() > 0) {
appendContent(BossUi.buildCard(
@@ -417,16 +373,14 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
reviewResponse.json.optJSONObject("resolution"),
reviewResponse.json.optJSONObject("reviewTask") != null
? reviewResponse.json.optJSONObject("reviewTask")
: reviewResponse.json.optJSONObject("task"),
reviewResponse.json.optJSONArray("understandingTasks"),
reviewResponse.json.optJSONArray("projectUnderstandings")
: reviewResponse.json.optJSONObject("task")
);
});
} catch (Exception error) {
final JSONObject fallbackDraft = selectedDraft;
runOnUiThread(() -> {
if (fallbackDraft != null) {
applyPayload(fallbackDraft, null, null, null, null);
applyPayload(fallbackDraft, null, null);
} else {
setRefreshing(false);
}
@@ -450,7 +404,7 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
}
runOnUiThread(() -> {
showMessage("已清空当前勾选");
applyPayload(response.json.optJSONObject("draft"), null, null, null, null);
applyPayload(response.json.optJSONObject("draft"), null, null);
});
} catch (Exception error) {
runOnUiThread(() -> {
@@ -478,9 +432,7 @@ public class DeviceImportDraftActivity extends BossScreenActivity {
applyPayload(
response.json.optJSONObject("draft"),
response.json.optJSONObject("resolution"),
null,
null,
response.json.optJSONArray("projectUnderstandings")
null
);
});
} catch (Exception error) {