Skip to content

Commit cb8c1d1

Browse files
committed
feat: refine status dashboard and formatting UX
1 parent 4396c1b commit cb8c1d1

9 files changed

Lines changed: 469 additions & 101 deletions

File tree

src/client/providers/includeTreeProvider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ class LsdynaIncludeTreeProvider {
298298
this.missingPaths = new Set();
299299
}
300300

301+
refresh() {
302+
this._onDidChangeTreeData.fire(undefined);
303+
}
304+
301305
/**
302306
* Triggers a workspace scan starting from the active editor document to rebuild the tree.
303307
*

src/client/providers/keywordIndexProvider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ class LsdynaKeywordIndexProvider {
235235
this.documentIndices = new Map();
236236
}
237237

238+
refresh() {
239+
this._onDidChangeTreeData.fire(undefined);
240+
}
241+
238242
/**
239243
* Sets view mode and updates VS Code context state.
240244
*

src/client/statusBar/dashboard.ts

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type DashboardActions = {
3030
scanKeywordIndex?: () => Promise<void> | void;
3131
configureManuals?: () => Promise<void> | void;
3232
showOutput?: () => Promise<void> | void;
33-
copyDiagnostics?: () => Promise<void> | void;
33+
showDiagnostics?: () => Promise<void> | void;
3434
toggleTabNavigation?: () => Promise<void> | void;
3535
};
3636

@@ -56,10 +56,10 @@ type DashboardLabels = {
5656
showOutputLabel: string;
5757
showOutputDescription: string;
5858
showOutputDetail: string;
59-
copyDiagnosticsLabel: string;
59+
showDiagnosticsLabel: string;
6060
diagnosticsSingularDescription: string;
6161
diagnosticsPluralDescription: string;
62-
copyDiagnosticsDetail: string;
62+
showDiagnosticsDetail: string;
6363
toggleTabNavigationLabel: string;
6464
tabNavigationOnDescription: string;
6565
tabNavigationOffDescription: string;
@@ -86,14 +86,14 @@ const DEFAULT_DASHBOARD_LABELS: DashboardLabels = {
8686
showOutputLabel: '$(output) Open Log',
8787
showOutputDescription: 'DynaSense output',
8888
showOutputDetail: 'Open the extension output channel for recent scan and indexing messages.',
89-
copyDiagnosticsLabel: '$(copy) Copy Diagnostics',
89+
showDiagnosticsLabel: '$(pulse) Diagnostic Details',
9090
diagnosticsSingularDescription: '1 warning',
9191
diagnosticsPluralDescription: '{0} warnings',
92-
copyDiagnosticsDetail: 'Copy active-file diagnostics and DynaSense context to the clipboard.',
93-
toggleTabNavigationLabel: '$(keyboard) Toggle Tab Navigation',
92+
showDiagnosticsDetail: 'View current-file diagnostics, jump to a problem, or copy the full report.',
93+
toggleTabNavigationLabel: '$(keyboard) Field Tab Jump',
9494
tabNavigationOnDescription: 'On',
9595
tabNavigationOffDescription: 'Off',
96-
toggleTabNavigationDetail: 'Switch fixed-width LS-DYNA field navigation for the Tab key.',
96+
toggleTabNavigationDetail: 'Switch Tab-key jumps between fixed-width LS-DYNA fields.',
9797
};
9898

9999
function resolveDashboardLabels(overrides: Partial<DashboardLabels> = {}): DashboardLabels {
@@ -168,15 +168,15 @@ function buildDashboardItems(context: DashboardContext = {}): DashboardItem[] {
168168
? labels.diagnosticsSingularDescription
169169
: formatLabelTemplate(labels.diagnosticsPluralDescription, warningCount);
170170

171-
return [
172-
{
173-
id: 'showHealth',
174-
label: labels.showHealthLabel,
175-
description: healthIssueCount > 0
176-
? formatLabelTemplate(labels.healthIssuesDescription, healthIssueCount)
177-
: labels.healthReadyDescription,
178-
detail: labels.showHealthDetail,
179-
},
171+
const healthItem = {
172+
id: 'showHealth',
173+
label: labels.showHealthLabel,
174+
description: healthIssueCount > 0
175+
? formatLabelTemplate(labels.healthIssuesDescription, healthIssueCount)
176+
: labels.healthReadyDescription,
177+
detail: labels.showHealthDetail,
178+
};
179+
const items = [
180180
{
181181
id: 'scanIncludes',
182182
label: labels.scanIncludesLabel,
@@ -189,31 +189,39 @@ function buildDashboardItems(context: DashboardContext = {}): DashboardItem[] {
189189
description: labels.scanKeywordIndexDescription,
190190
detail: labels.scanKeywordIndexDetail,
191191
},
192+
{
193+
id: 'toggleTabNavigation',
194+
label: labels.toggleTabNavigationLabel,
195+
description: tabNavigationEnabled ? labels.tabNavigationOnDescription : labels.tabNavigationOffDescription,
196+
detail: labels.toggleTabNavigationDetail,
197+
},
192198
{
193199
id: 'configureManuals',
194200
label: labels.configureManualsLabel,
195201
description: manualReady ? labels.manualReadyDescription : labels.manualSetupDescription,
196202
detail: labels.configureManualsDetail,
197203
},
204+
{
205+
id: 'showDiagnostics',
206+
label: labels.showDiagnosticsLabel,
207+
description: diagnosticsDescription,
208+
detail: labels.showDiagnosticsDetail,
209+
},
198210
{
199211
id: 'showOutput',
200212
label: labels.showOutputLabel,
201213
description: labels.showOutputDescription,
202214
detail: labels.showOutputDetail,
203215
},
204-
{
205-
id: 'copyDiagnostics',
206-
label: labels.copyDiagnosticsLabel,
207-
description: diagnosticsDescription,
208-
detail: labels.copyDiagnosticsDetail,
209-
},
210-
{
211-
id: 'toggleTabNavigation',
212-
label: labels.toggleTabNavigationLabel,
213-
description: tabNavigationEnabled ? labels.tabNavigationOnDescription : labels.tabNavigationOffDescription,
214-
detail: labels.toggleTabNavigationDetail,
215-
},
216216
];
217+
218+
if (healthIssueCount > 0) {
219+
items.unshift(healthItem);
220+
} else {
221+
items.push(healthItem);
222+
}
223+
224+
return items;
217225
}
218226

219227
class LsdynaStatusBarDashboard {

src/core/i18n.ts

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,25 @@ const LOCALES = {
6363
statusDashboardShowOutputLabel: '$(output) 打开日志',
6464
statusDashboardShowOutputDescription: 'DynaSense 输出',
6565
statusDashboardShowOutputDetail: '查看最近的扫描、索引和诊断日志。',
66-
statusDashboardCopyDiagnosticsLabel: '$(copy) 复制诊断信息',
66+
statusDashboardShowDiagnosticsLabel: '$(pulse) 诊断详情',
6767
statusDashboardDiagnosticsSingularDescription: '1 条诊断',
6868
statusDashboardDiagnosticsPluralDescription: '{0} 条诊断',
69-
statusDashboardCopyDiagnosticsDetail: '复制当前文件诊断和 DynaSense 上下文到剪贴板。',
70-
statusDashboardToggleTabNavigationLabel: '$(keyboard) 切换 Tab Navigation',
69+
statusDashboardShowDiagnosticsDetail: '查看当前文件诊断,可跳转或复制完整信息。',
70+
statusDashboardDiagnosticsPlaceHolder: 'DynaSense:查看当前文件诊断',
71+
statusDashboardOpenProblemsLabel: '$(go-to-file) 打开问题面板',
72+
statusDashboardOpenProblemsDescription: 'VS Code Problems',
73+
statusDashboardOpenProblemsDetail: '在 VS Code 问题面板中查看所有诊断。',
74+
statusDashboardCopyFullDiagnosticsLabel: '$(copy) 复制完整诊断信息',
75+
statusDashboardCopyFullDiagnosticsDetail: '复制当前文件诊断、关键字和 DynaSense 上下文。',
76+
statusDashboardDiagnosticJumpDetail: '选择后跳转到对应位置。',
77+
statusDashboardToggleTabNavigationLabel: '$(keyboard) 字段跳转',
7178
statusDashboardTabNavigationOnDescription: '已开启',
7279
statusDashboardTabNavigationOffDescription: '已关闭',
73-
statusDashboardToggleTabNavigationDetail: '切换 LS-DYNA 定宽字段的 Tab 跳转。',
80+
statusDashboardToggleTabNavigationDetail: '切换 Tab 键在 LS-DYNA 定宽字段之间跳转。',
7481
statusDashboardDiagnosticsCopied: '已复制 DynaSense 诊断信息({0} 条)。',
7582
statusDashboardNoDiagnostics: '当前文件没有诊断信息。',
76-
statusDashboardTabNavigationEnabled: 'DynaSense Tab Navigation 已开启。',
77-
statusDashboardTabNavigationDisabled: 'DynaSense Tab Navigation 已关闭。',
83+
statusDashboardTabNavigationEnabled: 'DynaSense 字段跳转已开启。',
84+
statusDashboardTabNavigationDisabled: 'DynaSense 字段跳转已关闭。',
7885
healthStatusReady: 'DynaSense Ready',
7986
healthStatusNeedsSetup: 'DynaSense:{0} 项需要配置',
8087
healthNoticeMessage: 'DynaSense 发现 {0} 项需要配置。',
@@ -264,18 +271,25 @@ const LOCALES = {
264271
statusDashboardShowOutputLabel: '$(output) Open Log',
265272
statusDashboardShowOutputDescription: 'DynaSense output',
266273
statusDashboardShowOutputDetail: 'Open recent scan, indexing, and diagnostics messages.',
267-
statusDashboardCopyDiagnosticsLabel: '$(copy) Copy Diagnostics',
274+
statusDashboardShowDiagnosticsLabel: '$(pulse) Diagnostic Details',
268275
statusDashboardDiagnosticsSingularDescription: '1 diagnostic',
269276
statusDashboardDiagnosticsPluralDescription: '{0} diagnostics',
270-
statusDashboardCopyDiagnosticsDetail: 'Copy active-file diagnostics and DynaSense context to the clipboard.',
271-
statusDashboardToggleTabNavigationLabel: '$(keyboard) Toggle Tab Navigation',
277+
statusDashboardShowDiagnosticsDetail: 'View current-file diagnostics, jump to a problem, or copy the full report.',
278+
statusDashboardDiagnosticsPlaceHolder: 'DynaSense diagnostics for the current file',
279+
statusDashboardOpenProblemsLabel: '$(go-to-file) Open Problems Panel',
280+
statusDashboardOpenProblemsDescription: 'VS Code Problems',
281+
statusDashboardOpenProblemsDetail: 'View all diagnostics in the VS Code Problems panel.',
282+
statusDashboardCopyFullDiagnosticsLabel: '$(copy) Copy Full Diagnostics',
283+
statusDashboardCopyFullDiagnosticsDetail: 'Copy active-file diagnostics, keyword, and DynaSense context.',
284+
statusDashboardDiagnosticJumpDetail: 'Select to jump to this location.',
285+
statusDashboardToggleTabNavigationLabel: '$(keyboard) Field Tab Jump',
272286
statusDashboardTabNavigationOnDescription: 'On',
273287
statusDashboardTabNavigationOffDescription: 'Off',
274-
statusDashboardToggleTabNavigationDetail: 'Switch fixed-width LS-DYNA field navigation for the Tab key.',
288+
statusDashboardToggleTabNavigationDetail: 'Switch Tab-key jumps between fixed-width LS-DYNA fields.',
275289
statusDashboardDiagnosticsCopied: 'Copied DynaSense diagnostics ({0}).',
276290
statusDashboardNoDiagnostics: 'No diagnostics for the current file.',
277-
statusDashboardTabNavigationEnabled: 'DynaSense Tab Navigation enabled.',
278-
statusDashboardTabNavigationDisabled: 'DynaSense Tab Navigation disabled.',
291+
statusDashboardTabNavigationEnabled: 'DynaSense field tab jump enabled.',
292+
statusDashboardTabNavigationDisabled: 'DynaSense field tab jump disabled.',
279293
healthStatusReady: 'DynaSense Ready',
280294
healthStatusNeedsSetup: 'DynaSense: {0} setup items',
281295
healthNoticeMessage: 'DynaSense found {0} setup items.',

0 commit comments

Comments
 (0)