1- import { Box , createCliRenderer , parseColor , type RGBA , Text } from '@opentui/core'
1+ import {
2+ type BorderSides ,
3+ Box ,
4+ createCliRenderer ,
5+ parseColor ,
6+ type RGBA ,
7+ Text
8+ } from '@opentui/core'
29import {
310 type HarnessStatus ,
411 type HarnessTarget ,
@@ -812,13 +819,18 @@ function buildSettingRows(snapshot: DashboardSnapshot, harnesses: HarnessStatus[
812819 ]
813820}
814821
822+ // A panel clipped by scrolling keeps its title but loses its bottom border,
823+ // so it reads as continuing into the "↓ more" line instead of complete.
824+ const openBottomBorder : BorderSides [ ] = [ 'top' , 'left' , 'right' ]
825+
815826function settingsPanel (
816827 ctx : Ctx ,
817828 snapshot : DashboardSnapshot ,
818829 allRows : SettingRow [ ] ,
819830 provider : ProviderId ,
820831 selected : number ,
821- visible : Set < number >
832+ visible : Set < number > ,
833+ openBottom : boolean
822834) {
823835 const state = snapshot . providers . find ( s => s . provider === provider )
824836 const policy = state ?. policy
@@ -904,7 +916,7 @@ function settingsPanel(
904916 const auto = policy ?. enabled ? `⟳ auto ${ policy . thresholdPercent } %` : 'auto off'
905917 return Box (
906918 {
907- border : true ,
919+ border : openBottom ? openBottomBorder : true ,
908920 borderColor : rgb ( routed ? ctx . theme . border : ctx . theme . warn ) ,
909921 borderStyle : 'rounded' ,
910922 flexDirection : 'column' ,
@@ -924,7 +936,8 @@ function harnessPanel(
924936 statuses : HarnessStatus [ ] ,
925937 allRows : SettingRow [ ] ,
926938 selected : number ,
927- visible : Set < number >
939+ visible : Set < number > ,
940+ openBottom : boolean
928941) {
929942 const entries = allRows
930943 . map ( ( row , index ) => ( { index, row } ) )
@@ -963,7 +976,7 @@ function harnessPanel(
963976 } )
964977 return Box (
965978 {
966- border : true ,
979+ border : openBottom ? openBottomBorder : true ,
967980 borderColor : rgb ( ctx . theme . border ) ,
968981 borderStyle : 'rounded' ,
969982 flexDirection : 'column' ,
@@ -1023,11 +1036,28 @@ function settingsBody(
10231036 for ( let index = start ; index <= end ; index += 1 ) {
10241037 visible . add ( index )
10251038 }
1039+ const clippedBelow = ( lastRow : number ) : boolean => end < lastRow
10261040 const children = [
10271041 ...( start > 0 ? [ centered ( Text ( { content : '↑ more' , fg : rgb ( ctx . theme . faint ) } ) ) ] : [ ] ) ,
1028- settingsPanel ( ctx , snapshot , rows , 'openai' , state . settingsSelected , visible ) ,
1029- settingsPanel ( ctx , snapshot , rows , 'anthropic' , state . settingsSelected , visible ) ,
1030- harnessPanel ( ctx , harnesses , rows , state . settingsSelected , visible ) ,
1042+ settingsPanel (
1043+ ctx ,
1044+ snapshot ,
1045+ rows ,
1046+ 'openai' ,
1047+ state . settingsSelected ,
1048+ visible ,
1049+ clippedBelow ( openaiCount - 1 )
1050+ ) ,
1051+ settingsPanel (
1052+ ctx ,
1053+ snapshot ,
1054+ rows ,
1055+ 'anthropic' ,
1056+ state . settingsSelected ,
1057+ visible ,
1058+ clippedBelow ( openaiCount + anthropicCount - 1 )
1059+ ) ,
1060+ harnessPanel ( ctx , harnesses , rows , state . settingsSelected , visible , clippedBelow ( total - 1 ) ) ,
10311061 ...( end < total - 1 ? [ centered ( Text ( { content : '↓ more' , fg : rgb ( ctx . theme . faint ) } ) ) ] : [ ] )
10321062 ] . filter ( child => child !== null )
10331063 return column ( ctx , children , 78 )
0 commit comments