feat(ui): add configurable text justification activity setting (#212)
* fix(server): improve external server and error handling - Skip OpenCode shutdown when using external server (OPENCODE_SKIP_START=true) - Return 404 status for non-existent directories instead of empty array - Move error logging before response handling * feat(ui): add configurable text justification activity setting - Replace hardcoded ENABLE_TEXT_JUSTIFICATION_ACTIVITY constant with dynamic showTextJustificationActivity setting in useUIStore - Add toggle UI in Chat settings section (Settings > Chat) - Add setting to DesktopSettings type for cross-runtime persistence - Default value is false (matching original constant behavior) --------- Co-authored-by: iiyangdianfeng <goodydfwow@gmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
iiyangdianfeng
parent
5950a31632
commit
adbc5af95f
@@ -73,8 +73,6 @@ interface TurnActivityInfo {
|
||||
diffStats?: TurnDiffStats;
|
||||
}
|
||||
|
||||
const ENABLE_TEXT_JUSTIFICATION_ACTIVITY = false;
|
||||
|
||||
const ACTIVITY_STANDALONE_TOOL_NAMES = new Set<string>(['task']);
|
||||
|
||||
const isActivityStandaloneTool = (toolName: unknown): boolean => {
|
||||
@@ -123,6 +121,7 @@ const extractFinalAssistantText = (turn: Turn): string | undefined => {
|
||||
};
|
||||
|
||||
const getTurnActivityInfo = (turn: Turn): TurnActivityInfo => {
|
||||
const showTextJustificationActivity = useUIStore.getState().showTextJustificationActivity;
|
||||
interface SummaryDiff {
|
||||
additions?: number | null | undefined;
|
||||
deletions?: number | null | undefined;
|
||||
@@ -186,7 +185,7 @@ const getTurnActivityInfo = (turn: Turn): TurnActivityInfo => {
|
||||
turn.assistantMessages.forEach((msg) => {
|
||||
const messageId = msg.info.id;
|
||||
const infoFinish = (msg.info as { finish?: string | null | undefined }).finish;
|
||||
const hasStopFinishInMessage = ENABLE_TEXT_JUSTIFICATION_ACTIVITY
|
||||
const hasStopFinishInMessage = showTextJustificationActivity
|
||||
? infoFinish === 'stop'
|
||||
: false;
|
||||
|
||||
@@ -233,7 +232,7 @@ const getTurnActivityInfo = (turn: Turn): TurnActivityInfo => {
|
||||
}
|
||||
|
||||
if (
|
||||
ENABLE_TEXT_JUSTIFICATION_ACTIVITY &&
|
||||
showTextJustificationActivity &&
|
||||
part.type === 'text' &&
|
||||
(hasTools || hasReasoning) &&
|
||||
!hasStopFinishInMessage
|
||||
|
||||
Reference in New Issue
Block a user