Open
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the UI layout and styling for the selected repositories chip list to better handle long repository names and many selections, adding truncation, max-width, spacing tweaks, and scroll behavior while keeping the remove button visible and aligned. Flow diagram for updated selectedRepos and repoTags layout structureflowchart TD
A[selectedRepos_container]
B[repoTags_flex_wrapper]
C[repoPlaceholder_text]
D[repoTag_chip_span]
E[inner_truncate_span]
F[remove_repo_button]
G[remove_icon]
A --> B
B --> C
B --> D
D --> E
D --> F
F --> G
A:::selectedRepos
B:::repoTags
D:::chip
E:::truncate
F:::removeBtn
classDef selectedRepos fill:#e5e7eb,stroke:#9ca3af,stroke-width:1px
classDef repoTags fill:#f3f4f6,stroke:#d1d5db,stroke-width:1px
classDef chip fill:#dbeafe,stroke:#60a5fa,stroke-width:1px
classDef truncate fill:#ffffff,stroke:#93c5fd,stroke-width:1px,stroke-dasharray:3 3
classDef removeBtn fill:#eff6ff,stroke:#3b82f6,stroke-width:1px
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 2 security issues, 1 other issue, and left some high level feedback:
Security issues:
- User controlled data in methods like
innerHTML,outerHTMLordocument.writeis an anti-pattern that can lead to XSS vulnerabilities (link) - User controlled data in a
repoTags.innerHTMLis an anti-pattern that can lead to XSS vulnerabilities (link)
General comments:
- Consider adding a
title="${repoFullName}"(or similar) to the truncated repo name span so users can still access the full repository name on hover and for accessibility. - The hardcoded
max-w-[120px]on the repo tag may be too restrictive for some layouts; consider making this width responsive or based on the container (e.g., percentage or breakpoint-based classes) to better adapt to different popup sizes. - The HTML generated in the template literal has indentation and spacing that differs from the surrounding code style in
popup.js; aligning it with the existing formatting will keep the markup easier to read and maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding a `title="${repoFullName}"` (or similar) to the truncated repo name span so users can still access the full repository name on hover and for accessibility.
- The hardcoded `max-w-[120px]` on the repo tag may be too restrictive for some layouts; consider making this width responsive or based on the container (e.g., percentage or breakpoint-based classes) to better adapt to different popup sizes.
- The HTML generated in the template literal has indentation and spacing that differs from the surrounding code style in `popup.js`; aligning it with the existing formatting will keep the markup easier to read and maintain.
## Individual Comments
### Comment 1
<location path="src/scripts/popup.js" line_range="1555-1563" />
<code_context>
- </button>
- </span>
- `;
+ <span class="flex items-center max-w-[120px] px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full m-1">
+ <span class="truncate">${repoName}</span>
+ <button
+ type="button"
</code_context>
<issue_to_address>
**suggestion:** Consider exposing the full repository name via a title or similar attribute to mitigate aggressive truncation.
Because of `max-w-[120px]` and `truncate`, many repo names will be ellipsized with no way to see the full value. Please add a `title="${repoFullName}"` to the outer span or the inner truncated span so the complete name remains available on hover and to assistive technologies.
```suggestion
<span
class="flex items-center max-w-[120px] px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full m-1"
title="${repoFullName}"
>
<span class="truncate">${repoName}</span>
<button
type="button"
class="ml-1 text-blue-600 hover:text-blue-800 remove-repo-btn flex-shrink-0 cursor-pointer"
data-repo-name="${repoFullName}">
<i class="fa fa-times"></i>
</button>
</span>
```
</issue_to_address>
### Comment 2
<location path="src/scripts/popup.js" line_range="1552-1566" />
<code_context>
repoTags.innerHTML = selectedRepos
.map((repoFullName) => {
const repoName = repoFullName.split('/')[1] || repoFullName;
return `
<span class="flex items-center max-w-[120px] px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full m-1">
<span class="truncate">${repoName}</span>
<button
type="button"
class="ml-1 text-blue-600 hover:text-blue-800 remove-repo-btn flex-shrink-0 cursor-pointer"
data-repo-name="${repoFullName}">
<i class="fa fa-times"></i>
</button>
</span>
`;
})
.join(' ');
</code_context>
<issue_to_address>
**security (javascript.browser.security.insecure-document-method):** User controlled data in methods like `innerHTML`, `outerHTML` or `document.write` is an anti-pattern that can lead to XSS vulnerabilities
*Source: opengrep*
</issue_to_address>
### Comment 3
<location path="src/scripts/popup.js" line_range="1552-1566" />
<code_context>
repoTags.innerHTML = selectedRepos
.map((repoFullName) => {
const repoName = repoFullName.split('/')[1] || repoFullName;
return `
<span class="flex items-center max-w-[120px] px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full m-1">
<span class="truncate">${repoName}</span>
<button
type="button"
class="ml-1 text-blue-600 hover:text-blue-800 remove-repo-btn flex-shrink-0 cursor-pointer"
data-repo-name="${repoFullName}">
<i class="fa fa-times"></i>
</button>
</span>
`;
})
.join(' ');
</code_context>
<issue_to_address>
**security (javascript.browser.security.insecure-innerhtml):** User controlled data in a `repoTags.innerHTML` is an anti-pattern that can lead to XSS vulnerabilities
*Source: opengrep*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
4 tasks
Author
|
@mariobehling sir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Fixes
Fixes #528
📝 Summary of Changes
📸 Screenshots / Demo (if UI-related)
Before:
Long repository names overflow outside the container
Layout breaks when multiple repositories are selected
After:
Tags are properly contained within the UI

Long names are truncated with ellipsis (...)
Clean wrapping and scroll behavior for multiple selections
✅ Checklist
👀 Reviewer Notes
This fix improves the usability and visual consistency of the repository filter UI.
The changes ensure the layout remains stable even with long repository names or a large number of selected repositories.
Summary by Sourcery
Improve the selected repositories UI to handle long names and multiple selections without layout issues.
Enhancements: