Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SkyfallWasTaken
Copy link
Collaborator

@SkyfallWasTaken SkyfallWasTaken commented Jun 21, 2025

  • Figma API keys no longer required
  • Persistent queue for heartbeats
  • Added onboarding page

Summary by cubic

Removed the need for Figma API keys, added a persistent queue for heartbeats, and introduced an onboarding page for new users.

  • New Features

    • Added onboarding page shown on first install.
    • Heartbeats are now queued persistently to prevent data loss.
  • Refactors

    • Removed all Figma API key logic and UI.

Summary by CodeRabbit

  • New Features

    • On extension installation, a new tab now automatically opens to guide users through onboarding.
    • Heartbeat queue management is now centralized and persisted, improving reliability.
  • Bug Fixes

    • Removed all requirements and UI for entering a Figma API Key, simplifying setup.
    • Streamlined installation instructions and improved documentation clarity.
  • Refactor

    • Internal queue handling for heartbeats is now managed through a shared external store for better state consistency.
  • Documentation

    • Updated README to reflect new naming, simplified onboarding, and clarified setup steps.
  • Chores

    • Updated version number to 1.3.0.

@coderabbitai
Copy link

coderabbitai bot commented Jun 21, 2025

Walkthrough

The updates remove all logic and UI related to the Figma API key, streamline onboarding instructions and flows, and centralize the WakaTime heartbeat queue in an external store. The extension now opens an onboarding page upon installation and computes document hashes locally. Various code and documentation cleanups were performed.

Changes

File(s) Change Summary
README.md Updated branding and onboarding instructions; removed Figma API key step; improved formatting.
package.json Bumped version from 1.2.5 to 1.3.0.
src/entrypoints/background.ts Removed Figma API key logic and "getDocHash" handler; added onboarding tab on install; minor formatting.
src/entrypoints/content.ts Removed "getDocHash" message handling; minor formatting fixes.
src/entrypoints/figma-script.ts Now computes document hash locally; removed external hash request.
src/entrypoints/popup/App.svelte Removed Figma API key input and related logic.
src/lib/components/Tester.svelte Removed Figma API test; simplified to only test WakaTime API; streamlined state and UI.
src/lib/messaging/common.ts Removed getDocHash from ProtocolMap interface.
src/lib/store.ts Removed figmaApiKey export; added wakaQueue export for shared queue state.
src/lib/wakatime.ts Refactored to use external wakaQueue store for heartbeat queue; removed internal queue property.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Extension
    participant OnboardingPage

    User->>Extension: Install extension
    Extension->>OnboardingPage: Open onboarding URL in new tab
Loading
sequenceDiagram
    participant FigmaScript
    participant LocalHash
    participant WakaTime

    FigmaScript->>LocalHash: Export current page as JSON, compute SHA-256
    FigmaScript->>WakaTime: Send heartbeat if docHash changes
    WakaTime->>wakaQueue (Store): Add heartbeat to shared queue
    WakaTime->>WakaTime: Periodically flush queue
Loading

Poem

A hop and a skip, the code is now neat,
No more Figma keys, setup’s a treat!
Heartbeats in queues, all tidy and shared,
Onboarding’s a breeze—no rabbit’s impaired.
With hashes computed right on the spot,
This summer of making, we’re giving a lot!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/entrypoints/background.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

src/entrypoints/figma-script.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

src/entrypoints/popup/App.svelte

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@eslint/js' imported from /eslint.config.js
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:201:49)

  • 4 others

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 051a864 and a616c1b.

📒 Files selected for processing (10)
  • README.md (4 hunks)
  • package.json (1 hunks)
  • src/entrypoints/background.ts (2 hunks)
  • src/entrypoints/content.ts (3 hunks)
  • src/entrypoints/figma-script.ts (2 hunks)
  • src/entrypoints/popup/App.svelte (1 hunks)
  • src/lib/components/Tester.svelte (2 hunks)
  • src/lib/messaging/common.ts (0 hunks)
  • src/lib/store.ts (1 hunks)
  • src/lib/wakatime.ts (3 hunks)
💤 Files with no reviewable changes (1)
  • src/lib/messaging/common.ts
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/entrypoints/figma-script.ts (1)
src/lib/util.ts (1)
  • sha256 (11-20)
src/entrypoints/background.ts (1)
src/lib/util.ts (1)
  • log (4-9)
src/lib/wakatime.ts (2)
src/lib/store.ts (1)
  • wakaQueue (28-28)
src/lib/util.ts (1)
  • log (4-9)
🪛 LanguageTool
README.md

[uncategorized] ~27-~27: Possible missing preposition found.
Context: ...ity ### For Summer of Making users 1. Install the WakaTime browser extension 2. Go to...

(AI_HYDRA_LEO_MISSING_TO)

🔇 Additional comments (21)
src/lib/store.ts (1)

28-28: LGTM! Clean implementation of persistent queue store.

The new wakaQueue store follows the established pattern and correctly initializes with an empty array. The use of JSON.stringify([]) is appropriate for storing array data in the storage system.

README.md (3)

1-1: Good update to reflect current program.

The change from "Shipwrecked" to "Summer of Making" correctly updates the reference to match the current program name.


25-31: Excellent simplification of user onboarding.

The updated installation instructions for Summer of Making users are much cleaner and eliminate the Figma API key requirement, which aligns perfectly with the PR objectives. The streamlined flow will improve user experience.


20-24: Good formatting improvements.

The added blank lines improve readability and document structure.

package.json (1)

5-5: Appropriate version bump for feature release.

The minor version increment to 1.3.0 correctly reflects the addition of new features (persistent queue, onboarding) and the removal of Figma API key requirements. This follows semantic versioning best practices.

src/entrypoints/popup/App.svelte (1)

2-2: Clean removal of figmaApiKey dependency.

The import statement correctly removes the figmaApiKey store reference while maintaining the necessary wakaApiKey and apiUrl imports. This aligns perfectly with the PR objective of removing Figma API key requirements.

src/entrypoints/content.ts (2)

5-5: Good formatting consistency improvement.

Adding the semicolon improves code consistency and follows JavaScript best practices.


17-17: Consistent quote style standardization.

The change from single to double quotes for event listeners improves code consistency throughout the file.

Also applies to: 30-30

src/entrypoints/figma-script.ts (2)

2-2: LGTM: Clean import addition for local hash computation.

The import of sha256 supports the shift from external hash computation to local computation, aligning with the removal of Figma API key dependency.


43-46: LGTM: Excellent refactor to local hash computation.

The change from requesting document hash via background script to computing it locally using figma.currentPage.exportAsync() is well-implemented. This eliminates the dependency on Figma API keys while maintaining the same functional behavior for detecting document changes.

The use of JSON_REST_V1 format ensures consistent representation, and the error handling is preserved.

src/entrypoints/background.ts (3)

3-4: LGTM: Clean removal of unused imports.

The removal of sha256 and figmaApiKey imports is consistent with eliminating the Figma API key dependency and the getDocHash message handler.


10-16: LGTM: Well-implemented onboarding flow.

The installation listener properly opens the onboarding page for new users. The hardcoded URL is acceptable for this use case, though consider using a constant if this URL is referenced elsewhere.


42-46: LGTM: Improved formatting consistency.

The formatting changes improve code readability and consistency.

src/lib/wakatime.ts (4)

4-4: LGTM: Proper import for external queue store.

The import of wakaQueue supports the refactoring to centralize queue management in an external store for persistence.


44-49: LGTM: Well-designed external queue management.

The implementation properly synchronizes the local queue variable with the external store. The subscription ensures the local queue stays in sync, and the setQueue helper function provides a clean interface for updates.

This refactoring enables queue persistence across browser sessions and centralizes state management.


109-109: LGTM: Consistent use of external queue management.

The change from direct array push to using setQueue with spread operator maintains the same functionality while properly updating the external store.


115-130: LGTM: Proper queue management in flush logic.

All references to the internal queue have been correctly updated to use the module-level queue variable, maintaining the same functionality while leveraging the external store for persistence.

The batch processing logic (25 heartbeats per request) and queue slicing operations work correctly with the new queue management approach.

src/lib/components/Tester.svelte (4)

3-3: LGTM: Clean removal of unused import.

The removal of figmaApiKey import is consistent with eliminating Figma API key dependency and testing logic.


9-10: LGTM: Simplified state management.

The state variables are now focused solely on WakaTime testing, making the component more maintainable and easier to understand.


27-43: LGTM: Consistent state updates.

All state updates properly use the simplified boolean variables, maintaining the same user experience while removing Figma API complexity.


52-82: LGTM: Streamlined UI logic.

The UI has been successfully simplified to handle only WakaTime testing while maintaining clear user feedback. The conditional rendering logic is clean and the messages are appropriate for the single test scenario.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@SkyfallWasTaken SkyfallWasTaken merged commit 9a39a0d into main Jun 21, 2025
6 checks passed
@SkyfallWasTaken SkyfallWasTaken deleted the 1.3.0 branch June 21, 2025 18:33
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.

2 participants