feat: homework2#189
Open
SINNERRRR wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR introduces a complete “Buy List” web app UI with persistent state, item controls (add/edit/delete/qty), and updated layout/styling.
Changes:
- Added client-side shopping list logic with localStorage persistence and full DOM rendering.
- Reworked HTML structure into a responsive two-panel layout with stats sections.
- Replaced/expanded CSS to style the application, controls, tooltips, and a fixed author badge.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| smth.js | Implements buy-list CRUD/qty/toggle/edit interactions and persists state to localStorage. |
| main.css | Adds full app styling (layout, buttons, tooltips, print rules) replacing prior minimal styles. |
| index.html | Updates markup to match the new app structure (input/add button, list container, stats, badge). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+8
| let buyList = JSON.parse(localStorage.getItem('buyList')) || [ | ||
| { id: 1, name: 'Помідори', qty: 2, isBought: true }, | ||
| { id: 2, name: 'Печиво', qty: 2, isBought: false }, | ||
| { id: 3, name: 'Сир', qty: 1, isBought: false } | ||
| ]; | ||
|
|
Comment on lines
+103
to
+104
| saveState(); | ||
| } |
Comment on lines
+124
to
+126
| inputField.addEventListener('keypress', (e) => { | ||
| if (e.key === 'Enter') addItem(); | ||
| }); |
Comment on lines
+173
to
+175
| input.addEventListener('keypress', (event) => { | ||
| if (event.key === 'Enter') input.blur(); | ||
| }); |
| .item-controls { display: flex; justify-content: center; align-items: center; gap: 8px; } | ||
| .item-actions { display: flex; justify-content: flex-end; gap: 5px; } | ||
|
|
||
| button { cursor: pointer; outline: none; border: none; color: #fff; font-weight: bold; } |
| background: #8b00ff; color: #fff; padding: 6px 10px; border-radius: 5px; | ||
| font-size: 12px; opacity: 0; visibility: hidden; transition: 0.2s; z-index: 10; font-weight: normal; | ||
| } | ||
| [data-tooltip]:hover::after { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0) scale(1); } |
| <div class="grid-container"> | ||
|
|
||
| <main class="left-panel"> | ||
| <div class="add-item-bar"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HW2