Skip to content

Homework2 - #20

Open
KorzhSofiya wants to merge 6 commits into
seagullua:masterfrom
KorzhSofiya:homework2
Open

Homework2#20
KorzhSofiya wants to merge 6 commits into
seagullua:masterfrom
KorzhSofiya:homework2

Conversation

@KorzhSofiya

@KorzhSofiya KorzhSofiya commented May 23, 2026

Copy link
Copy Markdown

Note

Low Risk
Low risk: purely client-side HTML/CSS/JS changes with localStorage persistence and no backend/security-sensitive logic.

Overview
Replaces the placeholder page with a shopping-cart UI (form + product list + bought/remaining side summary) and a full styling overhaul, including responsive layout, tooltips, and an author badge.

Adds client-side list behavior in code.js: render from an items model, support add/delete, toggle bought status, increment/decrement quantity with min=1, inline rename for unbought items, and persist the list to localStorage (cartItems).

Reviewed by Cursor Bugbot for commit 65c56ee. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread index.html
Comment thread code
<option value="piece">шт</option>
<option value="packaging">уп</option>
<option value="liter">л</option>
</select>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit select never persists

Medium Severity

Each item’s unit dropdown is rendered without stored state or a change handler, so any render() rebuilds every select at the default кг and user choices are lost.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit acb28f2. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

There are 4 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 65c56ee. Configure here.

Comment thread code.js
item.name = newName;
}
render();
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blur rerender drops control clicks

Medium Severity

Inline rename calls render() from the input’s blur handler. Clicking +, -, status, or delete while the field is focused blurs first, rebuilds the list, and the intended control click is often lost, so quantity or status may not update until a second click.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 65c56ee. Configure here.

Comment thread code.js
<option value="piece">шт</option>
<option value="packaging">уп</option>
<option value="liter">л</option>
</select>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Measure unit never persisted

Medium Severity

Each row renders a measure select, but item objects only store id, name, amount, and isBought. Nothing reads or writes the chosen unit, and every render() rebuilds the dropdown at its default, so unit changes never stick or appear in localStorage.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 65c56ee. Configure here.

Comment thread code
}
});
render();
}); No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused duplicate script file

Low Severity

The repo adds both code and code.js, but index.html only loads code.js. The code file is nearly the same shopping-list logic without persistence, so it is dead duplicate code that can drift from the live script.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 65c56ee. Configure here.

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