Files
clide/lib/builtin/claude/src/claude_banner.dart
T
jpmschweitzerandClaude Opus 4.8 16fe71cb3f refactor(i18n): route claude pane labels through the catalog (T-464)
Migrate the hardcoded user-facing strings across builtin.claude — composer,
conversation cards/segments, permission + AskUserQuestion prompts, task dock,
meta-sidebar (activity/config/team/roster), session/model pickers — to
ClideSettings.i18n.string/.interpolated, English kept as the placeholder;
builtin.claude_en_us.json extended to cover them. Context threaded into the
context-free render helpers (toolInputBody chain, _ConversationTurn) the same
way the mono family already is. No en_US behaviour change (D-21).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 21:19:19 +02:00

75 lines
2.7 KiB
Dart

/// Native startup banner for the empty Claude pane (T-149).
///
/// Shown by [ConversationView] before any transcript items arrive — a
/// clide-branded placeholder (clide's own logo) that orients the user:
/// which session, which workspace, what status. The "Claude" label uses
/// Anthropic's published accent colour ([claudeAccent], #d97757) purely
/// to identify Claude — nominative use; clide bundles no Anthropic
/// artwork (see assets/licenses.yaml trademark_notices).
library;
import 'dart:io' show Platform;
import 'package:clide/builtin/claude/src/conversation_view.dart' show claudeAccent;
import 'package:clide/widgets/widgets.dart';
import 'package:flutter/widgets.dart';
class ClaudeBanner extends StatelessWidget {
const ClaudeBanner({super.key, required this.role, this.workspace, this.statusLine});
/// Session role, e.g. `'primary'` or `'secondary 2'`.
final String role;
/// Repo root for this session (shown home-collapsed).
final String? workspace;
/// Status line, e.g. `'tmux · clide-claude-…'`.
final String? statusLine;
@override
Widget build(BuildContext context) {
final ws = _collapseHome(workspace);
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const ClideSvgView.asset('assets/logo/logo.svg', width: 60, height: 60),
const SizedBox(height: 18),
ClideText(
ClideSettings.i18n.string(context, 'banner.title', namespace: 'builtin.claude', placeholder: 'Claude'),
fontSize: clideFontDialogTitle,
color: claudeAccent,
fontWeight: FontWeight.w500,
),
const SizedBox(height: 2),
ClideText(role, fontSize: clideFontSmall, muted: true, fontFamily: ClideSettings.fonts.monoOf(context)),
const SizedBox(height: 16),
if (ws != null) ClideText(ws, fontSize: clideFontCaption, muted: true),
if (statusLine != null) ...[
const SizedBox(height: 2),
ClideText(statusLine!, fontSize: clideFontSmall, muted: true, fontFamily: ClideSettings.fonts.monoOf(context)),
],
const SizedBox(height: 16),
ClideText(
ClideSettings.i18n.string(
context,
'banner.warmingUp',
namespace: 'builtin.claude',
placeholder: 'Warming up — your conversation will appear here.',
),
fontSize: clideFontSmall,
muted: true,
),
],
),
);
}
static String? _collapseHome(String? path) {
if (path == null) return null;
final home = Platform.environment['HOME'] ?? '';
if (home.isNotEmpty && path.startsWith(home)) return '~${path.substring(home.length)}';
return path;
}
}