@@ -30,6 +30,8 @@ export async function createGitIngestButton(): Promise<HTMLLIElement> {
3030 // Create link with GitHub's button style
3131 const link = document . createElement ( 'a' ) ;
3232 link . className = 'btn-sm btn' ;
33+ link . id = 'gitingest_btn' ;
34+ link . setAttribute ( 'aria-describedby' , 'gitingest_tooltip' ) ;
3335
3436 // Get custom base URL and window preference from storage
3537 const [ baseUrl , openInNewWindow ] = await Promise . all ( [
@@ -45,6 +47,10 @@ export async function createGitIngestButton(): Promise<HTMLLIElement> {
4547 link . target = '_blank' ;
4648 link . rel = 'noopener noreferrer' ;
4749 }
50+
51+ const tooltipText = openInNewWindow
52+ ? 'Turn this to a LLM-friendly prompt in a new tab'
53+ : 'Turn this to a LLM-friendly prompt' ;
4854
4955 // Create spans for different screen sizes
5056 const linkContent = `
@@ -54,8 +60,21 @@ export async function createGitIngestButton(): Promise<HTMLLIElement> {
5460 ` ;
5561 link . innerHTML = linkContent ;
5662
57- // Add button to container
58- li . appendChild ( link ) ;
63+ // Create tooltip
64+ const tooltip = document . createElement ( 'tool-tip' ) ;
65+ tooltip . setAttribute ( 'for' , 'gitingest_btn' ) ;
66+ tooltip . id = 'gitingest_tooltip' ;
67+ tooltip . setAttribute ( 'popover' , 'manual' ) ;
68+ tooltip . className = 'position-absolute sr-only' ;
69+ tooltip . setAttribute ( 'role' , 'tooltip' ) ;
70+ tooltip . textContent = tooltipText ;
71+
72+ // Add button and tooltip to container
73+ const div = document . createElement ( 'div' ) ;
74+ div . className = 'float-left' ;
75+ div . appendChild ( link ) ;
76+ div . appendChild ( tooltip ) ;
77+ li . appendChild ( div ) ;
5978 li . id = 'git-ingest-button' ;
6079
6180 return li ;
0 commit comments