Skip to content

Commit 4db33d1

Browse files
osablCopilot
andauthored
optimization/performance (#48)
* refactor: optimize copy event handling * feat: add color sorting algorithm and icon processing * feat: add badge generation script * fix: enable badgeBase64Svg in badge data * fix: update badge message to use title instead of encoded title * feat: implement virtual window for badge display and add loader * refactor: icon loading with IntersectionObserver * feat: enhance virtual window with ordering functionality and sorting logic * refactor: update icon list structure to use div elements for improved layout * feat: improve virtual window responsiveness with dynamic column adjustment * refactor: transferring functions to specific files and organizing code * refactor: update grid layout with CSS variables for improved responsiveness * feat: enhance virtual window with dynamic badge retrieval and sorting * refactor: improve ordering logic by consolidating sort conditions and enhancing readability * refactor: optimize badge sorting * refactor: enhance search functionality with dynamic badge retrieval and improved query handling * refactor: remove unused functions * refactor: list element creation with template literals * refactor: rename parameter * refactor: remove unused file * refactor: optimize variable naming and remove commented code * refactor: run prettier * refactor: clean up webpack configuration * refactor: update badge generation to use chunks * refactor: optimize icon loading with chunked data * refactor: delete unused file * refactor: add badges JSON files to .gitignore * refactor: improve icon loading with optimized chunk fetching and intersection handling * refactor: enhance badge image loading with chunked data fallback * refactor: dep to devDep * refactor: optimize badge chunking with dynamic size limits * refactor: update build scripts * refactor: update prettier ignore * fix: add copy style attribute * fix: move sortBadges function into ordering module scope * fix: add defensive checks for callback functions * test: add unit tests for sortBadges function * test: restructure and enhance sortBadges tests * test: add tests for onOrderChange callback * test: add unit tests for badge searching logic and onSearch callback * fix: ensure valid column count * test: add unit tests for getColumnsCount function * test: add mocks * test: add unit tests for virtual-window module * refactor: simplify and modularize badge generation logic * style: update badge logic to using sprites * refactor: remove badge generation logic and dependencies and change logic * fix: handle empty badge list in sortBadges * test: update ordering tests * test: add mocks for static asset imports in Jest * test: add unit tests for icons module * fix: ensure columns count updates on DOMContentLoaded event * fix: add no-JS fallback and minor changes * test: comment out deprecated e2e test for grid item visibility * test: extend DOM mocks * chore: update ignore files * Update tests/mocks/dom-utils.mock.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update public/scripts/index.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update webpack.config.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update public/stylesheet.css Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update public/stylesheet.css Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor: improve code consistency and formatting * refactor: improve code consistency and formatting * rollback: to previous control positioning styles * refactor: remove unused query parameter and duplicate mocks * Update public/scripts/virtual-window.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ab611a1 commit 4db33d1

24 files changed

Lines changed: 1131 additions & 179 deletions

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ module.exports = {
2525
'/node_modules/',
2626
...getIgnorePattern(process.env.TEST_ENV),
2727
],
28+
moduleNameMapper: {
29+
'\\.(svg|png|jpg|gif|css)$': '<rootDir>/tests/mocks/image-import.mock.js',
30+
},
2831
};
2932

3033
function buildWebsite(env) {

package-lock.json

Lines changed: 123 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"node": ">=16.0.0"
5757
},
5858
"dependencies": {
59-
"simple-icons": "15.11.0"
59+
"simple-icons": "15.11.0",
60+
"virtual-scroller": "1.13.1"
6061
}
6162
}
Lines changed: 16 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)