Skip to content

conversation-links-on-repo-lists - Improve AJAX support - #7524

Merged
fregante merged 3 commits into
refined-github:mainfrom
gxr404:fix-conversation-links-on-repo-lists
Jul 6, 2024
Merged

fregante merged 3 commits into
refined-github:mainfrom
gxr404:fix-conversation-links-on-repo-lists

Conversation

@gxr404

@gxr404 gxr404 commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

Closes #7520

Test URLs

Bug1: It should not be displayed in search "code" panel

  1. open github.com/search?q=%22webext%22&type=repositories
  2. Click "Code" in the sidebar
  3. Notice extra links
  4. Refresh the page
  5. The links are gone

Bug2: Refresh the page from search "code" panel , but it does not display after clicking "repositories"

  1. open github.com/search?q=%22webext%22&type=code
  2. Click "Repositories" in the sidebar
  3. The links are gone
  4. Refresh the page
  5. links show

Screenshot

Before:

before

After:

after
|

@fregante

fregante commented Jul 6, 2024

Copy link
Copy Markdown
Member

Thanks for the PR, but I suggested something different in the original issue: I'd rather make the CSS selector stricter so that it doesn't select those items at all. Is it possible?

@fregante

fregante commented Jul 6, 2024

Copy link
Copy Markdown
Member

Technically the feature doesn't work at all because the page has changed, so the selector definitely needs to be updated

https://github.com/search?q=x&type=repositories

Screenshot

@gxr404

gxr404 commented Jul 6, 2024

Copy link
Copy Markdown
Contributor Author

sorry,Does “CSS selector stricter” refer to the observer there?

Since clicking from "code" page to "repositories" page does not refresh and only changes the dom, include cannot add repositories as a judgment criterion

The dom of "repositories" page is similar to the dom of other search results

If solved from the selector level, observerneeds to be changed to observe('[data-testid="results-list"] > div > div > div > h3 .search-title a', .... in order to accurately select "repositories" page DOM
Is this acceptable?

@fregante

fregante commented Jul 6, 2024

Copy link
Copy Markdown
Member

Technically the feature doesn't work at all

Actually not entirely true, the feature works but only when the user lands on the specific repo search page. This is definitely an AJAX issue:

sorry,Does “CSS selector stricter” refer to the observer there?

Yes:

observe('.search-title a', addSearchConversationLinks, {signal});

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your changes actually fix both issues

@fregante fregante changed the title conversation-links-on-repo-lists - Appears on the wrong page(#7520) conversation-links-on-repo-lists - Improve AJAX support Jul 6, 2024
@fregante fregante added the bug label Jul 6, 2024
@fregante
fregante enabled auto-merge (squash) July 6, 2024 07:28
@fregante
fregante merged commit 8397b28 into refined-github:main Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

conversation-links-on-repo-lists - Appears on the wrong page

2 participants