Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pinboard] Autocomplete existing tags #7709

Closed
rayepeng opened this issue Jul 29, 2023 · 3 comments
Closed

[Pinboard] Autocomplete existing tags #7709

rayepeng opened this issue Jul 29, 2023 · 3 comments
Labels
extension: pinboard Issues related to the pinboard extension extension Issues related to one of the extensions in the Store feature request New feature or improvement status: stalled Stalled due inactivity

Comments

@rayepeng
Copy link
Contributor

Extension

https://www.raycast.com/fe9lix/pinboard

Description

When I add a bookmark, I want to autocomplete existing tags

I tried to modify it myself, but I have some problems

get all existing tags

// get all tags
export async function getAllTags(): Promise<string[]> {
  const params = new URLSearchParams();
  params.append("format", "json");
  params.append("auth_token", apiToken);

  const response = await fetch(apiBasePath + "/tags/get?" + params.toString(), {
    method: "get",
  });

  if (!response.ok) {
    return Promise.reject(response.statusText);
  }
  const result = (await response.json()) as Record<string, unknown>;
  return Object.keys(result);
}


  const [tags, setTags] = useState<string[]>([]);
  useEffect(() => {
    (async () => {
      try {
        const tags = await getAllTags(); 
        setTags(tags);
      } catch (error) {
        console.error("Could not get tags", error);
      }
    })();
  }, []);

and then:

<Form.TagPicker id="tags" title="Tags">
        {tags.map((tag) => (
          <Form.TagPicker.Item key={tag} value={tag} title={tag} />
        ))}
</Form.TagPicker>

finally like this:
image

But in this way, only existing tags can be automatically selected, and new tags cannot be added. Is there a solution?

Who will benefit from this feature?

No response

Anything else?

No response

@rayepeng rayepeng added extension Issues related to one of the extensions in the Store feature request New feature or improvement labels Jul 29, 2023
@raycastbot raycastbot added the extension: pinboard Issues related to the pinboard extension label Jul 29, 2023
@raycastbot
Copy link
Collaborator

Thank you for opening this issue!

🔔 @fe9lix you might want to have a look.

💡 Tip: Once the issue is resolved, comment @raycastbot close this issue to close it.

@raycastbot
Copy link
Collaborator

This issue has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊

@raycastbot raycastbot added the status: stalled Stalled due inactivity label Sep 17, 2023
@raycastbot
Copy link
Collaborator

This issue has been automatically closed due to inactivity.

Feel free to comment in the thread when you're ready to continue working on it 🙂

You can also catch us in Slack if you want to discuss this.

@raycastbot raycastbot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension: pinboard Issues related to the pinboard extension extension Issues related to one of the extensions in the Store feature request New feature or improvement status: stalled Stalled due inactivity
Projects
None yet
Development

No branches or pull requests

2 participants