ARTIST-Association / ARTIST-Association/CANVAS

Improve dynamic creation of HTML DOM Elements in JavaScript

Open
#58 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

Creating more complex HTML elements in JS makes the JS less readable (e.g. Jobs & JobInterface, Inspector Components, Overview Elements) and mixes program logic with presentation.
- Separate logic and presentation
- Consider pre-defining elements in HTML and reusing shared elements

Some (non-exhaustive) examples:
- button creation in `inspectorComponents.mjs`: currently there is a lot of code duplication between the edit/duplicate/delete buttons
- creation of the favorite buttons in `projectOverviewManager.mjs`
- `createInputField` in `commandPrompt.mjs`: could the input element already be declared in the `commandPromptModal.html`?

Contributor guide

Open the contributing guide

Research direction

Start by comparing button creation in inspectorComponents.mjs, favorite buttons in projectOverviewManager.mjs, and createInputField in commandPrompt.mjs with commandPromptModal.html. Identify which elements can be shared or pre-defined while keeping logic separate from presentation. Done means the named examples are less duplicated and their existing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.