ARTIST-Association / ARTIST-Association/CANVAS

Improve code quality of the JS commands

Open
#72 0 comments 0 reactions 0 assignees View on GitHub
code quality
Dominant language
Python
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Improve the code quality of the commands in `canvas_project/static/js/commands/`:
- [ ] Reduce code duplication by introducing super classes for shared functionality
- [ ] in `undoRedoHandler.mjs`: replace hard-coded magic number with a class variable for the maximum stack size
- [ ] in `updateCommands.mjs`: validate new attribute values, not just the attribute names
- Check if this is also necessary in create commands
- [ ] Reuse code to generate name of copied objects (related to #55)

Contributor guide

Open the contributing guide

Research direction

Start by reading the files under canvas_project/static/js/commands/, especially undoRedoHandler.mjs and updateCommands.mjs, and compare the create commands. Identify duplicated shared functionality, the hard-coded maximum stack size, attribute validation, and copied-object naming; done means these four areas are addressed consistently, including the related #55 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.