style: unify project detail top menu

This commit is contained in:
kris
2026-04-03 09:51:21 +08:00
parent 95f164e552
commit 459b301939
3 changed files with 61 additions and 1 deletions

View File

@@ -50,6 +50,27 @@ public class ProjectDetailActivityMasterAgentMenuTest {
assertMenuItem(listView, 5, "刷新");
}
@Test
public void normalConversationMoreMenuShowsInfoAndRefresh() {
Intent intent = new Intent()
.putExtra(ProjectDetailActivity.EXTRA_PROJECT_ID, "project-1")
.putExtra(ProjectDetailActivity.EXTRA_PROJECT_NAME, "Boss 移动控制台");
ProjectDetailActivityUiTest.TestProjectDetailActivity activity = Robolectric
.buildActivity(ProjectDetailActivityUiTest.TestProjectDetailActivity.class, intent)
.setup()
.get();
ReflectionHelpers.callInstanceMethod(activity, "showConversationMoreMenu");
android.app.Dialog latestDialog = ShadowDialog.getLatestDialog();
assertTrue(latestDialog instanceof AlertDialog);
AlertDialog actionDialog = (AlertDialog) latestDialog;
ListView listView = actionDialog.getListView();
assertMenuItem(listView, 0, "会话信息");
assertMenuItem(listView, 1, "刷新");
}
@Test
public void masterAgentWaitingStateRendersThinkingPlaceholder() throws Exception {
Intent intent = new Intent()

View File

@@ -253,6 +253,27 @@ public class ProjectDetailActivityUiTest {
assertEquals("...", headerAction.getText().toString());
}
@Test
public void normalConversationHeaderUsesWechatMoreMenuLabel() {
Intent intent = new Intent()
.putExtra(ProjectDetailActivity.EXTRA_PROJECT_ID, "project-1")
.putExtra(ProjectDetailActivity.EXTRA_PROJECT_NAME, "Boss 移动控制台");
TestProjectDetailActivity activity = Robolectric
.buildActivity(TestProjectDetailActivity.class, intent)
.setup()
.get();
ReflectionHelpers.setField(activity, "conversationInfoReady", true);
ReflectionHelpers.setField(activity, "currentScreenTitle", "Boss 移动控制台");
ReflectionHelpers.setField(activity, "currentScreenSubtitle", "归档确认");
ReflectionHelpers.callInstanceMethod(activity, "updateSelectionUi");
Button headerAction = activity.findViewById(R.id.screen_header_action);
assertEquals(View.VISIBLE, headerAction.getVisibility());
assertEquals("...", headerAction.getText().toString());
}
@Test
public void renderProjectKeepsMasterAgentWaitingStateVisibleInMessageFlow() throws Exception {
Intent intent = new Intent()