fix: remove folder intro panels across surfaces
This commit is contained in:
@@ -263,24 +263,6 @@ public class ConversationFolderActivity extends BossScreenActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Integer> targetIndices = resolveTargetThreadIndices(threads);
|
ArrayList<Integer> targetIndices = resolveTargetThreadIndices(threads);
|
||||||
if (!targetIndices.isEmpty()) {
|
|
||||||
String matchedLabel = targetProjectLabel;
|
|
||||||
if ((matchedLabel == null || matchedLabel.isEmpty())) {
|
|
||||||
JSONObject firstTarget = threads.optJSONObject(targetIndices.get(0));
|
|
||||||
if (firstTarget != null) {
|
|
||||||
matchedLabel = firstTarget.optString("threadTitle", "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
appendContent(BossUi.buildSoftPanel(
|
|
||||||
this,
|
|
||||||
"已定位到目标线程",
|
|
||||||
matchedLabel == null || matchedLabel.isEmpty()
|
|
||||||
? "文件夹页已打开,并将匹配线程置顶显示。"
|
|
||||||
: matchedLabel,
|
|
||||||
targetIndices.size() + " 个匹配项已置顶"
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < targetIndices.size(); i++) {
|
for (int i = 0; i < targetIndices.size(); i++) {
|
||||||
renderThreadAtIndex(threads, targetIndices.get(i), true);
|
renderThreadAtIndex(threads, targetIndices.get(i), true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,11 +86,12 @@ public class ConversationFolderActivityTest {
|
|||||||
);
|
);
|
||||||
|
|
||||||
LinearLayout content = activity.findViewById(R.id.screen_content);
|
LinearLayout content = activity.findViewById(R.id.screen_content);
|
||||||
assertTrue(viewTreeContainsText(content, "已定位到目标线程"));
|
assertFalse("项目抽屉页不应展示搜索定位说明卡片", viewTreeContainsText(content, "已定位到目标线程"));
|
||||||
|
assertFalse("项目抽屉页不应展示匹配项置顶说明文案", viewTreeContainsText(content, "个匹配项已置顶"));
|
||||||
assertTrue(viewTreeContainsText(content, "目标线程"));
|
assertTrue(viewTreeContainsText(content, "目标线程"));
|
||||||
assertTrue(viewTreeContainsText(content, "发布回滚"));
|
assertTrue(viewTreeContainsText(content, "发布回滚"));
|
||||||
assertEquals(2, countTextOccurrences(content, "目标线程"));
|
assertEquals(2, countTextOccurrences(content, "目标线程"));
|
||||||
assertTrue(countTextOccurrences(content, "发布回滚") >= 3);
|
assertEquals(2, countTextOccurrences(content, "发布回滚"));
|
||||||
assertEquals(0, countTextOccurrences(content, "project-1"));
|
assertEquals(0, countTextOccurrences(content, "project-1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +115,7 @@ public class ConversationFolderActivityTest {
|
|||||||
);
|
);
|
||||||
|
|
||||||
LinearLayout content = activity.findViewById(R.id.screen_content);
|
LinearLayout content = activity.findViewById(R.id.screen_content);
|
||||||
assertTrue(viewTreeContainsText(content, "已定位到目标线程"));
|
assertFalse("项目抽屉页不应展示搜索定位说明卡片", viewTreeContainsText(content, "已定位到目标线程"));
|
||||||
assertTrue(viewTreeContainsText(content, "日志收口"));
|
assertTrue(viewTreeContainsText(content, "日志收口"));
|
||||||
assertEquals(0, countTextOccurrences(content, "project-99"));
|
assertEquals(0, countTextOccurrences(content, "project-99"));
|
||||||
assertEquals(1, countTextOccurrences(content, "目标线程"));
|
assertEquals(1, countTextOccurrences(content, "目标线程"));
|
||||||
|
|||||||
@@ -32,18 +32,6 @@ export default async function ConversationFolderPage({
|
|||||||
) : null}
|
) : null}
|
||||||
<StatusBar />
|
<StatusBar />
|
||||||
<PageNav title={folder?.folderLabel ?? "项目线程"} backHref="/conversations" />
|
<PageNav title={folder?.folderLabel ?? "项目线程"} backHref="/conversations" />
|
||||||
<div className="space-y-3 px-[18px] pb-6">
|
|
||||||
<div className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
|
|
||||||
<div className="text-[16px] font-semibold text-[#111111]">
|
|
||||||
{folder?.folderLabel ?? "未命名项目"}
|
|
||||||
</div>
|
|
||||||
<div className="mt-2 text-[13px] leading-6 text-[#57606A]">
|
|
||||||
{folder
|
|
||||||
? `${folder.deviceName ?? "当前设备"} · ${folder.threadCount} 个线程`
|
|
||||||
: "当前项目下没有可显示的线程。"}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{folder ? (
|
{folder ? (
|
||||||
<ConversationList conversations={folder.threads} />
|
<ConversationList conversations={folder.threads} />
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -101,6 +101,26 @@ test("folder conversation page wires folder thread ids into realtime refresh", a
|
|||||||
assert.match(folderPage, /"conversation\.updated"/, "expected folder page to listen to conversation updates");
|
assert.match(folderPage, /"conversation\.updated"/, "expected folder page to listen to conversation updates");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("folder conversation page does not render a redundant intro card before the thread list", async () => {
|
||||||
|
const folderPage = await readWorkspaceFile("src/app/conversations/folders/[folderKey]/page.tsx");
|
||||||
|
|
||||||
|
assert.doesNotMatch(
|
||||||
|
folderPage,
|
||||||
|
/rounded-2xl border border-\[#E5E5EA\] bg-white px-4 py-4/,
|
||||||
|
"expected folder page to skip the standalone intro card",
|
||||||
|
);
|
||||||
|
assert.doesNotMatch(
|
||||||
|
folderPage,
|
||||||
|
/folder\.deviceName/,
|
||||||
|
"expected folder page to avoid repeating device info above the thread list",
|
||||||
|
);
|
||||||
|
assert.doesNotMatch(
|
||||||
|
folderPage,
|
||||||
|
/folder\.threadCount/,
|
||||||
|
"expected folder page to avoid repeating thread count above the thread list",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
test("forward page wires realtime refresh for visible source and target projects", async () => {
|
test("forward page wires realtime refresh for visible source and target projects", async () => {
|
||||||
const forwardPage = await readWorkspaceFile("src/app/conversations/[projectId]/forward/page.tsx");
|
const forwardPage = await readWorkspaceFile("src/app/conversations/[projectId]/forward/page.tsx");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user