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

Decouple logic from interactive grid component #31

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nkzarrabi
Copy link

@nkzarrabi nkzarrabi commented Oct 31, 2024

Fixes #16

Decouple logic from the interactive grid component.

  • Add src/utils/micLogic.ts to export functions for handling microphone positions, zoom, pan, modes, mouse interactions, coordinate conversions, and numpy array string generation.
  • Modify src/components/MicMasterFlex.tsx to import functions from src/utils/micLogic.ts and replace state management, event handlers, and numpy array string generation with utility functions.
  • Add src/utils/micLogic.test.ts to test handling microphone positions, zoom, pan, modes, mouse interactions, coordinate conversions, and numpy array string generation.

For more details, open the Copilot Workspace session.

Fixes nicolasperez19#16

Decouple logic from the interactive grid component.

* Add `src/utils/micLogic.ts` to export functions for handling microphone positions, zoom, pan, modes, mouse interactions, coordinate conversions, and numpy array string generation.
* Modify `src/components/MicMasterFlex.tsx` to import functions from `src/utils/micLogic.ts` and replace state management, event handlers, and numpy array string generation with utility functions.
* Add `src/utils/micLogic.test.ts` to test handling microphone positions, zoom, pan, modes, mouse interactions, coordinate conversions, and numpy array string generation.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/nicolasperez19/mic-master-flex/issues/16?shareId=XXXX-XXXX-XXXX-XXXX).
Fixes nicolasperez19#23

Add Lighthouse audit to CI workflow.

* **package.json**:
  - Add `lighthouse-ci` as a dev dependency.
  - Add a new script `lighthouse` to run Lighthouse CI.

* **.github/workflows/deploy.yml**:
  - Add a new job `lighthouse` to run Lighthouse audit after the `build` job.
  - Use `actions/setup-node@v3` to set up Node.js.
  - Run `npm install` and `npm run lighthouse` in the `lighthouse` job.

* **README.md**:
  - Add a section about Lighthouse audit in the CI process.
  - Include instructions for running Lighthouse CI locally.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/nicolasperez19/mic-master-flex/issues/23?shareId=XXXX-XXXX-XXXX-XXXX).
Fixes #2

Add keyboard shortcuts for changing between add, edit, delete functionality.

* **MicMasterFlex.tsx**
  - Import `useEffect` from React.
  - Add `useEffect` to handle keyboard event listeners for mode changes.
  - Add event listener for 'keydown' event to switch modes based on key pressed ('1' for Pan, '2' for Add, '3' for Edit, '4' for Delete).
  - Add cleanup function to remove event listeners on component unmount.

* **README.md**
  - Add section to document new keyboard shortcuts for changing modes.
  - Update table of contents to include the new section on keyboard shortcuts.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/nicolasperez19/mic-master-flex/issues/2?shareId=XXXX-XXXX-XXXX-XXXX).
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.

Decouple logic from interactive grid component
1 participant