-
Notifications
You must be signed in to change notification settings - Fork 2
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
sweep: add a panel to toggle individual annotations #35
Comments
Here's the PR! #36.⚡ Sweep Basic Tier: I'm using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day. (tracking ID:
559b64db5b )For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets). Actions (click)
Sandbox Execution ✓Here are the sandbox execution logs prior to making any changes: Sandbox logs for
|
# Gensplore | |
A simple genome browser for smallish genomes (e.g. viruses and bacteria) | |
![image](https://user-images.githubusercontent.com/19732295/219011538-43b9b66b-0227-4171-87c6-08b496a7bf2e.png) | |
## https://gensplore.theo.io/ | |
### Adding custom genomes | |
Lines 1 to 55 in 12a9ff3
{ | |
"name": "genbank_view", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"@headlessui/react": "^1.7.16", | |
"@tanstack/react-virtual": "^3.0.0-beta.48", | |
"@testing-library/jest-dom": "^5.16.5", | |
"@testing-library/react": "^13.4.0", | |
"@testing-library/user-event": "^13.5.0", | |
"autoprefixer": "^10.4.13", | |
"bio-parsers": "^9.3.0", | |
"color-hash": "^2.0.2", | |
"postcss": "^8.4.21", | |
"qs": "^6.11.0", | |
"rc-slider": "^10.1.1", | |
"react": "^18.2.0", | |
"react-debounce-input": "^3.3.0", | |
"react-dom": "^18.2.0", | |
"react-icons": "^4.7.1", | |
"react-router-dom": "^6.8.1", | |
"react-scripts": "5.0.1", | |
"react-spinners": "^0.13.8", | |
"react-toastify": "^9.1.1", | |
"react-tooltip": "^5.7.5", | |
"react-use": "^17.4.0", | |
"tailwindcss": "^3.2.6", | |
"ve-range-utils": "^2.6.6", | |
"ve-sequence-utils": "^5.2.9", | |
"web-vitals": "^2.1.4" | |
}, | |
"scripts": { | |
"start": "react-scripts start", | |
"build": "react-scripts build", | |
"test": "react-scripts test", | |
"eject": "react-scripts eject" | |
}, | |
"eslintConfig": { | |
"extends": [ | |
"react-app", | |
"react-app/jest" | |
] | |
}, | |
"browserslist": { | |
"production": [ | |
">0.2%", | |
"not dead", | |
"not op_mini all" | |
], | |
"development": [ | |
"last 1 chrome version", | |
"last 1 firefox version", | |
"last 1 safari version" | |
] | |
} |
Lines 1 to 5 in 12a9ff3
module.exports = { | |
plugins: { | |
tailwindcss: {}, | |
autoprefixer: {}, | |
}, |
Lines 1 to 7 in 12a9ff3
/** @type {import('tailwindcss').Config} */ | |
module.exports = { | |
content: ["./src/**/*.{html,js}"], | |
theme: { | |
extend: {}, | |
}, | |
plugins: [], |
Step 2: ⌨️ Coding
- Create
src/components/AnnotationTogglePanel.js
✓ 5aeb01b
Create src/components/AnnotationTogglePanel.js with contents:
• Create a new file `src/components/AnnotationTogglePanel.js`.
• In this file, define a new React component `AnnotationTogglePanel`. This component should maintain a state object that tracks the toggle state for each annotation.
• The render method of this component should iterate over the available annotations and for each one, render a toggle switch. The state of this switch should be bound to the corresponding entry in the state object.
• Export this component as the default export of the file.
- Ran sandbox for
src/components/AnnotationTogglePanel.js
. ✓ 9b0a7c8
Sandbox logs for https://github.com/theosanderson/gensplore/commit/9b0a7c89ed58c9211e460184de093f820b095536
trunk fmt src/components/AnnotationTogglePanel.js || exit 0
1/2 ✓✔ Formatted src/components/AnnotationTogglePanel.js Re-checking autofixed files... Checked 1 file ✔ No issues
trunk check --fix --print-failures src/components/AnnotationTogglePanel.js
2/2 ✓Checked 1 file ✔ No issues
- Modify
src/App.js
✓ f876222
Modify src/App.js with contents:
• In `src/App.js`, import the `AnnotationTogglePanel` component from `src/components/AnnotationTogglePanel.js`.
• Modify the render method of the `App` component to include the `AnnotationTogglePanel`. This should be placed in a suitable location in the layout, such as in a sidebar or a modal dialog.
• Pass a callback to the `AnnotationTogglePanel` that allows it to update the parent component's state with the current toggle states.
- Ran sandbox for
src/App.js
. ✗
Sandbox logs for
trunk fmt src/App.js || exit 0
1/2 ✓FAILURES prettier src/App.js .trunk/out/oJO6G.yaml NOTICES A tool failed to run. You can open the details yaml file for more information. Checked 0 files ✖ No issues, 1 failure
trunk check --fix --print-failures src/App.js
2/2 ❌ (`1`)FAILURES prettier src/App.js .trunk/out/MlCBs.yaml NOTICES A tool failed to run. You can open the details yaml file for more information. Checked 1 file ✖ No issues, 1 failure # .trunk/out/MlCBs.yaml trunk_cli_version: 1.17.2 title: prettier exited with exit_code=2 report: - prettier exited with exit_code=2 - linter: command: | /root/.cache/trunk/tools/prettier/3.1.0-a552fdee5ef3daae1274e7dca8183c14/node_modules/.bin/prettier -w src/App.js stdin_path: (none) run_from: /tmp/trunk-0/sFQXXY/SR2Ryp timeout: 10m rerun: (cd /tmp/trunk-0/sFQXXY/SR2Ryp; env -i PATH=/root/.cache/trunk/tools/prettier/3.1.0-a552fdee5ef3daae1274e7dca8183c14/node_modules/.bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3/bin:/root/.cache/trunk/tools/node/18.12.1-00ae74f39ac4de3ff3c7e3686016ebf3:/root/.nvm/versions/node/v18.17.0/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NODE_PATH=/root/.cache/trunk/tools/prettier/3.1.0-a552fdee5ef3daae1274e7dca8183c14/node_modules HOME=/root /root/.cache/trunk/tools/prettier/3.1.0-a552fdee5ef3daae1274e7dca8183c14/node_modules/.bin/prettier -w src/App.js) affects_cache: - package.json direct_configs: [] exit_status: exited exit_code: 2 stdout: (none) stderr: | [error] src/App.js: SyntaxError: Unexpected token (472:11) [error] 470 | 472 | [error] | ^ [error] 473 | > [error] 474 | Customize appearance [error] 475 | parser: | (none)
- Modify
src/App.js
✓ ec1ce71
Modify src/App.js with contents: Move the AnnotationTogglePanel component out of the Dialog.Description opening tag. Place it above the Dialog.Description tag, so it remains within the Dialog.Panel but is not a child of the Dialog.Description tag.
- Ran sandbox for
src/App.js
. ✓ 44ecd3f
Sandbox logs for https://github.com/theosanderson/gensplore/commit/44ecd3f565d6d219efbf343f6f1dd76532886fc2
trunk fmt src/App.js || exit 0
1/2 ✓✔ Formatted src/App.js Re-checking autofixed files... Checked 1 file ✔ No issues
trunk check --fix --print-failures src/App.js
2/2 ✓Checked 1 file ✔ No issues
- Ran sandbox for
src/App.js
. ✓
Sandbox logs for
trunk fmt src/App.js || exit 0
1/2 ✓Checked 1 file ✔ No issues
trunk check --fix --print-failures src/App.js
2/2 ✓Checked 1 file ✔ No issues
- Create
src/components/GenomeDisplay.js
✓ f79b976
Create src/components/GenomeDisplay.js with contents:
• In `src/components/GenomeDisplay.js`, modify the component to accept a new prop that contains the annotation toggle states.
• In the render method, filter the displayed annotations based on the toggle states.
• This will ensure that only the annotations with their corresponding toggle switched on in the `AnnotationTogglePanel` are displayed.
- Ran sandbox for
src/components/GenomeDisplay.js
. ✓ 60e8d7a
Sandbox logs for https://github.com/theosanderson/gensplore/commit/60e8d7afa39791c2b0537b6b5b738adf4cff895d
trunk fmt src/components/GenomeDisplay.js || exit 0
1/2 ✓✔ Formatted src/components/GenomeDisplay.js Re-checking autofixed files... Checked 1 file ✔ No issues
trunk check --fix --print-failures src/components/GenomeDisplay.js
2/2 ✓Checked 1 file ✔ No issues
Step 3: 🔁 Code Review
I have finished reviewing the code for completeness. I did not find errors for sweep/annotation-toggle-panel
.
🎉 Latest improvements to Sweep:
- Sweep now uses the
rope
library to refactor Python! Check out Large Language Models are Bad at Refactoring Code. To have Sweep refactor your code, trysweep: Refactor <your_file>.py
! - Sweep finds and fixes bugs in your code by writing unit tests! Check out Having GPT-4 Iterate on Unit Tests like a Human.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.
Join Our Discord
Checklist
src/components/AnnotationTogglePanel.js
✓ 5aeb01bsrc/components/AnnotationTogglePanel.js
. ✓ 9b0a7c8src/App.js
✓ f876222src/App.js
. ✗src/App.js
✓ ec1ce71src/App.js
. ✓ 44ecd3fsrc/App.js
. ✓src/components/GenomeDisplay.js
✓ f79b976src/components/GenomeDisplay.js
. ✓ 60e8d7aThe text was updated successfully, but these errors were encountered: