zachary1220 / HighLighterExtention

实现关键词高亮显示功能的浏览器插件
Apache License 2.0
0 stars 0 forks source link

sweep:showTooltip函数生成的toast样式调整 #2

Open zachary1220 opened 9 months ago

zachary1220 commented 9 months ago

将toast样式改为关键词名称+描述+URL的样式,名称、描述和URL分别单独一行显示,每行之间加入长分割线。关键词字体加粗,描述字体用斜体,URL字体加下划线。

Checklist - [X] Modify `contentScript.js` ✓ https://github.com/zachary1220/HighLighterExtention/commit/0304999c099065dc6eb23554eb259f38770e108f [Edit](https://github.com/zachary1220/HighLighterExtention/edit/sweep/showtooltiptoast/contentScript.js#L337-L359) - [X] Running GitHub Actions for `contentScript.js` ✓ [Edit](https://github.com/zachary1220/HighLighterExtention/edit/sweep/showtooltiptoast/contentScript.js#L337-L359) - [X] Modify `contentScript.js` ! No changes made [Edit](https://github.com/zachary1220/HighLighterExtention/edit/sweep/showtooltiptoast/contentScript.js#L361-L365) - [X] Running GitHub Actions for `contentScript.js` ✗ [Edit](https://github.com/zachary1220/HighLighterExtention/edit/sweep/showtooltiptoast/contentScript.js#L361-L365)
sweep-ai[bot] commented 9 months ago

🚀 Here's the PR! #3

See Sweep's progress at the progress dashboard!
Sweep Basic Tier: I'm using GPT-4. You have 4 GPT-4 tickets left for the month and 2 for the day. (tracking ID: bd2dcc9d35)

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).
Install Sweep Configs: Pull Request

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for 12459ea
Checking contentScript.js for syntax errors... ✅ contentScript.js has no syntax errors! 1/1 ✓
Checking contentScript.js for syntax errors...
✅ contentScript.js has no syntax errors!

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/zachary1220/HighLighterExtention/blob/12459ea1198a89920fd1ca6108a8490ded587055/contentScript.js#L331-L365

Step 2: ⌨️ Coding

--- 
+++ 
@@ -337,7 +337,7 @@
 function showTooltip(content) {
   const tooltip = document.createElement("div");
   tooltip.className = "tooltip";
-  tooltip.textContent = content;
+  tooltip.innerHTML = `${content.name}
${content.description}
${content.url}`; tooltip.style.position = "fixed"; tooltip.style.backgroundColor = "rgba(0, 0, 0, 0.7)"; tooltip.style.color = "#fff"; @@ -348,7 +348,7 @@ // Calculate tooltip position relative to the cursor const mouseX = window.event.clientX; const mouseY = window.event.clientY; - const tooltipWidth = 120; // Set tooltip width + tooltip.style.width = "auto"; // Position the tooltip to the right of the cursor tooltip.style.left = `${mouseX + 15}px`; // Adjust 15px to provide spacing from the cursor

  • [X] Running GitHub Actions for contentScript.jsEdit
    Check contentScript.js with contents:

Ran GitHub Actions for 0304999c099065dc6eb23554eb259f38770e108f:

  • [X] Modify contentScript.js ! No changes made Edit
    Modify contentScript.js with contents:
    • Ensure that the `hideTooltip` function removes the tooltip from the document body.
    • The existing code on lines 363 to 365 already accomplishes this by selecting the tooltip by its class name and removing it from the document body. No changes are needed in this section.

  • [X] Running GitHub Actions for contentScript.jsEdit
    Check contentScript.js with contents:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/showtooltiptoast.


🎉 Latest improvements to Sweep:

  • We just released a dashboard to track Sweep's progress on your issue in real-time, showing every stage of the process – from search to planning and coding.
  • Sweep uses OpenAI's latest Assistant API to plan code changes and modify code! This is 3x faster and significantly more reliable as it allows Sweep to edit code and validate the changes in tight iterations, the same way as a human would.
  • Try using the GitHub issues extension to create Sweep issues directly from your editor! GitHub Issues and Pull Requests.

💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord