Giter Club home page Giter Club logo

Comments (7)

EINDEX avatar EINDEX commented on August 28, 2024 1

Oh, Maybe I got your idea, you want to have all the notes related to one website.

For example:

When I am on the https://wirenboard.com/en/pages/about/ page. I can see the note for the https://wirenboard.com/en/catalog/kontrollery/ page.

Is that right?

from logseq-copilot.

EINDEX avatar EINDEX commented on August 28, 2024 1

released in 1.13.0, it will be available at edge & chrome store soon.

from logseq-copilot.

EINDEX avatar EINDEX commented on August 28, 2024

Currently, I send the URL without the hash part to logseq to make this recall function.

If you want to extend this function, I suggest just sending one request to logseq and recalling everything you need. Otherwise, logseq needs to process a lot of requests in a short time.

And, there are 2 parts of code related to the recall function.

One is for popup searching:

useEffect(() => {
if (isLoading) return;
new Promise(async () => {
console.log('loading');
let queryOptions = { active: true, lastFocusedWindow: true };
let [tab] = await Browser.tabs.query(queryOptions);
setIsLoading(true);
if (!tab.url) return;
const url = removeUrlHash(tab.url);
const result = await client.blockSearch(url);
if (result.status !== 200) return;
setLogseqSearchResult(result.response!);
mountOpenPageMethod();
});
});

Another is for badge count number:

const badgeSearch = async (url: string | undefined, tabId: number) => {
if (!url) return;
const cleanUrl = removeUrlHash(url);
const searchRes = await logseqClient.blockSearch(cleanUrl);
const resultCount = searchRes.count ? searchRes.count!.toString() : '';
await setExtensionBadge(resultCount, tabId);
};

from logseq-copilot.

EINDEX avatar EINDEX commented on August 28, 2024

And before putting effort into the development work.

I want to know the rules or patterns. what will be in the search result, and what should be excluded.

Could you give an example of fuzzy searching?

from logseq-copilot.

BongeZagh avatar BongeZagh commented on August 28, 2024

Hi EINDEX, thank you for your reply!

Since I primarily use chatGPT for programming, I will do my best to describe it.

Here are two sample websites:
14:42 [[quick capture]]: About us - Wiren Board I removed the hash part it seems copilot can't search notes on my side
14:40 [[quick capture]]: Technologies, equipment and materials for electronic manufacturing sector

My thought will be no matter which page of the site we click, the plugin can always detect my notes under the website. Then we don't have to read the website again.

I gave my question to ChatGPT this is what I got, I have not idea how to test it yet 😂

  useEffect(() => {
    if (isLoading) return;

    new Promise(async () => {
      console.log('loading');
      let queryOptions = { active: true, lastFocusedWindow: true };
      let [tab] = await Browser.tabs.query(queryOptions);
      setIsLoading(true);
      if (!tab.url) return;
      const url = removeUrlHash(tab.url);

      // Format URL to match wildcard
      const formattedUrl = url.replace(/\/.+/, ''); // Matching and removing everything after the last slash using a regular expression

      // Format URL to match regular expression
      const regexFormat = `^${formattedUrl.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')}`; // Escaping special characters

      const result = await client.blockSearch(regexFormat);
      if (result.status !== 200) return;
      setLogseqSearchResult(result.response!);
      mountOpenPageMethod();
    });
  });

from logseq-copilot.

BongeZagh avatar BongeZagh commented on August 28, 2024

Yes!! You understand it correctly.

from logseq-copilot.

BongeZagh avatar BongeZagh commented on August 28, 2024

That was Awesome!! Thanks a lot!!!!!🥳

from logseq-copilot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.