mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
fix(panel): disable click-to-jump on project ranking rows
This commit is contained in:
@@ -1546,7 +1546,6 @@ const I18N_MESSAGES_ZH_CN = Object.freeze({
|
||||
'cons.rankTabWorkspacesCount': '项目排行 ({count})',
|
||||
'cons.workspaceUnbound': '未绑定工作区',
|
||||
'cons.workspaceSessions': '{count} 会话',
|
||||
'cons.workspaceJumpTip': '点击跳转到该项目最近会话',
|
||||
'cons.exportMenuAria': '导出及报告选项',
|
||||
'cons.exportXlsx': '导出 Excel (.xlsx)',
|
||||
'cons.exportXlsxTip': '导出多工作表排版精美的 Excel 报表(自动列宽、千分位及对齐)',
|
||||
@@ -2440,7 +2439,6 @@ const I18N_MESSAGES_EN_US = Object.freeze({
|
||||
'cons.rankTabWorkspacesCount': 'Projects ({count})',
|
||||
'cons.workspaceUnbound': 'Unbound Workspace',
|
||||
'cons.workspaceSessions': '{count} sessions',
|
||||
'cons.workspaceJumpTip': 'Click to inspect latest session in this project',
|
||||
'cons.exportMenuAria': 'Export and report actions',
|
||||
'cons.exportXlsx': 'Export Excel (.xlsx)',
|
||||
'cons.exportXlsxTip': 'Export styled multi-sheet Excel workbook with auto column width and alignment',
|
||||
@@ -30855,7 +30853,7 @@ const ConsumptionView = defineComponent({
|
||||
{
|
||||
className: 'cons-top-conv-row',
|
||||
onClick: () => {
|
||||
if (!rowState.cascadeId) return;
|
||||
if (!rowState.canJump || !rowState.cascadeId) return;
|
||||
hideBreakdownPopover();
|
||||
selectConversation(rowState.cascadeId);
|
||||
uiStore.setState({
|
||||
@@ -30911,10 +30909,9 @@ const ConsumptionView = defineComponent({
|
||||
? t('cons.workspaceUnbound')
|
||||
: String(item.label || item.workspacePath || '—').trim()
|
||||
: String(item.title || item.cascadeId || '—').trim();
|
||||
refs.rowState.cascadeId = String(
|
||||
isWorkspaceRow ? item.latestCascadeId || '' : item.cascadeId || ''
|
||||
);
|
||||
refs.rowState.canJump = item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
||||
refs.rowState.cascadeId = isWorkspaceRow ? '' : String(item.cascadeId || '');
|
||||
refs.rowState.canJump =
|
||||
!isWorkspaceRow && item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
||||
patchClasses(refs.rowEl, {
|
||||
'is-jumpable': refs.rowState.canJump,
|
||||
'cons-workspace-row': isWorkspaceRow,
|
||||
@@ -30923,8 +30920,11 @@ const ConsumptionView = defineComponent({
|
||||
isWorkspaceRow && item.workspacePath && item.workspacePath !== title
|
||||
? `${title} (${item.workspacePath})`
|
||||
: title;
|
||||
const jumpTip = isWorkspaceRow ? t('cons.workspaceJumpTip') : t('cons.topConvJumpTip');
|
||||
patchAttr(refs.rowEl, 'title', refs.rowState.canJump ? `${baseTip} — ${jumpTip}` : baseTip);
|
||||
patchAttr(
|
||||
refs.rowEl,
|
||||
'title',
|
||||
refs.rowState.canJump ? `${baseTip} — ${t('cons.topConvJumpTip')}` : baseTip
|
||||
);
|
||||
patchText(refs.titleTextEl, title);
|
||||
if (refs.wsBadgeEl) {
|
||||
const showWsBadge = isWorkspaceRow && Number(item.sessionCount || 0) > 0;
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>用量监控</title>
|
||||
<link rel="stylesheet" href="/styles.css?v=1795456766440">
|
||||
<link rel="stylesheet" href="/styles.css?v=1795457102792">
|
||||
<script src="/preload.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app-root"></div>
|
||||
<script src="/app.js?v=1795456766440"></script>
|
||||
<script src="/app.js?v=1795457102792"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -287,7 +287,6 @@ export const I18N_MESSAGES_EN_US = Object.freeze({
|
||||
'cons.rankTabWorkspacesCount': 'Projects ({count})',
|
||||
'cons.workspaceUnbound': 'Unbound Workspace',
|
||||
'cons.workspaceSessions': '{count} sessions',
|
||||
'cons.workspaceJumpTip': 'Click to inspect latest session in this project',
|
||||
'cons.exportMenuAria': 'Export and report actions',
|
||||
'cons.exportXlsx': 'Export Excel (.xlsx)',
|
||||
'cons.exportXlsxTip': 'Export styled multi-sheet Excel workbook with auto column width and alignment',
|
||||
|
||||
@@ -287,7 +287,6 @@ export const I18N_MESSAGES_ZH_CN = Object.freeze({
|
||||
'cons.rankTabWorkspacesCount': '项目排行 ({count})',
|
||||
'cons.workspaceUnbound': '未绑定工作区',
|
||||
'cons.workspaceSessions': '{count} 会话',
|
||||
'cons.workspaceJumpTip': '点击跳转到该项目最近会话',
|
||||
'cons.exportMenuAria': '导出及报告选项',
|
||||
'cons.exportXlsx': '导出 Excel (.xlsx)',
|
||||
'cons.exportXlsxTip': '导出多工作表排版精美的 Excel 报表(自动列宽、千分位及对齐)',
|
||||
|
||||
@@ -1520,7 +1520,7 @@ export const ConsumptionView = defineComponent({
|
||||
{
|
||||
className: 'cons-top-conv-row',
|
||||
onClick: () => {
|
||||
if (!rowState.cascadeId) return;
|
||||
if (!rowState.canJump || !rowState.cascadeId) return;
|
||||
hideBreakdownPopover();
|
||||
selectConversation(rowState.cascadeId);
|
||||
uiStore.setState({
|
||||
@@ -1576,10 +1576,9 @@ export const ConsumptionView = defineComponent({
|
||||
? t('cons.workspaceUnbound')
|
||||
: String(item.label || item.workspacePath || '—').trim()
|
||||
: String(item.title || item.cascadeId || '—').trim();
|
||||
refs.rowState.cascadeId = String(
|
||||
isWorkspaceRow ? item.latestCascadeId || '' : item.cascadeId || ''
|
||||
);
|
||||
refs.rowState.canJump = item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
||||
refs.rowState.cascadeId = isWorkspaceRow ? '' : String(item.cascadeId || '');
|
||||
refs.rowState.canJump =
|
||||
!isWorkspaceRow && item.canJump !== false && Boolean(refs.rowState.cascadeId);
|
||||
patchClasses(refs.rowEl, {
|
||||
'is-jumpable': refs.rowState.canJump,
|
||||
'cons-workspace-row': isWorkspaceRow,
|
||||
@@ -1588,8 +1587,11 @@ export const ConsumptionView = defineComponent({
|
||||
isWorkspaceRow && item.workspacePath && item.workspacePath !== title
|
||||
? `${title} (${item.workspacePath})`
|
||||
: title;
|
||||
const jumpTip = isWorkspaceRow ? t('cons.workspaceJumpTip') : t('cons.topConvJumpTip');
|
||||
patchAttr(refs.rowEl, 'title', refs.rowState.canJump ? `${baseTip} — ${jumpTip}` : baseTip);
|
||||
patchAttr(
|
||||
refs.rowEl,
|
||||
'title',
|
||||
refs.rowState.canJump ? `${baseTip} — ${t('cons.topConvJumpTip')}` : baseTip
|
||||
);
|
||||
patchText(refs.titleTextEl, title);
|
||||
if (refs.wsBadgeEl) {
|
||||
const showWsBadge = isWorkspaceRow && Number(item.sessionCount || 0) > 0;
|
||||
|
||||
@@ -1215,10 +1215,13 @@ test('Feature 9: workspace/project cost aggregation (full + fast paths) and Proj
|
||||
const wsRowsAfterSort = view.el.querySelectorAll('.cons-workspace-row');
|
||||
assert.equal(wsRowsAfterSort[0].querySelector('.cons-row-title-text').textContent, 'docs-site');
|
||||
|
||||
// Click workspace row jumps to its latest conversation in steps view
|
||||
// Project rows are read-only breakdown cards and must not jump on click
|
||||
assert.equal(wsRowsAfterSort[0].classList.contains('is-jumpable'), false);
|
||||
const prevView = uiStore.getState().activeView;
|
||||
const prevSelectedCid = telemetryStore.getState().selectedConversationId;
|
||||
wsRowsAfterSort[0].dispatchEvent({ type: 'click' });
|
||||
assert.equal(uiStore.getState().activeView, 'steps');
|
||||
assert.equal(telemetryStore.getState().selectedConversationId, 'ws-conv-b1');
|
||||
assert.equal(uiStore.getState().activeView, prevView);
|
||||
assert.equal(telemetryStore.getState().selectedConversationId, prevSelectedCid);
|
||||
});
|
||||
|
||||
test('Feature 10: StepsDetailView live search, dynamic diagnostic chips, and click-to-inspect step drawer', async (t) => {
|
||||
|
||||
Reference in New Issue
Block a user