@@ -2,18 +2,6 @@ import { existsSync } from "node:fs";
22import { getSnapshotPath } from "../cache/snapshot.js" ;
33import { theme } from "./output.js" ;
44
5- const SYMBOL_LOGO = [
6- " ╷ ╱╲" ,
7- " ╭──────┼──────╱ ╲" ,
8- " ╭─╯ ●─────╯ ╱" ,
9- " ╱ ╱│ ╱" ,
10- "│ ╱ │ ╭────╯" ,
11- "│ ╱ │╱╱" ,
12- " ╲__╱ ╱│" ,
13- " ╲____╱ │" ,
14- " ╵"
15- ] ;
16-
175const WIDE_WORDMARK = [
186 "██████╗ ███████╗██╗ ██╗███╗ ███╗ █████╗ ██████╗" ,
197 "██╔══██╗██╔════╝██║ ██║████╗ ████║██╔══██╗██╔══██╗" ,
@@ -26,6 +14,8 @@ const WIDE_WORDMARK = [
2614const WIDE_PANEL_WIDTH = 76 ;
2715const COMPACT_PANEL_WIDTH = 48 ;
2816const WIDE_TERMINAL_MINIMUM = 72 ;
17+ const PRODUCT_LABEL = "DEVMAP CLI" ;
18+ const PRODUCT_CAPABILITIES = "CODEBASE MAP / STATIC ANALYSIS / AI CONTEXT" ;
2919
3020export function printWelcome ( projectRoot : string ) : void {
3121 const hasSnapshot = existsSync ( getSnapshotPath ( projectRoot ) ) ;
@@ -49,32 +39,39 @@ export function printWelcome(projectRoot: string): void {
4939
5040export function renderWelcomeBrandPanel ( terminalWidth : number ) : string {
5141 const isWide = terminalWidth >= WIDE_TERMINAL_MINIMUM ;
52- const panelWidth = Math . max (
53- 28 ,
54- Math . min (
55- terminalWidth ,
56- isWide ? WIDE_PANEL_WIDTH : COMPACT_PANEL_WIDTH
57- )
42+ const contentWidth = Math . max (
43+ 24 ,
44+ Math . min ( terminalWidth , isWide ? WIDE_PANEL_WIDTH : COMPACT_PANEL_WIDTH )
5845 ) ;
59- const contentWidth = panelWidth - 4 ;
6046 const wordmark = isWide ? WIDE_WORDMARK : [ "DEVMAP" ] ;
61- const content = [
62- ...SYMBOL_LOGO ,
47+ const label = centerLine ( `[ ${ PRODUCT_LABEL } ]` , contentWidth ) ;
48+ const wordmarkRows = centerBlock ( wordmark , contentWidth ) ;
49+ const capabilities = centerLine (
50+ isWide ? PRODUCT_CAPABILITIES : "CODEBASE INTELLIGENCE" ,
51+ contentWidth
52+ ) ;
53+ const separator = "━" . repeat ( Math . min ( contentWidth , 64 ) ) ;
54+
55+ return [
56+ `${ theme . gray } ${ label } ${ theme . reset } ` ,
6357 "" ,
64- ...wordmark
65- ] ;
66- const top = `╭${ "─" . repeat ( panelWidth - 2 ) } ╮` ;
67- const bottom = `╰${ "─" . repeat ( panelWidth - 2 ) } ╯` ;
68- const rows = content . map ( ( line ) => {
69- const visibleLine = line . slice ( 0 , contentWidth ) ;
70- const leftPadding = Math . floor ( ( contentWidth - visibleLine . length ) / 2 ) ;
71- const rightPadding = contentWidth - visibleLine . length - leftPadding ;
72- return `│ ${ " " . repeat ( leftPadding ) } ${ visibleLine } ${ " " . repeat ( rightPadding ) } │` ;
73- } ) ;
58+ ...wordmarkRows . map ( ( line ) => `${ theme . aqua } ${ line } ${ theme . reset } ` ) ,
59+ "" ,
60+ `${ theme . gray } ${ capabilities } ${ theme . reset } ` ,
61+ `${ theme . aqua } ${ separator } ${ theme . reset } `
62+ ] . join ( "\n" ) ;
63+ }
64+
65+ function centerLine ( line : string , width : number ) : string {
66+ const visibleLine = line . slice ( 0 , width ) ;
67+ const leftPadding = Math . floor ( ( width - visibleLine . length ) / 2 ) ;
68+ return `${ " " . repeat ( leftPadding ) } ${ visibleLine } ` ;
69+ }
7470
75- return [ top , ...rows , bottom ]
76- . map ( ( line ) => `${ theme . aqua } ${ line } ${ theme . reset } ` )
77- . join ( "\n" ) ;
71+ function centerBlock ( lines : string [ ] , width : number ) : string [ ] {
72+ const blockWidth = Math . min ( width , Math . max ( ...lines . map ( ( line ) => line . length ) ) ) ;
73+ const leftPadding = Math . floor ( ( width - blockWidth ) / 2 ) ;
74+ return lines . map ( ( line ) => `${ " " . repeat ( leftPadding ) } ${ line . slice ( 0 , width ) } ` ) ;
7875}
7976
8077function printCommand ( command : string , description ?: string ) : void {
0 commit comments