Skip to content

Commit aa4dd35

Browse files
committed
feat: bump version to 1.2 and enhance Git Ingest button with tooltip functionality
1 parent c49a10e commit aa4dd35

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

entrypoints/content/git-ingest-button.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gitingest-extension",
33
"description": "open git ingest fastly",
44
"private": true,
5-
"version": "1.1.2",
5+
"version": "1.2",
66
"type": "module",
77
"author": {
88
"name": "甜檸Cirtron (lcandy2)",

0 commit comments

Comments
 (0)