From 74f9a45539304a53168d4ba1a7efa0ffbe3f7ac4 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Mon, 18 May 2026 13:32:15 +0200 Subject: [PATCH] extend build-info bake to name + tagline + repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit User asked for the rest of the pubspec-derived strings to share the same path the version went down. gen-build-info now also writes `clideName`, `clideTagline`, `clideRepository` to lib/src/build_info.g.dart from pubspec.yaml. Added a `tagline:` field to pubspec for the short user-facing line (the welcome subtitle, future web meta) — pubspec stays the single source of truth for every name/tagline/version/repository string the app shows. Consumers swept: * welcome banner ('clide' / 'IDE for Claude Code CLI') and status line version label read from the constants. * app.dart WidgetsApp title + project-switcher label use clideName. * clide_column_hat uses clideName for the empty-projects fallback. Co-Authored-By: Claude --- CHANGELOG.md | 12 ++++++++---- Makefile | 10 +++++++--- lib/app.dart | 5 +++-- lib/builtin/welcome/src/welcome_view.dart | 8 ++++---- lib/clide.dart | 10 +++++----- lib/widgets/src/clide_column_hat.dart | 3 ++- pubspec.yaml | 5 +++++ 7 files changed, 34 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb85f9a6..20886d1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,10 +111,14 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit. softer ink-tinted shadow (T-114). - Text-zoom (Ctrl +/-/0) is now a kernel `TextZoom` service and shows up in the palette as `View: Zoom In/Out/Reset Zoom` (T-114). -- `make gen-build-info` bakes `lib/src/build_info.g.dart` (version, - commit, date) and rewrites `assets/licenses.yaml` `self.version:` - from `pubspec.yaml` on every build/run/test target — one source of - truth, no manual sync, no `--dart-define` plumbing. +- `make gen-build-info` bakes `lib/src/build_info.g.dart` (name, + tagline, version, repository, commit, date) and rewrites + `assets/licenses.yaml` `self.version:` from `pubspec.yaml` on every + build/run/test target. Welcome banner / status line / window title + / project switcher labels all read from those constants — one + source of truth, no manual sync, no `--dart-define` plumbing. + New `tagline:` field in pubspec for the short user-facing line + (welcome subtitle, future web meta). - Panel splitters (sidebar / context / editor-split) are tab-focusable; arrow keys nudge by 10 px, Shift+arrow by 50 px (2% / 10% for the editor split). Exposed as slider Semantics nodes so screen readers diff --git a/Makefile b/Makefile index 2ba26a10..e9527883 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ else endif VERSION ?= $(shell awk -F': *' '/^version:/ {gsub(/[" ]/,"",$$2); print $$2; exit}' pubspec.yaml) +NAME ?= $(shell awk -F': *' '/^name:/ {gsub(/[" ]/,"",$$2); print $$2; exit}' pubspec.yaml) +TAGLINE ?= $(shell awk -F': *' '/^tagline:/ {sub(/^tagline: *"?/,"",$$0); sub(/"$$/,"",$$0); print; exit}' pubspec.yaml) +REPOSITORY ?= $(shell awk -F': *' '/^repository:/ {sub(/^repository: */,"",$$0); print; exit}' pubspec.yaml) COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ) @@ -86,14 +89,15 @@ format: ## dart format --set-exit-if-changed. # # Outputs: # - lib/src/build_info.g.dart — gitignored, fresh on every build. -# Exposes `clideVersion` (from pubspec), `clideCommit` (git short -# SHA), `clideDate` (UTC now) for the app to read directly. +# Exposes `clideName`, `clideTagline`, `clideVersion`, `clideRepository` +# (from pubspec), `clideCommit` (git short SHA), `clideDate` (UTC +# now) for the app to read directly. # - assets/licenses.yaml `self.version:` — rewritten in place so the # bundled license manifest never drifts from pubspec. (Tracked in # git; the rewrite is a no-op when in sync.) .PHONY: gen-build-info gen-build-info: - @printf '// GENERATED — do not edit. Regenerated by `make` on every\n// build/run/test (see gen-build-info in Makefile). The version\n// field is read from pubspec.yaml `version:` — the single source\n// of truth for the release number; commit + date stamp at run time.\nconst String clideVersion = '"'"'%s'"'"';\nconst String clideCommit = '"'"'%s'"'"';\nconst String clideDate = '"'"'%s'"'"';\n' "$(VERSION)" "$(COMMIT)" "$(DATE)" > lib/src/build_info.g.dart + @printf '// GENERATED — do not edit. Regenerated by `make` on every\n// build/run/test (see gen-build-info in Makefile). Name / tagline /\n// version / repository come from pubspec.yaml — the single source\n// of truth. Commit + date stamp at run time.\nconst String clideName = '"'"'%s'"'"';\nconst String clideTagline = '"'"'%s'"'"';\nconst String clideVersion = '"'"'%s'"'"';\nconst String clideRepository = '"'"'%s'"'"';\nconst String clideCommit = '"'"'%s'"'"';\nconst String clideDate = '"'"'%s'"'"';\n' "$(NAME)" "$(TAGLINE)" "$(VERSION)" "$(REPOSITORY)" "$(COMMIT)" "$(DATE)" > lib/src/build_info.g.dart @awk -v v="$(VERSION)" '/^self:/ {in_self=1} in_self && /^[[:space:]]+version:/ {sub(/version:.*/, "version: \"" v "\""); in_self=0} {print}' assets/licenses.yaml > assets/licenses.yaml.tmp && mv assets/licenses.yaml.tmp assets/licenses.yaml .PHONY: verify diff --git a/lib/app.dart b/lib/app.dart index 114f486b..da5556a9 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:io' show Platform, Process, ProcessStartMode; import 'package:clide/builtin/welcome/src/welcome_view.dart'; +import 'package:clide/clide.dart' show clideName; import 'package:clide/extension/src/contribution.dart'; import 'package:clide/kernel/kernel.dart'; import 'package:clide/widgets/widgets.dart'; @@ -34,7 +35,7 @@ class _AppRoot extends StatelessWidget { Widget build(BuildContext context) { return WidgetsApp( debugShowCheckedModeBanner: false, - title: 'clide', + title: clideName, color: const Color(0xFF000000), pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) => PageRouteBuilder( settings: settings, @@ -380,7 +381,7 @@ class _ProjectSwitcherButton extends StatelessWidget { listenable: kernel.project, builder: (ctx, _) { final name = kernel.project.current?.path.split('/').last; - final label = name != null ? 'clide > $name' : 'clide'; + final label = name != null ? '$clideName > $name' : clideName; return ClideTappable( onTap: _openSwitcher, builder: (context, hovered, _) => Row( diff --git a/lib/builtin/welcome/src/welcome_view.dart b/lib/builtin/welcome/src/welcome_view.dart index 57ea6c6e..06a77eed 100644 --- a/lib/builtin/welcome/src/welcome_view.dart +++ b/lib/builtin/welcome/src/welcome_view.dart @@ -1,6 +1,6 @@ import 'dart:async'; -import 'package:clide/clide.dart' show clideVersion; +import 'package:clide/clide.dart' show clideName, clideTagline, clideVersion; import 'package:clide/kernel/kernel.dart'; import 'package:clide/widgets/widgets.dart'; import 'package:flutter/services.dart' show MissingPluginException; @@ -135,8 +135,8 @@ class _Header extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ClideText('clide', fontSize: clideFontWelcomeBanner, fontWeight: FontWeight.w300, color: tokens.globalForeground), - ClideText('IDE for Claude Code CLI', muted: true, fontSize: clideFontDialogTitle), + ClideText(clideName, fontSize: clideFontWelcomeBanner, fontWeight: FontWeight.w300, color: tokens.globalForeground), + ClideText(clideTagline, muted: true, fontSize: clideFontDialogTitle), ], ), ], @@ -401,7 +401,7 @@ class _StatusLine extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.min, children: [ - ClideText('clide $clideVersion', muted: true, fontSize: clideFontSmall, fontFamily: clideMonoFamily), + ClideText('$clideName $clideVersion', muted: true, fontSize: clideFontSmall, fontFamily: clideMonoFamily), ClideText(' · ', muted: true, fontSize: clideFontSmall), if (!tc.resolved) ClideText('checking…', muted: true, fontSize: clideFontSmall, fontFamily: clideMonoFamily) diff --git a/lib/clide.dart b/lib/clide.dart index 1c4d67d5..074964da 100644 --- a/lib/clide.dart +++ b/lib/clide.dart @@ -27,8 +27,8 @@ export 'src/ipc/schema_v1.dart'; export 'src/panes/event_sink.dart'; export 'src/panes/pane.dart' show Pane, PaneKind; -// clideVersion / clideCommit / clideDate live in lib/src/build_info.g.dart, -// regenerated by every `make` build/run/test target from pubspec.yaml + -// git short SHA + current UTC time. See `gen-build-info` in the -// Makefile. -export 'src/build_info.g.dart' show clideVersion, clideCommit, clideDate; +// clideName, clideTagline, clideVersion, clideRepository, clideCommit, +// clideDate live in lib/src/build_info.g.dart, regenerated by every +// `make` build/run/test target from pubspec.yaml + git short SHA + +// current UTC time. See `gen-build-info` in the Makefile. +export 'src/build_info.g.dart' show clideName, clideTagline, clideVersion, clideRepository, clideCommit, clideDate; diff --git a/lib/widgets/src/clide_column_hat.dart b/lib/widgets/src/clide_column_hat.dart index 71f47583..722c65a4 100644 --- a/lib/widgets/src/clide_column_hat.dart +++ b/lib/widgets/src/clide_column_hat.dart @@ -1,5 +1,6 @@ import 'dart:io' show Platform; +import 'package:clide/clide.dart' show clideName; import 'package:clide/kernel/src/theme/controller.dart'; import 'package:clide/kernel/src/theme/tokens.dart'; import 'package:clide/kernel/src/window_controls.dart'; @@ -71,7 +72,7 @@ class _CenterContent extends StatelessWidget { final parts = []; if (project != null) parts.add(project!); if (branch != null) parts.add(branch!); - final label = parts.isEmpty ? 'clide' : parts.join(' > '); + final label = parts.isEmpty ? clideName : parts.join(' > '); return Center( child: ClideText(label, fontSize: 12, color: tokens.globalTextMuted, fontFamily: clideMonoFamily), ); diff --git a/pubspec.yaml b/pubspec.yaml index 8ebb081e..4af2bae7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,6 +15,11 @@ description: >- publish_to: none version: 2.1.0 repository: https://github.com/postmeridiem/clide +# Short user-facing tagline (the welcome subtitle, web meta +# description, etc.). Baked into lib/src/build_info.g.dart by +# `make gen-build-info` — pubspec.yaml is the single source of +# truth; nothing else duplicates this string in source. +tagline: "IDE for Claude Code CLI" # Pre-push line-coverage floor. Ratchets up only — see D-66. # Reading: `awk -F: '/^coverage_floor:/ {gsub(/ /,"",$2); print $2}' pubspec.yaml`.