File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -373,6 +373,30 @@ describe("renderSessionHovercard", () => {
373373 expect ( createLink ?. href ) . toBe ( "https://github.com/openclaw/openclaw/pull/new/feature" ) ;
374374 } ) ;
375375
376+ it ( "omits the no-PR placeholder when the branch has no create URL" , ( ) => {
377+ const container = document . createElement ( "div" ) ;
378+ render (
379+ renderSessionHovercard ( {
380+ pullRequests : snapshot ( {
381+ branch : {
382+ owner : "openclaw" ,
383+ repo : "openclaw" ,
384+ branch : "local-only" ,
385+ changedFiles : 2 ,
386+ additions : 18 ,
387+ deletions : 1 ,
388+ } ,
389+ } ) ,
390+ } ) ,
391+ container ,
392+ ) ;
393+
394+ expect ( container . querySelector ( ".session-hovercard__branch-name" ) ?. textContent ) . toBe (
395+ "openclaw/openclaw · local-only" ,
396+ ) ;
397+ expect ( container . querySelector ( ".session-hovercard__no-pr" ) ) . toBeNull ( ) ;
398+ } ) ;
399+
376400 it ( "renders the latest turn as plain text when progress is absent" , ( ) => {
377401 const container = document . createElement ( "div" ) ;
378402 render (
Original file line number Diff line number Diff line change @@ -514,7 +514,6 @@ function renderPullRequestDetails(snapshot: ControlUiSessionPullRequestSnapshot
514514 if ( ! branch ) {
515515 return nothing ;
516516 }
517- const noPullRequest = t ( "sessionHovercard.noPrYet" ) ;
518517 const createPullRequest = t ( "chat.pullRequests.createPr" ) ;
519518 return html `
520519 < div class ="session-hovercard__branch-row ">
@@ -524,13 +523,13 @@ function renderPullRequestDetails(snapshot: ControlUiSessionPullRequestSnapshot
524523 >
525524 ${ renderDiffStats ( branch ) }
526525 </ div >
527- < div class =" session-hovercard__no-pr " >
528- ${ branch . createUrl
529- ? html ` < a href =${ branch . createUrl } target ="_blank" rel="noopener noreferrer"
526+ ${ branch . createUrl
527+ ? html ` < div class =" session-hovercard__no-pr " >
528+ < a href =${ branch . createUrl } target ="_blank" rel="noopener noreferrer"
530529 > ${ createPullRequest } </ a
531- > `
532- : noPullRequest }
533- </ div >
530+ >
531+ </ div > `
532+ : nothing }
534533 ` ;
535534}
536535
Original file line number Diff line number Diff line change @@ -219,7 +219,6 @@ export const en: TranslationMap = {
219219 workspaceLabel : "Workspace" ,
220220 branchLabel : "Branch" ,
221221 runsOn : "Runs on {providerId} · {profileId}" ,
222- noPrYet : "No PR yet" ,
223222 more : "+{count} more" ,
224223 changedFile : "{count} file" ,
225224 changedFiles : "{count} files" ,
You can’t perform that action at this time.
0 commit comments