Skip to content

Commit 9656a6e

Browse files
ehsan6shaclaude
andcommitted
apps/box: Diagnostics — Raw diagnostics card branches on pluginPresence
The Raw diagnostics card was hardcoded to "Unavailable until Blox AI is installed" regardless of plugin state. User reported the bug: "plugin shows installed in the Blox AI plugin card, but Raw diagnostics still says Unavailable until Blox AI is installed." Branch the card on pluginPresence: - 'notInstalledOrUnavailable': original Phase 5 copy — "Unavailable until Blox AI is installed" + the explainer about what the section will do once the plugin is there. Encourages install. - 'installed': new copy — "Coming soon — raw state-file dump from your Blox will appear here in a future app version." + a disabled button labelled "Fetch raw diagnostics (coming soon)". Honest about the feature itself being deferred to a future app version, while not blaming the user's plugin state for the unavailability. - 'checking': don't render the card. Otherwise the initial pre-fetch state flashes the wrong message for a frame, same shape of bug as the earlier listActivePlugins flicker. i18n: add `diagnostics.rawDiagnosticsComingSoon` and `diagnostics.rawDiagnosticsComingSoonButton`. Keep the original two keys (`rawDiagnosticsPluginRequired`, `rawDiagnosticsUnavailable`) for the not-installed branch. Tests: 32/32 Diagnostics jest tests pass (was 30; added 2 new i18n key-existence checks). Pre-existing ApprovalModal.test.tsx module-resolve failure unrelated. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 06e9eef commit 9656a6e

3 files changed

Lines changed: 43 additions & 15 deletions

File tree

apps/box/src/i18n/locales/en/translation.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"rawDiagnosticsTitle": "Raw diagnostics (for support)",
2626
"rawDiagnosticsPluginRequired": "When Blox AI is installed, this section will let you fetch your Blox's diagnostic state files and send them to support.",
2727
"rawDiagnosticsUnavailable": "Unavailable until Blox AI is installed",
28+
"rawDiagnosticsComingSoon": "Coming soon — raw state-file dump from your Blox will appear here in a future app version.",
29+
"rawDiagnosticsComingSoonButton": "Fetch raw diagnostics (coming soon)",
2830
"chat": {
2931
"ctaTitle": "Let Blox AI figure it out",
3032
"ctaSubtitle": "Describe what's wrong in a sentence; Blox AI will run diagnostics and suggest fixes you can approve.",

apps/box/src/screens/Diagnostics/Diagnostics.screen.tsx

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -468,21 +468,45 @@ export const DiagnosticsScreen: React.FC = () => {
468468

469469
<FxSpacer height={12} />
470470

471-
{/* ───────── Support diagnostics (deferred-to-plugin shell) ───────── */}
472-
<FxCard>
473-
<FxCard.Title>
474-
{t('diagnostics.rawDiagnosticsTitle')}
475-
</FxCard.Title>
476-
<FxBox paddingVertical="8">
477-
<FxText variant="bodySmallRegular">
478-
{t('diagnostics.rawDiagnosticsPluginRequired')}
479-
</FxText>
480-
<FxSpacer height={8} />
481-
<FxButton disabled>
482-
{t('diagnostics.rawDiagnosticsUnavailable')}
483-
</FxButton>
484-
</FxBox>
485-
</FxCard>
471+
{/* ───────── Support diagnostics (deferred-to-plugin shell) ─────────
472+
Two states:
473+
- plugin NOT installed → "Unavailable until Blox AI is installed"
474+
(the original Phase 5 copy; encourages install)
475+
- plugin installed → "Coming soon — raw state-file dump …"
476+
(the feature itself is still deferred to a future app version;
477+
the plugin install is no longer the blocker)
478+
Don't render anything while presence is still 'checking' — would
479+
flash the wrong message between mount and the first fetch. */}
480+
{pluginPresence !== 'checking' && (
481+
<FxCard>
482+
<FxCard.Title>
483+
{t('diagnostics.rawDiagnosticsTitle')}
484+
</FxCard.Title>
485+
<FxBox paddingVertical="8">
486+
{pluginPresence === 'installed' ? (
487+
<>
488+
<FxText variant="bodySmallRegular">
489+
{t('diagnostics.rawDiagnosticsComingSoon')}
490+
</FxText>
491+
<FxSpacer height={8} />
492+
<FxButton disabled>
493+
{t('diagnostics.rawDiagnosticsComingSoonButton')}
494+
</FxButton>
495+
</>
496+
) : (
497+
<>
498+
<FxText variant="bodySmallRegular">
499+
{t('diagnostics.rawDiagnosticsPluginRequired')}
500+
</FxText>
501+
<FxSpacer height={8} />
502+
<FxButton disabled>
503+
{t('diagnostics.rawDiagnosticsUnavailable')}
504+
</FxButton>
505+
</>
506+
)}
507+
</FxBox>
508+
</FxCard>
509+
)}
486510
</FxBox>
487511
</FxKeyboardAwareScrollView>
488512
);

apps/box/src/screens/Diagnostics/__tests__/Diagnostics.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ describe('i18n strings present', () => {
113113
'diagnostics.rawDiagnosticsTitle',
114114
'diagnostics.rawDiagnosticsPluginRequired',
115115
'diagnostics.rawDiagnosticsUnavailable',
116+
'diagnostics.rawDiagnosticsComingSoon',
117+
'diagnostics.rawDiagnosticsComingSoonButton',
116118
];
117119

118120
function lookup(path: string): unknown {

0 commit comments

Comments
 (0)