Skip to content

add tags field in extension#141

Open
itailulu wants to merge 1 commit intoActivityWatch:masterfrom
itailulu:feat/tags
Open

add tags field in extension#141
itailulu wants to merge 1 commit intoActivityWatch:masterfrom
itailulu:feat/tags

Conversation

@itailulu
Copy link

@itailulu itailulu commented Nov 3, 2024

adds tags field to extension popup and adds to payload sent to server
CleanShot 2024-11-03 at 10 25 33
CleanShot 2024-11-03 at 11 11 11


Important

Adds a 'tags' field to the extension popup and includes it in the server payload if available.

  • Behavior:
    • Adds a 'tags' input field in popup.html for user input.
    • Updates sendHeartbeat in client.js to include 'tags' in the payload if they exist in local storage.
  • UI:
    • popup.js: Retrieves and displays 'tags' from local storage in the input field.
    • Listens for changes in the 'tags' input and updates local storage accordingly.

This description was created by Ellipsis for 589bec0. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 589bec0 in 33 seconds

More details
  • Looked at 139 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. src/client.js:95
  • Draft comment:
    Ensure that data is not used elsewhere in a way that could be affected by the modification of payload.data to include tags.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The sendHeartbeat function in client.js uses chrome.storage.local.get to retrieve tags, which is asynchronous. The rest of the function depends on this data, so it's correctly placed inside the callback. However, the payload object is being modified directly, which is fine, but it's important to ensure that data is not used elsewhere in a way that could be affected by this modification.

Workflow ID: wflow_MB6euDjToBpyXjzI


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

let tagsInput = document.getElementById('status-tags-input');
tagsInput.addEventListener("change", (event) => {
const tags = event.target.value.split(',').map(tag => tag.trim()).filter(tag => tag);
chrome.storage.local.set({ tags: event.target.value });
Copy link
Contributor

Choose a reason for hiding this comment

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

Store the processed array of tags instead of the raw input value to ensure consistency and avoid storing unnecessary spaces.

Suggested change
chrome.storage.local.set({ tags: event.target.value });
chrome.storage.local.set({ tags: tags });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant