diff --git a/.DS_Store b/.DS_Store index b31a89942a6f0aaaeefc39b4cd30ac7ac03d665a..05db8dfe27b4bc2df34bdd8908608413918bb67a 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/README.md b/README.md index d50ec027d17248fbbb2153c5688f85f4a56bc5c6..a7d0a447f85c3b6e726d450710579ee3879fd9f6 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,11 @@ The distribution of the experimental data aligns well with the current code gene HumanEval and MBPP have approached saturation. APPS and EvalPlus are approaching saturation. The SOTA for Web-Bench is 25.1\%, which is lower (better) than that of the SWE-bench Full and Verified sets. ![SOTAs](./docs/assets/sotas.png) +## 🏅 Leaderboard + +[Leaderboard](https://huggingface.co/spaces/bytedance-research/Web-Bench-Leaderboard) + + ## 📘 Usage [GitHub](https://github.com/bytedance/web-bench) \ No newline at end of file diff --git a/README.zh_CN.md b/README.zh_CN.md index 009fa1b348915ee37a7c6fc2dd0099995444d2da..fc1d437ecc428abaa4b52befea66fd436a00f4e1 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -16,6 +16,10 @@ license: cc-by-4.0 HumanEval 和 MBPP 已趋于饱和,APPS 和 EvalPlus 也正在接近饱和状态。Web-Bench 的 SOTA 为 25.1%,低于 (低更好) SWE-bench Full 和 Verified。 ![SOTAs](./docs/assets/sotas.png) +## 🏅 Leaderboard + +[Leaderboard](https://huggingface.co/spaces/bytedance-research/Web-Bench-Leaderboard) + ## 📘 Usage [GitHub](https://github.com/bytedance/web-bench) \ No newline at end of file diff --git a/datasets/.DS_Store b/datasets/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 Binary files /dev/null and b/datasets/.DS_Store differ diff --git a/datasets/angular.jsonl b/datasets/angular.jsonl index a442cbefc1591bbcf9cf7cc058de2fb3b21a5540..176daad629a00637095cd3632755a947123d322f 100644 --- a/datasets/angular.jsonl +++ b/datasets/angular.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/header/header.component.ts that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/main/main.component.ts where content is aligned at the top left and fills the remaining space. 3) Develop components/blog/blog.component.ts that accepts 'title' and 'detail' as input properties. Display mock blog data in main.component.ts using this blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 3) Include header.component.ts and main.component.ts in app.component.ts 4) The class of title in blog.component.ts is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing blog-list component that accepts an array of blogs as input property and displays the titles in div elements with the class 'list-item'. 2) In main.component.ts, mock the blog data and display it using blog-list with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position blog-list on the left side of main.component.ts with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One blog.component.ts occupies the remaining space of main.component.ts. The content of blog.component.ts should be from first item of the mock data. 5) Angular Version is V19"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in blog-list selectable. When an item in blog-list is selected, highlight it with appealing style and display its content in the blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a blog-form component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of header.component.ts to toggle the blog-form's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of blog-form to hide it. 4) Place the blog-form component in app.component.ts."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of blog-form showing '0' initially. 2) Increment .visible-count by 1 each time blog-form becomes visible."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in blog-form to input title and detail; blog-form can be submitted by button (.submit-btn); Use Angular Forms module. 2) The labels in the Form all add the 'for' attribute, and the attribute values are 'title ' and 'detail' respectively. 3) When submitted, append this Blog to blog-list, and set this Blog as selected. Keep Previous MockData."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create services/blog.service.ts to manage related state (blog list and selected blog) in app.component.ts 2) When submit a new blog-form, check title duplication. Constraint: The duplication check code should be written in blog-form; 3) Add a span(.blog-list-len) near 'Hello Blog' in header.component.ts to show the length of blogs"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of blog.component.ts. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is appended to a service blog.service.ts."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of blog.component.ts. When clicked, toggle blog-form to edit the content of selected Blog. The Title of blog-form is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is appended to a service blog.service.ts; 3) Constraint: blog-form should be singleton, ONLY ONE instance of blog-form exists."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a search.component.ts (width: 200px, border-box) component above blog-list.component.ts in app.component.ts. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs."} -{"id":"task-11","date":"2025-05-12","level":"chanllenging","description":"1) Add a button with the text 'Random Blogs' in header to append 100,000 blogs to blog-list at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not be stuck when 100000 blogs are appended. 3) Constraint: DO NOT USE any third-party packages, ONLY Angular APIs can be used to optimize performance."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing comments.component.ts with the title 'Comments' at the bottom of blog.component.ts. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the class '.comment-item', placed above the TextArea. 4) Create services/comment.service.ts to implement state management without NgRx or other state management libraries, and connect CommentService to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize Angular APIs."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create directives/tooltip.directive.ts that displays a tooltip (.tooltip) at the bottom of the host element when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body using Angular's dynamic component creation. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are allowed."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in blog.component.ts. 2) Develop a pipe or service to reuse Markdown-related logic. 3) Prevent XSS attacks using Angular's DomSanitizer. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create services/toast.service.ts to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show Tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follows the rules, create reusable directives. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in header with text 'Fast Comment'. 2) When clicked, focus Textarea in comments.component.ts and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted. DO NOT use BOM API. Use ViewChild/ContentChild instead of DOM query."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/game/game.component.ts with text 'Hello Game'. 2) Move Previous Logic of app.component.ts to pages/blogPage/blogPage.component.ts 2) Add Route Logic: When browser location is '/', routed to BlogPage. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in BlogPage's header.component.ts to navigate to Game page, and user can go back to BlogPage when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the class for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to show current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse toast.service.ts to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/header/header.component.ts that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/main/main.component.ts where content is aligned at the top left and fills the remaining space. 3) Develop components/blog/blog.component.ts that accepts 'title' and 'detail' as input properties. Display mock blog data in main.component.ts using this blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 3) Include header.component.ts and main.component.ts in app.component.ts 4) The class of title in blog.component.ts is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px","project":"angular"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing blog-list component that accepts an array of blogs as input property and displays the titles in div elements with the class 'list-item'. 2) In main.component.ts, mock the blog data and display it using blog-list with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position blog-list on the left side of main.component.ts with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One blog.component.ts occupies the remaining space of main.component.ts. The content of blog.component.ts should be from first item of the mock data. 5) Angular Version is V19","project":"angular"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in blog-list selectable. When an item in blog-list is selected, highlight it with appealing style and display its content in the blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item","project":"angular"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a blog-form component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of header.component.ts to toggle the blog-form's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of blog-form to hide it. 4) Place the blog-form component in app.component.ts.","project":"angular"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of blog-form showing '0' initially. 2) Increment .visible-count by 1 each time blog-form becomes visible.","project":"angular"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in blog-form to input title and detail; blog-form can be submitted by button (.submit-btn); Use Angular Forms module. 2) The labels in the Form all add the 'for' attribute, and the attribute values are 'title ' and 'detail' respectively. 3) When submitted, append this Blog to blog-list, and set this Blog as selected. Keep Previous MockData.","project":"angular"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create services/blog.service.ts to manage related state (blog list and selected blog) in app.component.ts 2) When submit a new blog-form, check title duplication. Constraint: The duplication check code should be written in blog-form; 3) Add a span(.blog-list-len) near 'Hello Blog' in header.component.ts to show the length of blogs","project":"angular"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of blog.component.ts. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is appended to a service blog.service.ts.","project":"angular"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of blog.component.ts. When clicked, toggle blog-form to edit the content of selected Blog. The Title of blog-form is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is appended to a service blog.service.ts; 3) Constraint: blog-form should be singleton, ONLY ONE instance of blog-form exists.","project":"angular"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a search.component.ts (width: 200px, border-box) component above blog-list.component.ts in app.component.ts. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs.","project":"angular"} +{"id":"task-11","date":"2025-05-12","level":"chanllenging","description":"1) Add a button with the text 'Random Blogs' in header to append 100,000 blogs to blog-list at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not be stuck when 100000 blogs are appended. 3) Constraint: DO NOT USE any third-party packages, ONLY Angular APIs can be used to optimize performance.","project":"angular"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing comments.component.ts with the title 'Comments' at the bottom of blog.component.ts. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the class '.comment-item', placed above the TextArea. 4) Create services/comment.service.ts to implement state management without NgRx or other state management libraries, and connect CommentService to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize Angular APIs.","project":"angular"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create directives/tooltip.directive.ts that displays a tooltip (.tooltip) at the bottom of the host element when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body using Angular's dynamic component creation. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are allowed.","project":"angular"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in blog.component.ts. 2) Develop a pipe or service to reuse Markdown-related logic. 3) Prevent XSS attacks using Angular's DomSanitizer. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted.","project":"angular"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create services/toast.service.ts to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted.","project":"angular"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show Tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follows the rules, create reusable directives. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted.","project":"angular"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in header with text 'Fast Comment'. 2) When clicked, focus Textarea in comments.component.ts and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted. DO NOT use BOM API. Use ViewChild/ContentChild instead of DOM query.","project":"angular"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/game/game.component.ts with text 'Hello Game'. 2) Move Previous Logic of app.component.ts to pages/blogPage/blogPage.component.ts 2) Add Route Logic: When browser location is '/', routed to BlogPage. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in BlogPage's header.component.ts to navigate to Game page, and user can go back to BlogPage when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted.","project":"angular"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the class for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to show current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse toast.service.ts to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted.","project":"angular"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY Angular APIs are permitted.","project":"angular"} \ No newline at end of file diff --git a/datasets/bom.jsonl b/datasets/bom.jsonl index a2236b449d99f0af020d9a3d013b252edfc1bd38..9d02eaf1346d226d5992121f09c62e26869a5185 100644 --- a/datasets/bom.jsonl +++ b/datasets/bom.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add topbar element (class 'topbar') and page iframe (class 'content', name 'content') in the browser element. topbar and content together fill the entire space of the browser element. No other elements in browser element."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Add toolbar element (class 'toolbar'), address select element (select class is 'address') and setting element (class 'setting') horizontally in the topbar element. toolbar is fixed at the topbar's left side. setting is fixed at the topbar's right side. address occupies the topbar's remaining space. Save codes to 'index.html' and 'index.css'."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Add pages 'docs/intro.html', 'docs/javascript.html', 'docs/css.html', 'docs/html.html', 'docs/nodejs.html' with random content about its filename. 'docs/intro.html' contains the links to other 4 pages. Add 5 options ('value' attribute format `docs/{name}.html`) for the above 5 pages to address select whose the first option value is 'docs/intro.html'. Change address option to display page in the content iframe. content iframe display the page from address select's first option value (default selected option)."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add buttons homepage (class 'homepage'), back (class 'back'), forward (class 'forward'), refresh (class 'refresh') horizontally in the toolbar element. Click button homepage to show 'docs/intro.html' in the content. Click buttons back/forward/refresh to perform the corresponding operation on the content iframe."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"Button back is disabled when no page in content iframe to backward. Button forward is disabled when no page in content iframe to forward. Prefer using navigation API."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Keep address option to be the same with the page in content iframe."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add '.reading-time' element in setting panel. Display doc page reading time (in seconds rounded to one decimal) in '.reading-time'. Reset reading time when doc page changed. Pause recoding reading time when page is hidden."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Warn and save doc page url before window is closed. Ask user with confirm dialog whether jumping to the last saved doc page."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add '.theme' select element in setting panel. '.theme' options value attribute are 'dark' (default, index 0) and 'light'. Change '.theme' to toggle the theme (body class 'dark' and 'light') of 'index.html' and all doc pages ('doc/xxx.html')."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Right click button back to show a menu layer (class 'menu back-menu') which contains all backward history urls (class 'menu-item') which is clicked to jump to the page. The oldest url is the first menu item."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Right click button forward to show a menu layer (class 'menu forward-menu') which contains all forward history urls (class 'menu-item') which is clicked to jump to the page. The newest url is the first menu item."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Click doc page to hide menu. Save codes to es-module 'doc/doc.js' which should be imported by all doc pages ('docs/xxx.html')."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Add button 'Open in new window' (class '.open') in doc pages when loaded in content frame. Button '.open' is clicked to open current doc page in a new window. Button '.open' is hidden in the new window. Save codes to 'doc/doc.js'."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add button 'Close' (class '.close') in doc page when it is opened by button '.open'. Button '.close' is clicked to close current doc page. Save codes to 'doc/doc.js'."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"When doc page is opened in a new window, keep the same theme with 'index.html'."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"When change theme in 'index.html', change the theme of doc pages opened in new windows too. Use postMessage API."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Add a circle element (class 'network') in the setting panel. Monitor network state, change '.network' to green (class '.online') when network is online, change '.network' to red (class '.offline') when network is offline."} -{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Add a circle element (class 'geolocation') in the setting panel. When reaching the target `{latitude:30, longitude:120}`, change '.geolocation' to green (class '.reached'). Clear monitoring geolocation change after reaching the target."} -{"id":"task-19","date":"2025-05-12","level":"moderate","description":"Add button '.fullscreen' in setting panel. Click '.fullscreen' to set fullscreen for content frame, and add button '.exit-fullscreen' (clicked to exit fullscreen and hide itself) in doc page."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add keyword input (class 'keyword') in doc pages. Input keyword immediately highlight text matched by keyword. Use Range API."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add topbar element (class 'topbar') and page iframe (class 'content', name 'content') in the browser element. topbar and content together fill the entire space of the browser element. No other elements in browser element.","project":"bom"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Add toolbar element (class 'toolbar'), address select element (select class is 'address') and setting element (class 'setting') horizontally in the topbar element. toolbar is fixed at the topbar's left side. setting is fixed at the topbar's right side. address occupies the topbar's remaining space. Save codes to 'index.html' and 'index.css'.","project":"bom"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Add pages 'docs/intro.html', 'docs/javascript.html', 'docs/css.html', 'docs/html.html', 'docs/nodejs.html' with random content about its filename. 'docs/intro.html' contains the links to other 4 pages. Add 5 options ('value' attribute format `docs/{name}.html`) for the above 5 pages to address select whose the first option value is 'docs/intro.html'. Change address option to display page in the content iframe. content iframe display the page from address select's first option value (default selected option).","project":"bom"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add buttons homepage (class 'homepage'), back (class 'back'), forward (class 'forward'), refresh (class 'refresh') horizontally in the toolbar element. Click button homepage to show 'docs/intro.html' in the content. Click buttons back/forward/refresh to perform the corresponding operation on the content iframe.","project":"bom"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"Button back is disabled when no page in content iframe to backward. Button forward is disabled when no page in content iframe to forward. Prefer using navigation API.","project":"bom"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Keep address option to be the same with the page in content iframe.","project":"bom"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add '.reading-time' element in setting panel. Display doc page reading time (in seconds rounded to one decimal) in '.reading-time'. Reset reading time when doc page changed. Pause recoding reading time when page is hidden.","project":"bom"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Warn and save doc page url before window is closed. Ask user with confirm dialog whether jumping to the last saved doc page.","project":"bom"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add '.theme' select element in setting panel. '.theme' options value attribute are 'dark' (default, index 0) and 'light'. Change '.theme' to toggle the theme (body class 'dark' and 'light') of 'index.html' and all doc pages ('doc/xxx.html').","project":"bom"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Right click button back to show a menu layer (class 'menu back-menu') which contains all backward history urls (class 'menu-item') which is clicked to jump to the page. The oldest url is the first menu item.","project":"bom"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Right click button forward to show a menu layer (class 'menu forward-menu') which contains all forward history urls (class 'menu-item') which is clicked to jump to the page. The newest url is the first menu item.","project":"bom"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Click doc page to hide menu. Save codes to es-module 'doc/doc.js' which should be imported by all doc pages ('docs/xxx.html').","project":"bom"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Add button 'Open in new window' (class '.open') in doc pages when loaded in content frame. Button '.open' is clicked to open current doc page in a new window. Button '.open' is hidden in the new window. Save codes to 'doc/doc.js'.","project":"bom"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add button 'Close' (class '.close') in doc page when it is opened by button '.open'. Button '.close' is clicked to close current doc page. Save codes to 'doc/doc.js'.","project":"bom"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"When doc page is opened in a new window, keep the same theme with 'index.html'.","project":"bom"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"When change theme in 'index.html', change the theme of doc pages opened in new windows too. Use postMessage API.","project":"bom"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Add a circle element (class 'network') in the setting panel. Monitor network state, change '.network' to green (class '.online') when network is online, change '.network' to red (class '.offline') when network is offline.","project":"bom"} +{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Add a circle element (class 'geolocation') in the setting panel. When reaching the target `{latitude:30, longitude:120}`, change '.geolocation' to green (class '.reached'). Clear monitoring geolocation change after reaching the target.","project":"bom"} +{"id":"task-19","date":"2025-05-12","level":"moderate","description":"Add button '.fullscreen' in setting panel. Click '.fullscreen' to set fullscreen for content frame, and add button '.exit-fullscreen' (clicked to exit fullscreen and hide itself) in doc page.","project":"bom"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add keyword input (class 'keyword') in doc pages. Input keyword immediately highlight text matched by keyword. Use Range API.","project":"bom"} \ No newline at end of file diff --git a/datasets/calculator-files.jsonl b/datasets/calculator-files.jsonl index 7d8ce8bd172289fb06126ffd4d6768996aa1643d..dade45e48f79b014f79af822434a8740d51532d5 100644 --- a/datasets/calculator-files.jsonl +++ b/datasets/calculator-files.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"add button sqrt with text '√' at the right of button clear; click it to calculate result using display content directly"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"add button square with text '^2' at the right of button sqrt"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"add button reciprocal with text '1/x' at the right of button square"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"add button sin with text 'sin' at the end of all the buttons"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"add button π with text 'π' at the right of button sin; click button π to cover display content"} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"revert position of button sin, button π, no change for other buttons"} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"change button 'clear' width to 3 columns"} -{"id":"task-8","date":"2025-05-12","level":"easy","description":"add toggle button with id 'toggle' to change theme between dark and light mode; toggle button's text is 'dark' at light mode and 'light' at dark mode"} -{"id":"task-9","date":"2025-05-12","level":"easy","description":"move toggle button to bottom-center of the page"} -{"id":"task-10","date":"2025-05-12","level":"easy","description":"change default theme to dark"} -{"id":"task-11","date":"2025-05-12","level":"easy","description":"add button with id 'mode' near the toggle button to change mode between scientific(default) and basic; its text is 'basic' at scientific mode and 'scientific' at basic mode; basic mode just display the first 5 rows in buttons panel"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"make the last button of the first 5 rows in buttons panel, background color brighter; consider dark and light mode"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"fix display input width to be equal to the buttons content width; change display input css properties as less as possible"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"add buttons cos, tan, sinh, cosh at the end of buttons panel"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"add button MemoryPlus(text 'M+') at the end to plus display content and store the data; add button MemoryRecall(text 'MR') before button M+ to append stored data to display content"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"display stored data in a panel(id 'memory') next to the buttons panel in the calculator at scientific mode"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"show latest 5 clicked button text in a history panel(id 'clicks') next to memory panel at scientific mode"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add button MemoryMinus(text 'M-') next to button M+ to minus display content and store the data"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"add button MemoryClear(text 'MC') next to button M- to reset stored data to 0"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"click item(class 'history-item') in history panel to perform the same action like calculator button"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"add button sqrt with text '√' at the right of button clear; click it to calculate result using display content directly","project":"calculator-files"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"add button square with text '^2' at the right of button sqrt","project":"calculator-files"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"add button reciprocal with text '1/x' at the right of button square","project":"calculator-files"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"add button sin with text 'sin' at the end of all the buttons","project":"calculator-files"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"add button π with text 'π' at the right of button sin; click button π to cover display content","project":"calculator-files"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"revert position of button sin, button π, no change for other buttons","project":"calculator-files"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"change button 'clear' width to 3 columns","project":"calculator-files"} +{"id":"task-8","date":"2025-05-12","level":"easy","description":"add toggle button with id 'toggle' to change theme between dark and light mode; toggle button's text is 'dark' at light mode and 'light' at dark mode","project":"calculator-files"} +{"id":"task-9","date":"2025-05-12","level":"easy","description":"move toggle button to bottom-center of the page","project":"calculator-files"} +{"id":"task-10","date":"2025-05-12","level":"easy","description":"change default theme to dark","project":"calculator-files"} +{"id":"task-11","date":"2025-05-12","level":"easy","description":"add button with id 'mode' near the toggle button to change mode between scientific(default) and basic; its text is 'basic' at scientific mode and 'scientific' at basic mode; basic mode just display the first 5 rows in buttons panel","project":"calculator-files"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"make the last button of the first 5 rows in buttons panel, background color brighter; consider dark and light mode","project":"calculator-files"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"fix display input width to be equal to the buttons content width; change display input css properties as less as possible","project":"calculator-files"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"add buttons cos, tan, sinh, cosh at the end of buttons panel","project":"calculator-files"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"add button MemoryPlus(text 'M+') at the end to plus display content and store the data; add button MemoryRecall(text 'MR') before button M+ to append stored data to display content","project":"calculator-files"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"display stored data in a panel(id 'memory') next to the buttons panel in the calculator at scientific mode","project":"calculator-files"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"show latest 5 clicked button text in a history panel(id 'clicks') next to memory panel at scientific mode","project":"calculator-files"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add button MemoryMinus(text 'M-') next to button M+ to minus display content and store the data","project":"calculator-files"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"add button MemoryClear(text 'MC') next to button M- to reset stored data to 0","project":"calculator-files"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"click item(class 'history-item') in history panel to perform the same action like calculator button","project":"calculator-files"} \ No newline at end of file diff --git a/datasets/calculator.jsonl b/datasets/calculator.jsonl index 7d8ce8bd172289fb06126ffd4d6768996aa1643d..b0cc825d0a666e3c766903004f2b45e88e08ab27 100644 --- a/datasets/calculator.jsonl +++ b/datasets/calculator.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"add button sqrt with text '√' at the right of button clear; click it to calculate result using display content directly"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"add button square with text '^2' at the right of button sqrt"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"add button reciprocal with text '1/x' at the right of button square"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"add button sin with text 'sin' at the end of all the buttons"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"add button π with text 'π' at the right of button sin; click button π to cover display content"} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"revert position of button sin, button π, no change for other buttons"} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"change button 'clear' width to 3 columns"} -{"id":"task-8","date":"2025-05-12","level":"easy","description":"add toggle button with id 'toggle' to change theme between dark and light mode; toggle button's text is 'dark' at light mode and 'light' at dark mode"} -{"id":"task-9","date":"2025-05-12","level":"easy","description":"move toggle button to bottom-center of the page"} -{"id":"task-10","date":"2025-05-12","level":"easy","description":"change default theme to dark"} -{"id":"task-11","date":"2025-05-12","level":"easy","description":"add button with id 'mode' near the toggle button to change mode between scientific(default) and basic; its text is 'basic' at scientific mode and 'scientific' at basic mode; basic mode just display the first 5 rows in buttons panel"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"make the last button of the first 5 rows in buttons panel, background color brighter; consider dark and light mode"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"fix display input width to be equal to the buttons content width; change display input css properties as less as possible"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"add buttons cos, tan, sinh, cosh at the end of buttons panel"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"add button MemoryPlus(text 'M+') at the end to plus display content and store the data; add button MemoryRecall(text 'MR') before button M+ to append stored data to display content"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"display stored data in a panel(id 'memory') next to the buttons panel in the calculator at scientific mode"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"show latest 5 clicked button text in a history panel(id 'clicks') next to memory panel at scientific mode"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add button MemoryMinus(text 'M-') next to button M+ to minus display content and store the data"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"add button MemoryClear(text 'MC') next to button M- to reset stored data to 0"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"click item(class 'history-item') in history panel to perform the same action like calculator button"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"add button sqrt with text '√' at the right of button clear; click it to calculate result using display content directly","project":"calculator"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"add button square with text '^2' at the right of button sqrt","project":"calculator"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"add button reciprocal with text '1/x' at the right of button square","project":"calculator"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"add button sin with text 'sin' at the end of all the buttons","project":"calculator"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"add button π with text 'π' at the right of button sin; click button π to cover display content","project":"calculator"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"revert position of button sin, button π, no change for other buttons","project":"calculator"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"change button 'clear' width to 3 columns","project":"calculator"} +{"id":"task-8","date":"2025-05-12","level":"easy","description":"add toggle button with id 'toggle' to change theme between dark and light mode; toggle button's text is 'dark' at light mode and 'light' at dark mode","project":"calculator"} +{"id":"task-9","date":"2025-05-12","level":"easy","description":"move toggle button to bottom-center of the page","project":"calculator"} +{"id":"task-10","date":"2025-05-12","level":"easy","description":"change default theme to dark","project":"calculator"} +{"id":"task-11","date":"2025-05-12","level":"easy","description":"add button with id 'mode' near the toggle button to change mode between scientific(default) and basic; its text is 'basic' at scientific mode and 'scientific' at basic mode; basic mode just display the first 5 rows in buttons panel","project":"calculator"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"make the last button of the first 5 rows in buttons panel, background color brighter; consider dark and light mode","project":"calculator"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"fix display input width to be equal to the buttons content width; change display input css properties as less as possible","project":"calculator"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"add buttons cos, tan, sinh, cosh at the end of buttons panel","project":"calculator"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"add button MemoryPlus(text 'M+') at the end to plus display content and store the data; add button MemoryRecall(text 'MR') before button M+ to append stored data to display content","project":"calculator"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"display stored data in a panel(id 'memory') next to the buttons panel in the calculator at scientific mode","project":"calculator"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"show latest 5 clicked button text in a history panel(id 'clicks') next to memory panel at scientific mode","project":"calculator"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add button MemoryMinus(text 'M-') next to button M+ to minus display content and store the data","project":"calculator"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"add button MemoryClear(text 'MC') next to button M- to reset stored data to 0","project":"calculator"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"click item(class 'history-item') in history panel to perform the same action like calculator button","project":"calculator"} \ No newline at end of file diff --git a/datasets/canvas.jsonl b/datasets/canvas.jsonl index b98113cb09f8bbd487042d6e58b9d0f04925dd4c..27deaa2e9d01fb9caf50099b96312a68619d4223 100644 --- a/datasets/canvas.jsonl +++ b/datasets/canvas.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Style the canvas with 'assets/bg.png' as its background using CSS. Center the canvas horizontally on the page. Note: Please enter the full HTML codeblock with filename in the language specifier."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Canvas dimensions should scale with window size: height matches window height, while width scales proportionally. Apply device pixel ratio (DPR) scaling for crisp rendering across devices. Handle DPR changes during resize events. Display 'Score: ' in 14px white text (textAlign='left') at (10,10) with a rectangular border. Store score value in 'window.store'. Note: Use only canvas rendering; Please enter the full HTML codeblock with filename in the language specifier."} -{"id":"task-3","date":"2025-05-12","level":"moderate","description":"Add bird and floor images from assets ('assets/bird.png', 'assets/fg.png'). Bird at (30, height/2), floor tiles at bottom (0, height-80). Floor moves left 4px per frame, store its position in 'store.floorX'. Consider the consistency of values at different refresh rates, get frameAdjustedRate from query, and stores it in store.frameAdjustedRate, and use it as '4px * frameAdjustedRate'. Store animation state in 'store.isAnimating'. Display 'Click to Start' text in canvas center. Animation begins and text hides when the player clicks or presses Enter. Note: not to trigger animation multiple times; floor width and bird updates on window resizes for responsive; Ensure images are loaded with promise.all; Clear canvas before each render; don't forget DPR."} -{"id":"task-4","date":"2025-05-12","level":"moderate","description":"Render pipe pairs using 'assets/pipeUp.png' and 'assets/pipeDown.png' at shared x-coordinates. Maintain 120-240px vertical gap between pipes, with gap's top edge >80px from canvas top and < (height/2 - 80). Space pipe groups 200px apart horizontally. Continuously generate pipes from right, translating -4px per frame. Store in window.store: bird coordinates, pipe data (x, topHeight, bottomY, width, passed), and floor height. Pipes should be rendered behind other elements and the floor is at the top layer."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"Apply downward acceleration of 0.45, capped at maximum falling speed of 6. On mouseclick or Enter key, set vertical velocity to -6 for upward motion. Rotate bird sprite: -35° during ascent, +35° during descent, interpolating between states."} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"When bird collides with ground and the 'store.mode' isn't 'debug', set 'store.isGameOver' to true and end the game. Pause all animations and instantly fade in three centered messages: 'GAME OVER', 'Score: [score]', and 'Click to Play Again'. Input is forbidden for 0.5 seconds after the game ends. Then Click or Enter key instantly restart the game without showing the start screen. Note: Use only canvas rendering, not DOM elements; Window resizing remains active during game over; In debug mode, bird-ground collision is ignored and bird stays at ground level while game continues."} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"Each time the bird passes through a set of pipes, the score increases by 1. The game ends when it collides with a pipe."} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Refactor code, split into multiple files, use ES modules: index.html; style.css; main.js for init and game loop; constants.js for constants; render.js for drawing; store.js for store, keep state in 'window.store'; util.js; event.js for events; Add comments to explain code. Note: Avoid losing context between files; do not confuse assets resources with objects in the store, record assets in 'store.assets'; keep store in window; store dpr in the store; init store before anything; after updateStore, obtain the new store object to avoid using old data; Do not omit the code. Do not write game logic in the store; Remember to consider the method parameters when binding and unbinding events"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Randomly spawn items in the middle of pipe gaps with item size 20*20. Spawn rate controlled by 'store.randomRate' (default 0.25, variable). Items move with pipes and store in pipe object with properties (x, y, type, collected). Item 'Shield': appears as filled green diamond, grants protective shield effect. When collected, displays spiked gear ring around bird (lineWidth 5, radius 1.5 * birdWidth) and sets 'isProtected' and 'shieldEndTime' in store. Shield provides 5 seconds invincibility, ring flashes during final second. Shield giving the bird invincibility without losing lives. Collecting another Shield while active resets duration to 5 seconds."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Add item 'Heart': shaped like a red heart ❤, represents an increase of one life. Events that previously caused game over will now reduce one life instead, and the game will only end when lives reach 0, with a maximum of 10 lives ('store.maxLives'), default is 1. Render ❤ x [lives] in the upper right corner of the canvas, stored in 'store.lives'. When we loose a life get a protective shield for 1 seconds."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Implement weather system that randomly switches every 5 seconds between 'Normal', 'Rain', 'Wind', and 'Night' states (Weather should randomly select next type excluding current weather.), stored in 'store.weather', use 'weather.current' record the current weather type. When 'weather.current' changes, the weather system changes immediately. Rain effect: render clearly visible vertical lines with bright color using lineWidth 2 and round caps, 30px base length with slight rightward tilt (15 degrees), falling at 20px base speed, with darkened background. Wind effect: display distinct horizontal streaks moving left to right with varying lengths. Night effect: overlay semi-transparent dark gradient on background with high contrast. Weather effects should be highly visible and immediately recognizable, using 300 particles, but not interfere with game collision detection. Consider performance optimization strategies when implementing weather particle system."} -{"id":"task-12","date":"2025-05-12","level":"moderate","description":"When the weather is Night, a new item type 'Coin' is provided: it is shaped like a yellow concentric circle. After obtaining it, the score increases by 10. When the weather changes back to others, the existing Coins will also disappear immediately."} -{"id":"task-13","date":"2025-05-12","level":"easy","description":"When the weather is 'Rain', the bird's jumping speed slows down to 0.8 times, and the falling speed becomes 1.2 times the original. When the weather is 'Wind', the overall forward movement speed becomes 1.5 times."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Every 5 seconds, there is a probability of generating an elliptical gravity field on the ground, with the height of the ellipse center at ground level, moves with floor. The width of the gravity field is three times the pipe spacing, height is 40, with a probability of 'store.fieldRandomRate' (default value 0.25, variable). The data of the field stores in 'store.field', and there will only be one field on the canvas at the same time, when the x of the bird is within the range of the field, it takes effect. The field type 'Zero': has a color that transitions from blue on the outside to black in the middle, The entire field glows with obvious special effects, the effect is that the bird's velocity will not > 0 within this distance."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Periodically spawns enemies at random vertical positions on screen's right edge, generate one per second, stores in 'store.enemies', with maximum 10 simultaneous enemies. Enemies move to left at constant horizontal speed 6 while having random initial vertical velocity (range -0.5,0.5 ). On collision with bird, reduces player life. Enemy sprites use mirrored and color-inverted version of 'assets/bird.png', pre-rendered using offline canvas for performance. Note: Do not forget to implement the new method."} -{"id":"task-16","date":"2025-05-12","level":"easy","description":"Additional control options: 'arrowDown' and 's' triggers rapid descent speed 6, 'arrowRight' and 'd' activates speed-up mode affecting all game elements, while 'w'、 'j' 、 'space' and 'arrowUp' serve as alternative jump controls."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"When pressing 'k', the bird can shoot bullets with size 10*10, and the bullets can destroy the enemy. The firing interval of bullets should be at least 0.2s. The data of the bullets stores in 'store.bullets'. Note: Do not forget to implement the new method."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"A boss spawns 10 seconds after the game starts. This boss looks like a normal enemy but is sized 60*60. It spawns at center of the right edge of the screen and only moves randomly up and down on the right side, staying within the screen bounds, without moving left. This boss has 10 lives. The boss will also fire bullets, which need to be distinguished from the player's bullets. The firing interval of the boss's bullets should be the same as that of the player's. A new boss will spawn 10 seconds after the current boss is defeated. Data is stored in 'store.boss', and the boss's bullets are stored in 'store.bossBullets'. Note: Do not forget to implement the new method."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"When the weather is night, a new item type 'Bomb' is provided: it appears as a nuclear symbol. After obtaining it, you have bombs that can be used, maximum is 3. player default has 3 bombs. The current quantity owned is displayed below the health points in the upper right corner. When we pressing 'b' we use one Bomb, it eliminates all enemies, deals one damage to the boss, and clears the boss's bullets. Bomb explosion has a 0.5s animation for the entire canvas, causing the canvas to shake, with the overall canvas superimposing a repeated nuclear symbol pattern. Note: Do not forget to implement the new method."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Whenever the boss is defeated, the game will enter a special space that lasts for 5 seconds and will reappear after 5 seconds. Inside the special space, it is randomly filled with Coins. After entering the special space, enemies and pipes are removed, leaving only the bird and Coins. The bird's position is in the middle at the bottom of the canvas, and the content of the canvas moves from top to bottom.gains a 3s shield after coming out of space.Data is stored in store.coinPhase. Note: Do not forget to implement the new method."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Style the canvas with 'assets/bg.png' as its background using CSS. Center the canvas horizontally on the page. Note: Please enter the full HTML codeblock with filename in the language specifier.","project":"canvas"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Canvas dimensions should scale with window size: height matches window height, while width scales proportionally. Apply device pixel ratio (DPR) scaling for crisp rendering across devices. Handle DPR changes during resize events. Display 'Score: ' in 14px white text (textAlign='left') at (10,10) with a rectangular border. Store score value in 'window.store'. Note: Use only canvas rendering; Please enter the full HTML codeblock with filename in the language specifier.","project":"canvas"} +{"id":"task-3","date":"2025-05-12","level":"moderate","description":"Add bird and floor images from assets ('assets/bird.png', 'assets/fg.png'). Bird at (30, height/2), floor tiles at bottom (0, height-80). Floor moves left 4px per frame, store its position in 'store.floorX'. Consider the consistency of values at different refresh rates, get frameAdjustedRate from query, and stores it in store.frameAdjustedRate, and use it as '4px * frameAdjustedRate'. Store animation state in 'store.isAnimating'. Display 'Click to Start' text in canvas center. Animation begins and text hides when the player clicks or presses Enter. Note: not to trigger animation multiple times; floor width and bird updates on window resizes for responsive; Ensure images are loaded with promise.all; Clear canvas before each render; don't forget DPR.","project":"canvas"} +{"id":"task-4","date":"2025-05-12","level":"moderate","description":"Render pipe pairs using 'assets/pipeUp.png' and 'assets/pipeDown.png' at shared x-coordinates. Maintain 120-240px vertical gap between pipes, with gap's top edge >80px from canvas top and < (height/2 - 80). Space pipe groups 200px apart horizontally. Continuously generate pipes from right, translating -4px per frame. Store in window.store: bird coordinates, pipe data (x, topHeight, bottomY, width, passed), and floor height. Pipes should be rendered behind other elements and the floor is at the top layer.","project":"canvas"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"Apply downward acceleration of 0.45, capped at maximum falling speed of 6. On mouseclick or Enter key, set vertical velocity to -6 for upward motion. Rotate bird sprite: -35° during ascent, +35° during descent, interpolating between states.","project":"canvas"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"When bird collides with ground and the 'store.mode' isn't 'debug', set 'store.isGameOver' to true and end the game. Pause all animations and instantly fade in three centered messages: 'GAME OVER', 'Score: [score]', and 'Click to Play Again'. Input is forbidden for 0.5 seconds after the game ends. Then Click or Enter key instantly restart the game without showing the start screen. Note: Use only canvas rendering, not DOM elements; Window resizing remains active during game over; In debug mode, bird-ground collision is ignored and bird stays at ground level while game continues.","project":"canvas"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"Each time the bird passes through a set of pipes, the score increases by 1. The game ends when it collides with a pipe.","project":"canvas"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Refactor code, split into multiple files, use ES modules: index.html; style.css; main.js for init and game loop; constants.js for constants; render.js for drawing; store.js for store, keep state in 'window.store'; util.js; event.js for events; Add comments to explain code. Note: Avoid losing context between files; do not confuse assets resources with objects in the store, record assets in 'store.assets'; keep store in window; store dpr in the store; init store before anything; after updateStore, obtain the new store object to avoid using old data; Do not omit the code. Do not write game logic in the store; Remember to consider the method parameters when binding and unbinding events","project":"canvas"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Randomly spawn items in the middle of pipe gaps with item size 20*20. Spawn rate controlled by 'store.randomRate' (default 0.25, variable). Items move with pipes and store in pipe object with properties (x, y, type, collected). Item 'Shield': appears as filled green diamond, grants protective shield effect. When collected, displays spiked gear ring around bird (lineWidth 5, radius 1.5 * birdWidth) and sets 'isProtected' and 'shieldEndTime' in store. Shield provides 5 seconds invincibility, ring flashes during final second. Shield giving the bird invincibility without losing lives. Collecting another Shield while active resets duration to 5 seconds.","project":"canvas"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Add item 'Heart': shaped like a red heart ❤, represents an increase of one life. Events that previously caused game over will now reduce one life instead, and the game will only end when lives reach 0, with a maximum of 10 lives ('store.maxLives'), default is 1. Render ❤ x [lives] in the upper right corner of the canvas, stored in 'store.lives'. When we loose a life get a protective shield for 1 seconds.","project":"canvas"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Implement weather system that randomly switches every 5 seconds between 'Normal', 'Rain', 'Wind', and 'Night' states (Weather should randomly select next type excluding current weather.), stored in 'store.weather', use 'weather.current' record the current weather type. When 'weather.current' changes, the weather system changes immediately. Rain effect: render clearly visible vertical lines with bright color using lineWidth 2 and round caps, 30px base length with slight rightward tilt (15 degrees), falling at 20px base speed, with darkened background. Wind effect: display distinct horizontal streaks moving left to right with varying lengths. Night effect: overlay semi-transparent dark gradient on background with high contrast. Weather effects should be highly visible and immediately recognizable, using 300 particles, but not interfere with game collision detection. Consider performance optimization strategies when implementing weather particle system.","project":"canvas"} +{"id":"task-12","date":"2025-05-12","level":"moderate","description":"When the weather is Night, a new item type 'Coin' is provided: it is shaped like a yellow concentric circle. After obtaining it, the score increases by 10. When the weather changes back to others, the existing Coins will also disappear immediately.","project":"canvas"} +{"id":"task-13","date":"2025-05-12","level":"easy","description":"When the weather is 'Rain', the bird's jumping speed slows down to 0.8 times, and the falling speed becomes 1.2 times the original. When the weather is 'Wind', the overall forward movement speed becomes 1.5 times.","project":"canvas"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Every 5 seconds, there is a probability of generating an elliptical gravity field on the ground, with the height of the ellipse center at ground level, moves with floor. The width of the gravity field is three times the pipe spacing, height is 40, with a probability of 'store.fieldRandomRate' (default value 0.25, variable). The data of the field stores in 'store.field', and there will only be one field on the canvas at the same time, when the x of the bird is within the range of the field, it takes effect. The field type 'Zero': has a color that transitions from blue on the outside to black in the middle, The entire field glows with obvious special effects, the effect is that the bird's velocity will not > 0 within this distance.","project":"canvas"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Periodically spawns enemies at random vertical positions on screen's right edge, generate one per second, stores in 'store.enemies', with maximum 10 simultaneous enemies. Enemies move to left at constant horizontal speed 6 while having random initial vertical velocity (range -0.5,0.5 ). On collision with bird, reduces player life. Enemy sprites use mirrored and color-inverted version of 'assets/bird.png', pre-rendered using offline canvas for performance. Note: Do not forget to implement the new method.","project":"canvas"} +{"id":"task-16","date":"2025-05-12","level":"easy","description":"Additional control options: 'arrowDown' and 's' triggers rapid descent speed 6, 'arrowRight' and 'd' activates speed-up mode affecting all game elements, while 'w'、 'j' 、 'space' and 'arrowUp' serve as alternative jump controls.","project":"canvas"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"When pressing 'k', the bird can shoot bullets with size 10*10, and the bullets can destroy the enemy. The firing interval of bullets should be at least 0.2s. The data of the bullets stores in 'store.bullets'. Note: Do not forget to implement the new method.","project":"canvas"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"A boss spawns 10 seconds after the game starts. This boss looks like a normal enemy but is sized 60*60. It spawns at center of the right edge of the screen and only moves randomly up and down on the right side, staying within the screen bounds, without moving left. This boss has 10 lives. The boss will also fire bullets, which need to be distinguished from the player's bullets. The firing interval of the boss's bullets should be the same as that of the player's. A new boss will spawn 10 seconds after the current boss is defeated. Data is stored in 'store.boss', and the boss's bullets are stored in 'store.bossBullets'. Note: Do not forget to implement the new method.","project":"canvas"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"When the weather is night, a new item type 'Bomb' is provided: it appears as a nuclear symbol. After obtaining it, you have bombs that can be used, maximum is 3. player default has 3 bombs. The current quantity owned is displayed below the health points in the upper right corner. When we pressing 'b' we use one Bomb, it eliminates all enemies, deals one damage to the boss, and clears the boss's bullets. Bomb explosion has a 0.5s animation for the entire canvas, causing the canvas to shake, with the overall canvas superimposing a repeated nuclear symbol pattern. Note: Do not forget to implement the new method.","project":"canvas"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Whenever the boss is defeated, the game will enter a special space that lasts for 5 seconds and will reappear after 5 seconds. Inside the special space, it is randomly filled with Coins. After entering the special space, enemies and pipes are removed, leaving only the bird and Coins. The bird's position is in the middle at the bottom of the canvas, and the content of the canvas moves from top to bottom.gains a 3s shield after coming out of space.Data is stored in store.coinPhase. Note: Do not forget to implement the new method.","project":"canvas"} \ No newline at end of file diff --git a/datasets/chart.jsonl b/datasets/chart.jsonl index 0c5264e2a2fd7dbc1db2f6595c3878aed9888010..d95f3eb8ea1cd7b917a093a1f5a7386474f8bfc2 100644 --- a/datasets/chart.jsonl +++ b/datasets/chart.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"- Check or uncheck `#axes` to create `LineChart` instance `chart` with config whose attributes values:\n - type: the value of `#type`, default is `line`\n - id: `{type}Chart`\n - data: imported from `./assets/data.js`\n - options: \n - axes: the `checked` value of `#axes`\n- Call `chart.draw()`\n- Clear `#chart`, append `chart.svg` to `#chart`\n- Save codes as a function `createChart()` in `index.js`\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Check or uncheck `#grids` to create `LineChart` instance:\n- reuse function `createChart()`\n- add new `options` attribute:\n - grids: the `checked` value of `#grids`\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Select one or more `#datasets` options to create `LineChart` instance:\n- reuse function `createChart()`\n- filter `config.data.datasets` whose item (dataset) `label` value is selected\n"} -{"id":"task-4","date":"2025-05-12","level":"moderate","description":"- Check or uncheck `#legends` to create `LineChart` instance:\n - reuse function `createChart()`\n - add new `options` attribute:\n - legends: the `checked` value of `#legends`\n- In `./common/Chart.js`, when `options.legends` is true or not defined:\n - append g element (class `legends`) on the top of `svg`\n - append g element (class `legend legend-{index}`) in `.legends`\n - append circle (color is the same as `.dataset` line color) and text (content `dataset.label`) in each `.legend`\n- In `./common/Chart.js` and `./common/LineChart.js`, when `options.legends` is true or not defined:\n - reduce `.datasets` lines height\n - reduce `.axes-y` axis-y height, update axis-y labels position\n - and make `.legends`, `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space\n"} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"- Check or uncheck `#dataLabels` to create `LineChart` instance:\n - reuse function `createChart()`\n - add new `options` attribute:\n - dataLabels: the `checked` value of `#dataLabels`\n- In `./common/LineChart.js`, when `options.pointStyle` is `circle` or `rect`:\n - append g element (class `points points-{index}`) inside `svg` for each `dataset`\n - append points (each class `point point-{index}`, shape is `options.pointStyle`) inside `.points` for each item of `dataset.data`\n - each point covers the `.dataset` line, distributes from left to right\n - each point color is the same as `.dataset` line color\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"- Select `#pointStyle` to create `LineChart` instance:\n - reuse function `createChart()`\n - add new `options` attribute:\n - pointStyle: the value of `#pointStyle`\n- In `./common/LineChart.js`, when `options.pointStyle` is `circle` or `rect`:\n - append g element (class `points points-{index}`) inside `svg` for each `dataset`\n - append points (each class `point point-{index}`, shape is `options.pointStyle`) inside `.points` for each item of `dataset.data`\n - each point covers the `.dataset` line, distributes from left to right\n - each point color is the same as `.dataset` line color\n"} -{"id":"task-7","date":"2025-05-12","level":"challenging","description":"In `./common/LineChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over the `.datasets` area in `svg`, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - append rect element (class `bg`) inside `.tooltips`\n - in `.tooltips`, show all data items from the `.dataset` that corresponds to the selected `.grid-x`\n- when mouse not hovers over `.datasets` area in `svg`, hide `.tooltips` (add class `hidden`)\n"} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"- In `./common/SmoothLineChart.js`, class `SmoothLineChart` inherits from `LineChart`, `SmoothLineChart`:\n - replace all polylines with smooth curved lines inside `.datasets`\n- Select the option `SmoothLine Chart` of `#type` to create `SmoothLineChart` instance\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"In `./common/Chart.js`, when click legend:\n- show (remove class `hidden`) or hide (add class `hidden`) `.dataset` lines, dataLabels, points\n"} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"-In `./common/ScatterChart.js`, class `ScatterChart` inherits from `LineChart`, `ScatterChart`:\n - options.pointStyle is default circle\n - options.dataLabels is always true\n - all `.dataset` lines are hidden\n- Select the option `Scatter Chart` of `#type` to create `ScatterChart` instance, and make `#dataLabels` disabled\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"-In `./common/StepChart.js`, class `StepChart` inherits from `LineChart`, `StepChart`:\n - replace all polylines with step style polylines inside `.datasets`\n - in each step style polyline:\n - each `dataset.data` responds to a horizontal line segment whose width is the distance between two near grid-x\n - the first and the last line segment width is the half\n - connect all line segments to a step style polyline\n- Select the option `Step Chart` of `#type` to create `StepChart` instance\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"- In `./common/AreaChart.js`, class `AreaChart` inherits from `LineChart`, `AreaChart`:\n - append g element (class `areas`) inside `svg`\n - append polygons (each class `area area-{index}`) inside `.areas` \n - each `.area` is below the `.dataset` line\n - each `.area` color is the same as `.dataset` line color, half transparent\n- Select the option `Area Chart` of `#type` to create `AreaChart` instance\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"- In `./common/BarChart.js`, class `BarChart` inherits from `Chart`, `BarChart`:\n - there is 1 more grid-x line than LineChart, all the grid-x lines are evenly distributed in `.grids`\n - axis-x labels are placed between 2 adjacent grids below the `.axis-x`\n - append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them)\n - append g element (class `dataset dataset-${index}`) inside `.datasets` for each `datasets` item\n - append bars (rect elements, class `bar bar-{index}`) with the same color inside `.dataset` for each `dataset.data` item\n - bars are distributed within each column enclosed by 2 adjacent grid-x lines \n - bars in different `.dataset` have unique colors\n - bars in the same column are evenly distributed\n- Select the option `Bar Chart` of `#type` to create `BarChart` instance\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"In `./common/BarChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- each dataLabel is above the `.dataset` bars, distributes from left to right\n- each dataLabel color is the same as `.dataset` bars color\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"In `./common/BarChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over the `.datasets` area in `svg`, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - in `.tooltips`, show all data from the `.dataset` that corresponds to the area enclosed by the selected `.grid-x` and next adjacent `.grid-x`\n- when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"- In `./common/PieChart.js`, class `PieChart` inherits from `Chart`, `PieChart`:\n - append g element (class `datasets`) inside `svg` and make it fill the most area of `svg`\n - append g element (class `dataset dataset-0`) inside `.datasets` for the first `datasets` item\n - append sectors (path elements, each class `sector sector-{index}`) with the unique color inside `.dataset` for each `dataset.data` item\n - all the sectors form a large circle\n - the area of each sector is related to its proportion of the data\n- Select the option `Pie Chart` of `#type` to create `PieChart` instance, make `#axes`, `#grids`, `#pointStyle` disabled, and make `#datasets` single selection mode\n"} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"- In `./common/DoughnutChart.js`, class `DoughnutChart` inherits from `PieChart`, `DoughnutChart`:\n - cover the central circle area with `#circleMask` from `assets/res.svg`\n- Select the option `Doughnut Chart` of `#type` to create `DoughnutChart` instance\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"In `./common/PieChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-0`) inside `svg` for the first `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- show the sector data and proportion in each dataLabel\n- append connect lines (each class `connect connect-{index}`) inside `.dataLabels` to connect each dataLabel and its corresponding sector\n- each dataLabel is positioned near its corresponding sector and distributed around the large circle\n"} -{"id":"task-19","date":"2025-05-12","level":"moderate","description":"In `./common/PieChart.js`:\n- when mouse hovers over a sector, it scales up by 1.05 times proportionally around pie center point\n- when mouse leaves a sector, its size returns to normal\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"In `./common/PieChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over a sector in `svg`, display `.tooltips` near the mouse position\n- show the sector data and proportion in `.tooltips`\n- when mouse leaves a sector, hide `.tooltips` (add class `hidden`)\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"- Check or uncheck `#axes` to create `LineChart` instance `chart` with config whose attributes values:\n - type: the value of `#type`, default is `line`\n - id: `{type}Chart`\n - data: imported from `./assets/data.js`\n - options: \n - axes: the `checked` value of `#axes`\n- Call `chart.draw()`\n- Clear `#chart`, append `chart.svg` to `#chart`\n- Save codes as a function `createChart()` in `index.js`\n","project":"chart"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Check or uncheck `#grids` to create `LineChart` instance:\n- reuse function `createChart()`\n- add new `options` attribute:\n - grids: the `checked` value of `#grids`\n","project":"chart"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Select one or more `#datasets` options to create `LineChart` instance:\n- reuse function `createChart()`\n- filter `config.data.datasets` whose item (dataset) `label` value is selected\n","project":"chart"} +{"id":"task-4","date":"2025-05-12","level":"moderate","description":"- Check or uncheck `#legends` to create `LineChart` instance:\n - reuse function `createChart()`\n - add new `options` attribute:\n - legends: the `checked` value of `#legends`\n- In `./common/Chart.js`, when `options.legends` is true or not defined:\n - append g element (class `legends`) on the top of `svg`\n - append g element (class `legend legend-{index}`) in `.legends`\n - append circle (color is the same as `.dataset` line color) and text (content `dataset.label`) in each `.legend`\n- In `./common/Chart.js` and `./common/LineChart.js`, when `options.legends` is true or not defined:\n - reduce `.datasets` lines height\n - reduce `.axes-y` axis-y height, update axis-y labels position\n - and make `.legends`, `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space\n","project":"chart"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"- Check or uncheck `#dataLabels` to create `LineChart` instance:\n - reuse function `createChart()`\n - add new `options` attribute:\n - dataLabels: the `checked` value of `#dataLabels`\n- In `./common/LineChart.js`, when `options.pointStyle` is `circle` or `rect`:\n - append g element (class `points points-{index}`) inside `svg` for each `dataset`\n - append points (each class `point point-{index}`, shape is `options.pointStyle`) inside `.points` for each item of `dataset.data`\n - each point covers the `.dataset` line, distributes from left to right\n - each point color is the same as `.dataset` line color\n","project":"chart"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"- Select `#pointStyle` to create `LineChart` instance:\n - reuse function `createChart()`\n - add new `options` attribute:\n - pointStyle: the value of `#pointStyle`\n- In `./common/LineChart.js`, when `options.pointStyle` is `circle` or `rect`:\n - append g element (class `points points-{index}`) inside `svg` for each `dataset`\n - append points (each class `point point-{index}`, shape is `options.pointStyle`) inside `.points` for each item of `dataset.data`\n - each point covers the `.dataset` line, distributes from left to right\n - each point color is the same as `.dataset` line color\n","project":"chart"} +{"id":"task-7","date":"2025-05-12","level":"challenging","description":"In `./common/LineChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over the `.datasets` area in `svg`, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - append rect element (class `bg`) inside `.tooltips`\n - in `.tooltips`, show all data items from the `.dataset` that corresponds to the selected `.grid-x`\n- when mouse not hovers over `.datasets` area in `svg`, hide `.tooltips` (add class `hidden`)\n","project":"chart"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"- In `./common/SmoothLineChart.js`, class `SmoothLineChart` inherits from `LineChart`, `SmoothLineChart`:\n - replace all polylines with smooth curved lines inside `.datasets`\n- Select the option `SmoothLine Chart` of `#type` to create `SmoothLineChart` instance\n","project":"chart"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"In `./common/Chart.js`, when click legend:\n- show (remove class `hidden`) or hide (add class `hidden`) `.dataset` lines, dataLabels, points\n","project":"chart"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"-In `./common/ScatterChart.js`, class `ScatterChart` inherits from `LineChart`, `ScatterChart`:\n - options.pointStyle is default circle\n - options.dataLabels is always true\n - all `.dataset` lines are hidden\n- Select the option `Scatter Chart` of `#type` to create `ScatterChart` instance, and make `#dataLabels` disabled\n","project":"chart"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"-In `./common/StepChart.js`, class `StepChart` inherits from `LineChart`, `StepChart`:\n - replace all polylines with step style polylines inside `.datasets`\n - in each step style polyline:\n - each `dataset.data` responds to a horizontal line segment whose width is the distance between two near grid-x\n - the first and the last line segment width is the half\n - connect all line segments to a step style polyline\n- Select the option `Step Chart` of `#type` to create `StepChart` instance\n","project":"chart"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"- In `./common/AreaChart.js`, class `AreaChart` inherits from `LineChart`, `AreaChart`:\n - append g element (class `areas`) inside `svg`\n - append polygons (each class `area area-{index}`) inside `.areas` \n - each `.area` is below the `.dataset` line\n - each `.area` color is the same as `.dataset` line color, half transparent\n- Select the option `Area Chart` of `#type` to create `AreaChart` instance\n","project":"chart"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"- In `./common/BarChart.js`, class `BarChart` inherits from `Chart`, `BarChart`:\n - there is 1 more grid-x line than LineChart, all the grid-x lines are evenly distributed in `.grids`\n - axis-x labels are placed between 2 adjacent grids below the `.axis-x`\n - append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them)\n - append g element (class `dataset dataset-${index}`) inside `.datasets` for each `datasets` item\n - append bars (rect elements, class `bar bar-{index}`) with the same color inside `.dataset` for each `dataset.data` item\n - bars are distributed within each column enclosed by 2 adjacent grid-x lines \n - bars in different `.dataset` have unique colors\n - bars in the same column are evenly distributed\n- Select the option `Bar Chart` of `#type` to create `BarChart` instance\n","project":"chart"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"In `./common/BarChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- each dataLabel is above the `.dataset` bars, distributes from left to right\n- each dataLabel color is the same as `.dataset` bars color\n","project":"chart"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"In `./common/BarChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over the `.datasets` area in `svg`, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - in `.tooltips`, show all data from the `.dataset` that corresponds to the area enclosed by the selected `.grid-x` and next adjacent `.grid-x`\n- when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)\n","project":"chart"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"- In `./common/PieChart.js`, class `PieChart` inherits from `Chart`, `PieChart`:\n - append g element (class `datasets`) inside `svg` and make it fill the most area of `svg`\n - append g element (class `dataset dataset-0`) inside `.datasets` for the first `datasets` item\n - append sectors (path elements, each class `sector sector-{index}`) with the unique color inside `.dataset` for each `dataset.data` item\n - all the sectors form a large circle\n - the area of each sector is related to its proportion of the data\n- Select the option `Pie Chart` of `#type` to create `PieChart` instance, make `#axes`, `#grids`, `#pointStyle` disabled, and make `#datasets` single selection mode\n","project":"chart"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"- In `./common/DoughnutChart.js`, class `DoughnutChart` inherits from `PieChart`, `DoughnutChart`:\n - cover the central circle area with `#circleMask` from `assets/res.svg`\n- Select the option `Doughnut Chart` of `#type` to create `DoughnutChart` instance\n","project":"chart"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"In `./common/PieChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-0`) inside `svg` for the first `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- show the sector data and proportion in each dataLabel\n- append connect lines (each class `connect connect-{index}`) inside `.dataLabels` to connect each dataLabel and its corresponding sector\n- each dataLabel is positioned near its corresponding sector and distributed around the large circle\n","project":"chart"} +{"id":"task-19","date":"2025-05-12","level":"moderate","description":"In `./common/PieChart.js`:\n- when mouse hovers over a sector, it scales up by 1.05 times proportionally around pie center point\n- when mouse leaves a sector, its size returns to normal\n","project":"chart"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"In `./common/PieChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over a sector in `svg`, display `.tooltips` near the mouse position\n- show the sector data and proportion in `.tooltips`\n- when mouse leaves a sector, hide `.tooltips` (add class `hidden`)\n","project":"chart"} \ No newline at end of file diff --git a/datasets/color.jsonl b/datasets/color.jsonl index daba96557132f9e8f360cd9fc36f3fec9320f455..8bb109d290a73b0743a9ab28da39a6437ecacf9f 100644 --- a/datasets/color.jsonl +++ b/datasets/color.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"- change `.color.rgb` background with rgba color whose each item is from the value of corresponding range input\n- For each `.prop` in `.color.rgb`, move range slider to show value in `.result`\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"For each `.prop` in `.color.rgb`:\n- move range slider to change `.color` background color\n- background color is rgb color whose each item is from the value of corresponding range input\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"- add element `.color.hsl` to `.root`\n- implement hsl color config panel like `.color.rgb`\n- each color component value is 0 and alpha is 1\n- change `.color.hsl` background with hsl color whose item is from the corespondent range value\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"- add element `.color.lab` to `.root`\n- implement lab color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.lab` background with lab color whose item is from the corespondent range value\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"- add element `.color.lch` to `.root`\n- implement lch color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.lch` background with lch color whose item is from the corespondent range value\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"- add element `.color.oklab` to `.root`\n- implement oklab color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.oklab` background with oklab color whose item is from the corespondent range value\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"- add element `.color.oklch` to `.root`\n- implement oklch color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.oklch` background with oklch color whose item is from the corespondent range value\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"- add element `.color.hwb` to `.root`\n- implement hwb color config panel like `.color.rgb`\n- each color component value is 0 and alpha is 1\n- change `.color.hwb` background with hwb color whose item is from the corespondent range value\n"} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"- add a button `#changeTheme` fixed at the bottom-center of the page\n- click `#changeTheme` to change the light and dark theme of the page\n- use `light-dark()` to manage themes\n"} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"- use hsl relative color for dark theme\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"- make `.result` color contrast ratio to be more than 4.5 to comply with WCAG guidelines\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"- add element `.color.hsl-wheel` to `.root`\n- draw a hsl color wheel (class `wheel`) canvas in the `.hsl-wheel`\n- canvas has the same width and height, color wheel fill the entire canvas\n- lightness is 50\n- red is at the leftmost point of the color wheel, with red, green and blue arranged clockwise\n- saturated red is the left point of the canvas, unsaturated red is the center point of the canvas\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"When click `.hsl-wheel .wheel` color:\n- change `.hsl-wheel` background color to `.hsl-wheel .wheel` color\n- add a block (class `block`) in the `.hsl-wheel` if it does not exist, and set its center at the clicked point\n - `.block` width and height is less than or equal 12px\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"- add a vertical lightness range (class `l`) in the `.hsl-wheel`, at the right of `.hsl-wheel .wheel`\n- default value is 50\n- change lightness range to redraw `.hsl-wheel .wheel` with new lightness\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"- add element `.color.lch-wheel` to `.root`\n- draw a hsl color wheel (class `wheel`) canvas in the `.lch-wheel`\n- lightness is 50, saturate is 100\n- red is at the leftmost point of the color wheel, with red, green and blue arranged clockwise\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"When click `.lch-wheel .wheel` color:\n- change `.lch-wheel` background color to lch color with h from `.lch-wheel .wheel` angle, lightness 50 , chroma 50\n- add a block (class `block`) in the `.lch-wheel` if it does not exist, and set its center at the clicked point\n - `.block` width and height is less than or equal 12px\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"- default `.lch-wheel .wheel` angle (h) is 0\n- add a lightness vertical range (class `l`) in the `.lch-wheel`\n - default value is 50\n - change lightness range to redraw `.lch-wheel .wheel` with new lightness, and update `.lch-wheel` background color\n- add a chroma vertical range (class `c`) in the `.lch-wheel`\n - default value is 50\n - change chroma range to update `.lch-wheel` background color\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"- add element `.color.hwb-wheel` to `.root`\n- draw a hsl color wheel (class `wheel`) canvas in the `.hwb-wheel`\n- lightness is 50, saturate is 100\n- red is at the leftmost point of the color wheel, with red, green and blue arranged clockwise\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"When click `.wheel` color:\n- change `.hwb-wheel` background color to hwb color with h from `.wheel` angle, whiteness 0, blackness 0\n- add a block (class `block`) in the `.hwb-wheel` if it does not exist, and set its center at the clicked point\n - `.block` width and height is less than or equal 12px\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"- default `.wheel` angle (h) is 0\n- add a whiteness vertical range (class `w`) in the `.hwb-wheel`\n - default value is 0\n - change whiteness range to update `.hwb-wheel` background color\n- add a blackness vertical range (class `b`) in the `.hwb-wheel`\n - default value is 0\n - change blackness range to update `.hwb-wheel` background color\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"- change `.color.rgb` background with rgba color whose each item is from the value of corresponding range input\n- For each `.prop` in `.color.rgb`, move range slider to show value in `.result`\n","project":"color"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"For each `.prop` in `.color.rgb`:\n- move range slider to change `.color` background color\n- background color is rgb color whose each item is from the value of corresponding range input\n","project":"color"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"- add element `.color.hsl` to `.root`\n- implement hsl color config panel like `.color.rgb`\n- each color component value is 0 and alpha is 1\n- change `.color.hsl` background with hsl color whose item is from the corespondent range value\n","project":"color"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"- add element `.color.lab` to `.root`\n- implement lab color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.lab` background with lab color whose item is from the corespondent range value\n","project":"color"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"- add element `.color.lch` to `.root`\n- implement lch color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.lch` background with lch color whose item is from the corespondent range value\n","project":"color"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"- add element `.color.oklab` to `.root`\n- implement oklab color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.oklab` background with oklab color whose item is from the corespondent range value\n","project":"color"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"- add element `.color.oklch` to `.root`\n- implement oklch color config panel like `.color.rgb`\n- each color component default value is 0 and alpha is 1\n- change `.color.oklch` background with oklch color whose item is from the corespondent range value\n","project":"color"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"- add element `.color.hwb` to `.root`\n- implement hwb color config panel like `.color.rgb`\n- each color component value is 0 and alpha is 1\n- change `.color.hwb` background with hwb color whose item is from the corespondent range value\n","project":"color"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"- add a button `#changeTheme` fixed at the bottom-center of the page\n- click `#changeTheme` to change the light and dark theme of the page\n- use `light-dark()` to manage themes\n","project":"color"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"- use hsl relative color for dark theme\n","project":"color"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"- make `.result` color contrast ratio to be more than 4.5 to comply with WCAG guidelines\n","project":"color"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"- add element `.color.hsl-wheel` to `.root`\n- draw a hsl color wheel (class `wheel`) canvas in the `.hsl-wheel`\n- canvas has the same width and height, color wheel fill the entire canvas\n- lightness is 50\n- red is at the leftmost point of the color wheel, with red, green and blue arranged clockwise\n- saturated red is the left point of the canvas, unsaturated red is the center point of the canvas\n","project":"color"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"When click `.hsl-wheel .wheel` color:\n- change `.hsl-wheel` background color to `.hsl-wheel .wheel` color\n- add a block (class `block`) in the `.hsl-wheel` if it does not exist, and set its center at the clicked point\n - `.block` width and height is less than or equal 12px\n","project":"color"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"- add a vertical lightness range (class `l`) in the `.hsl-wheel`, at the right of `.hsl-wheel .wheel`\n- default value is 50\n- change lightness range to redraw `.hsl-wheel .wheel` with new lightness\n","project":"color"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"- add element `.color.lch-wheel` to `.root`\n- draw a hsl color wheel (class `wheel`) canvas in the `.lch-wheel`\n- lightness is 50, saturate is 100\n- red is at the leftmost point of the color wheel, with red, green and blue arranged clockwise\n","project":"color"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"When click `.lch-wheel .wheel` color:\n- change `.lch-wheel` background color to lch color with h from `.lch-wheel .wheel` angle, lightness 50 , chroma 50\n- add a block (class `block`) in the `.lch-wheel` if it does not exist, and set its center at the clicked point\n - `.block` width and height is less than or equal 12px\n","project":"color"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"- default `.lch-wheel .wheel` angle (h) is 0\n- add a lightness vertical range (class `l`) in the `.lch-wheel`\n - default value is 50\n - change lightness range to redraw `.lch-wheel .wheel` with new lightness, and update `.lch-wheel` background color\n- add a chroma vertical range (class `c`) in the `.lch-wheel`\n - default value is 50\n - change chroma range to update `.lch-wheel` background color\n","project":"color"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"- add element `.color.hwb-wheel` to `.root`\n- draw a hsl color wheel (class `wheel`) canvas in the `.hwb-wheel`\n- lightness is 50, saturate is 100\n- red is at the leftmost point of the color wheel, with red, green and blue arranged clockwise\n","project":"color"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"When click `.wheel` color:\n- change `.hwb-wheel` background color to hwb color with h from `.wheel` angle, whiteness 0, blackness 0\n- add a block (class `block`) in the `.hwb-wheel` if it does not exist, and set its center at the clicked point\n - `.block` width and height is less than or equal 12px\n","project":"color"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"- default `.wheel` angle (h) is 0\n- add a whiteness vertical range (class `w`) in the `.hwb-wheel`\n - default value is 0\n - change whiteness range to update `.hwb-wheel` background color\n- add a blackness vertical range (class `b`) in the `.hwb-wheel`\n - default value is 0\n - change blackness range to update `.hwb-wheel` background color\n","project":"color"} \ No newline at end of file diff --git a/datasets/dom.jsonl b/datasets/dom.jsonl index 5a293670e370e1a1502a2704bb03f3bd7437d968..8f8d5b7848f77d4248d2ae812087712f5df4bc6b 100644 --- a/datasets/dom.jsonl +++ b/datasets/dom.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add tools element (class 'tools', height 40px) and entries element (class 'entries') in the leftbar of the page. tools and entries together fill the entire leftbar space. Add buttons with text 'file', 'dir', 'del' at the tools right side."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Click button file to append a file element (class 'entry file') in the entries panel. A file has an unique 'id' attribute, a 'data-content' attribute with random text and random filename. Click a file to display text in the editor. Use DOM API as much as possible. Save codes to 'common/file.js' imported by 'index.js'."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Click button dir to append a dir element (class 'entry dir') in the entries panel. A dir has an unique id attribute, random dirname as its text content and a child element (class 'dir-content'). Click dir to show/hide dir-content by add/remove class 'open'. Use DOM API as much as possible. Save codes to 'common/dir.js' imported by 'index.js'."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"When an entry (file or dir) is created or clicked, mark it as SelectedEntry (add class 'selected', highlight bg color). Remove 'selected' class from the entry when creating (or clicking) other entry or clicking empty space of the entries panel. Save codes to 'common/sel.js' imported by 'index.js'. When SelectedEntry is file, insert new entry after it and save codes to 'common/file.js'. When SelectedEntry is dir, open it and append new entry in its dir-content. Save codes to 'common/dir.js' Use DOM API."} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Button del is disabled when SelectedEntry is empty. Click button del to delete SelectedEntry and set SelectedEntry to its next sibling entry if existed, or previous sibling if existed, or parent entry. If new SelectedEntry is dir, show its content. Save codes to 'common/entry.js' imported by 'index.js'."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Drag and move an entry to append to entries panel, or to insert after other file. Drag and move an entry to append to other dir when dragging to target's left half part, and to insert after the target when dragging to target's right half part. Save codes to 'common/drag.js' imported by 'index.js'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add context menu (class menu) when right clicking entry. Add menu item (class menu-item) 'add file' (class menu-item-add-file), 'add dir' (class menu-item-add-dir), delete (class menu-item-delete) properly for entry. Save codes to 'common/menu.js' imported by 'index.js'."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Add context menu when right clicking entries panel. Add menu item 'add file', 'add dir', delete properly for entries panel. Save codes to 'common/menu.js'."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add menu item copy (class menu-item-copy), paste (class menu-item-paste) properly for entry and entries panel. Save codes to 'common/menu.js'."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Add menu item rename (class menu-item-rename) for entry. Use prompt to collect new name. Save codes to 'common/menu.js'."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append button imp in tools panel. Click button imp to clear entries panel and import JSON data to entries panel from prompt dialog. Save codes to 'common/entry.js'. JSON Data sample: ```{\"entries\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[]}]} ]}```."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Append button exp in tools panel. Click button exp to save all entries to JSON data displayed in alert dialog. Save codes to 'common/entry.js'. "} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Modify file content in editor and auto save the content. Save codes to 'common/editor.js' imported by 'index.js'."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcuts for menu items. In MACOS, use keys 'Cmd+C' for copy, 'Cmd+V' for paste, 'Cmd+J' for 'add file', 'Cmd+K' for 'add dir'. In other OS, replace 'Cmd' with 'Ctrl'. Save codes to 'common/menu.js'."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcut for menu item 'delete'. Use key 'Delete' and 'Backspace' to delete entry. Save codes to 'common/menu.js'."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Append button gen in tools panel. Click button gen to generate 100 files or dirs at the root of entries panel. Generate less than 10 files or dirs for each dir at the root. Save codes to 'common/entry.js'."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add resizer with absolute positions at the right side of the leftbar. resizer is hidden by default and become visible when mouse hovers over leftbar. Save codes to 'common/resizer.js'."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Drag resizer to adjust leftbar width. Save codes to 'common/resizer.js'."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Append button filter in tools panel. Click button filter to use prompt dialog to collect keyword which is used to filter entry name. Save codes to 'common/filter.js'."} -{"id":"task-20","date":"2025-05-12","level":"moderate","description":"Add menu item 'cut' with shortcut (Cmd/Ctrl+X) for entry."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add tools element (class 'tools', height 40px) and entries element (class 'entries') in the leftbar of the page. tools and entries together fill the entire leftbar space. Add buttons with text 'file', 'dir', 'del' at the tools right side.","project":"dom"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Click button file to append a file element (class 'entry file') in the entries panel. A file has an unique 'id' attribute, a 'data-content' attribute with random text and random filename. Click a file to display text in the editor. Use DOM API as much as possible. Save codes to 'common/file.js' imported by 'index.js'.","project":"dom"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Click button dir to append a dir element (class 'entry dir') in the entries panel. A dir has an unique id attribute, random dirname as its text content and a child element (class 'dir-content'). Click dir to show/hide dir-content by add/remove class 'open'. Use DOM API as much as possible. Save codes to 'common/dir.js' imported by 'index.js'.","project":"dom"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"When an entry (file or dir) is created or clicked, mark it as SelectedEntry (add class 'selected', highlight bg color). Remove 'selected' class from the entry when creating (or clicking) other entry or clicking empty space of the entries panel. Save codes to 'common/sel.js' imported by 'index.js'. When SelectedEntry is file, insert new entry after it and save codes to 'common/file.js'. When SelectedEntry is dir, open it and append new entry in its dir-content. Save codes to 'common/dir.js' Use DOM API.","project":"dom"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Button del is disabled when SelectedEntry is empty. Click button del to delete SelectedEntry and set SelectedEntry to its next sibling entry if existed, or previous sibling if existed, or parent entry. If new SelectedEntry is dir, show its content. Save codes to 'common/entry.js' imported by 'index.js'.","project":"dom"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Drag and move an entry to append to entries panel, or to insert after other file. Drag and move an entry to append to other dir when dragging to target's left half part, and to insert after the target when dragging to target's right half part. Save codes to 'common/drag.js' imported by 'index.js'.","project":"dom"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add context menu (class menu) when right clicking entry. Add menu item (class menu-item) 'add file' (class menu-item-add-file), 'add dir' (class menu-item-add-dir), delete (class menu-item-delete) properly for entry. Save codes to 'common/menu.js' imported by 'index.js'.","project":"dom"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Add context menu when right clicking entries panel. Add menu item 'add file', 'add dir', delete properly for entries panel. Save codes to 'common/menu.js'.","project":"dom"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add menu item copy (class menu-item-copy), paste (class menu-item-paste) properly for entry and entries panel. Save codes to 'common/menu.js'.","project":"dom"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Add menu item rename (class menu-item-rename) for entry. Use prompt to collect new name. Save codes to 'common/menu.js'.","project":"dom"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append button imp in tools panel. Click button imp to clear entries panel and import JSON data to entries panel from prompt dialog. Save codes to 'common/entry.js'. JSON Data sample: ```{\"entries\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[]}]} ]}```.","project":"dom"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Append button exp in tools panel. Click button exp to save all entries to JSON data displayed in alert dialog. Save codes to 'common/entry.js'. ","project":"dom"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Modify file content in editor and auto save the content. Save codes to 'common/editor.js' imported by 'index.js'.","project":"dom"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcuts for menu items. In MACOS, use keys 'Cmd+C' for copy, 'Cmd+V' for paste, 'Cmd+J' for 'add file', 'Cmd+K' for 'add dir'. In other OS, replace 'Cmd' with 'Ctrl'. Save codes to 'common/menu.js'.","project":"dom"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcut for menu item 'delete'. Use key 'Delete' and 'Backspace' to delete entry. Save codes to 'common/menu.js'.","project":"dom"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Append button gen in tools panel. Click button gen to generate 100 files or dirs at the root of entries panel. Generate less than 10 files or dirs for each dir at the root. Save codes to 'common/entry.js'.","project":"dom"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add resizer with absolute positions at the right side of the leftbar. resizer is hidden by default and become visible when mouse hovers over leftbar. Save codes to 'common/resizer.js'.","project":"dom"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Drag resizer to adjust leftbar width. Save codes to 'common/resizer.js'.","project":"dom"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Append button filter in tools panel. Click button filter to use prompt dialog to collect keyword which is used to filter entry name. Save codes to 'common/filter.js'.","project":"dom"} +{"id":"task-20","date":"2025-05-12","level":"moderate","description":"Add menu item 'cut' with shortcut (Cmd/Ctrl+X) for entry.","project":"dom"} \ No newline at end of file diff --git a/datasets/dom1.jsonl b/datasets/dom1.jsonl index 9ef243575e8461096351e0026c64b021a1350191..b9e7a04f4d784cf98db484d25c991bf1d820a23a 100644 --- a/datasets/dom1.jsonl +++ b/datasets/dom1.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add tools element (class 'tools', height 40px) and entries element (class 'entries') in the leftbar of the page. tools and entries together fill the entire leftbar space. Add buttons with text 'file', 'dir', 'del' at the tools right side. Save codes to 'index.html'."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Click button file to append a file element (class 'entry file') in the entries panel. A file has an unique 'id' attribute, a 'data-content' attribute with random text and random filename. Click a file to display text in the editor. Use DOM API as much as possible. Save codes to 'index.html'."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Click button dir to append a dir element (class 'entry dir') in the entries panel. A dir has an unique id attribute, random dirname as its text content and a child element (class 'dir-content'). Click dir to show/hide dir-content by add/remove class 'open'. Use DOM API as much as possible. Save codes to 'index.html'."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"When an entry (file or dir) is created or clicked, mark it as SelectedEntry (add class 'selected', highlight bg color). Remove 'selected' class from the entry when creating (or clicking) other entry or clicking empty space of the entries panel. When SelectedEntry is file, insert new entry after it. When SelectedEntry is dir, open it and append new entry in its dir-content. Use DOM API. Save codes to 'index.html'."} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Button del is disabled when SelectedEntry is empty. Click button del to delete SelectedEntry and set SelectedEntry to its next sibling entry if existed, or previous sibling if existed, or parent entry. If new SelectedEntry is dir, show its content. Save codes to 'index.html'."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Drag and move an entry to append to entries panel, or to insert after other file. Drag and move an entry to append to other dir when dragging to target's left half part, and to insert after the target when dragging to target's right half part."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add context menu(class menu) when right clicking entry. Add menu item(class menu-item) 'add file'(class menu-item-add-file), 'add dir'(class menu-item-add-dir), delete(class menu-item-delete) properly for entry."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Add context menu when right clicking entries panel. Add menu item 'add file', 'add dir', delete properly for entries panel."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add menu item copy(class menu-item-copy), paste(class menu-item-paste) properly for entry and entries panel."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Add menu item rename(class menu-item-rename) for entry. Use prompt to collect new name."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append button imp in tools panel. Click button imp to clear entries panel and import JSON data to entries panel from prompt dialog. JSON Data sample: ```{\"entries\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[]}]} ]}```."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Append button exp in tools panel. Click button exp to save all entries to JSON data displayed in alert dialog."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Modify file content in editor and auto save the content."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcuts for menu items. In MACOS, use keys 'Cmd+C' for copy, 'Cmd+V' for paste, 'Cmd+J' for 'add file', 'Cmd+K' for 'add dir'. In other OS, replace 'Cmd' with 'Ctrl'."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcut for menu item 'delete'. Use key 'Delete' and 'Backspace' to delete entry."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Append button gen in tools panel. Click button gen to generate 100 files or dirs at the root of entries panel. Generate less than 10 files or dirs for each dir at the root."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add resizer with absolute positions at the right side of the leftbar. resizer is hidden by default and become visible when mouse hovers over leftbar."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Drag resizer to adjust leftbar width."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Append button filter in tools panel. Click button filter to use prompt dialog to collect keyword which is used to filter entry name."} -{"id":"task-20","date":"2025-05-12","level":"moderate","description":"Add menu item 'cut' with shortcut(Cmd/Ctrl+X) for entry."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add tools element (class 'tools', height 40px) and entries element (class 'entries') in the leftbar of the page. tools and entries together fill the entire leftbar space. Add buttons with text 'file', 'dir', 'del' at the tools right side. Save codes to 'index.html'.","project":"dom1"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Click button file to append a file element (class 'entry file') in the entries panel. A file has an unique 'id' attribute, a 'data-content' attribute with random text and random filename. Click a file to display text in the editor. Use DOM API as much as possible. Save codes to 'index.html'.","project":"dom1"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Click button dir to append a dir element (class 'entry dir') in the entries panel. A dir has an unique id attribute, random dirname as its text content and a child element (class 'dir-content'). Click dir to show/hide dir-content by add/remove class 'open'. Use DOM API as much as possible. Save codes to 'index.html'.","project":"dom1"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"When an entry (file or dir) is created or clicked, mark it as SelectedEntry (add class 'selected', highlight bg color). Remove 'selected' class from the entry when creating (or clicking) other entry or clicking empty space of the entries panel. When SelectedEntry is file, insert new entry after it. When SelectedEntry is dir, open it and append new entry in its dir-content. Use DOM API. Save codes to 'index.html'.","project":"dom1"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Button del is disabled when SelectedEntry is empty. Click button del to delete SelectedEntry and set SelectedEntry to its next sibling entry if existed, or previous sibling if existed, or parent entry. If new SelectedEntry is dir, show its content. Save codes to 'index.html'.","project":"dom1"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Drag and move an entry to append to entries panel, or to insert after other file. Drag and move an entry to append to other dir when dragging to target's left half part, and to insert after the target when dragging to target's right half part.","project":"dom1"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add context menu(class menu) when right clicking entry. Add menu item(class menu-item) 'add file'(class menu-item-add-file), 'add dir'(class menu-item-add-dir), delete(class menu-item-delete) properly for entry.","project":"dom1"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Add context menu when right clicking entries panel. Add menu item 'add file', 'add dir', delete properly for entries panel.","project":"dom1"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add menu item copy(class menu-item-copy), paste(class menu-item-paste) properly for entry and entries panel.","project":"dom1"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Add menu item rename(class menu-item-rename) for entry. Use prompt to collect new name.","project":"dom1"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append button imp in tools panel. Click button imp to clear entries panel and import JSON data to entries panel from prompt dialog. JSON Data sample: ```{\"entries\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[{\"type\":\"file\", \"name\":\"filename\", \"content\":\"content\"}, {\"type\":\"dir\", \"name\":\"dirname\", \"children\":[]}]} ]}```.","project":"dom1"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Append button exp in tools panel. Click button exp to save all entries to JSON data displayed in alert dialog.","project":"dom1"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Modify file content in editor and auto save the content.","project":"dom1"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcuts for menu items. In MACOS, use keys 'Cmd+C' for copy, 'Cmd+V' for paste, 'Cmd+J' for 'add file', 'Cmd+K' for 'add dir'. In other OS, replace 'Cmd' with 'Ctrl'.","project":"dom1"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Dispatch and display shortcut for menu item 'delete'. Use key 'Delete' and 'Backspace' to delete entry.","project":"dom1"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Append button gen in tools panel. Click button gen to generate 100 files or dirs at the root of entries panel. Generate less than 10 files or dirs for each dir at the root.","project":"dom1"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add resizer with absolute positions at the right side of the leftbar. resizer is hidden by default and become visible when mouse hovers over leftbar.","project":"dom1"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Drag resizer to adjust leftbar width.","project":"dom1"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Append button filter in tools panel. Click button filter to use prompt dialog to collect keyword which is used to filter entry name.","project":"dom1"} +{"id":"task-20","date":"2025-05-12","level":"moderate","description":"Add menu item 'cut' with shortcut(Cmd/Ctrl+X) for entry.","project":"dom1"} \ No newline at end of file diff --git a/datasets/draw.jsonl b/datasets/draw.jsonl index 2ab67f921951e66377124d280bc4a5bcd6e8fd26..94f3d7afad37b8ba1b1bdd6044a26940cf15277f 100644 --- a/datasets/draw.jsonl +++ b/datasets/draw.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add toolkit container (class 'toolkit') and svg element (class 'canvas') in '.root'. toolkit and canvas together fill the whole space of the browser element. Add shape container (class 'shape'), prop container (class 'prop') and operation container (class 'operation') horizontally in the toolkit. shape container (3 labels width) is at the toolkit's left side. operation container (6 labels width) is at the toolkit's right side. prop container occupies the toolkit's remaining space. Add a line width input (class 'line-width', value from 1 to 21, default is 9) in the prop container. Add a color selector input (class 'color', default is #000000) in the prop container."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Add radios wrapped by label in shape container with values: line, rect, ellipse. Add radios wrapped by label in operation container with values: move, rotate, zoom, copy, delete, fill. Each radio in both shape and operation container has the same name 'operation'. Each label's class is the the value of its inner radio. Generate an SVG image using the label's class and use it as the label's background image. Set each radio width/height to 0 but not hide them."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"When click label line, use mouse in canvas to draw a svg line (line width is '.line-width' value, line color is '.color' value). The line's start point is the point when mouse pressing down and end point is the point when mouse pressing up."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"When click label rect, use mouse in canvas to draw a svg rect (fill color is white, line width is '.line-width' value, line color is '.color' value). The rect's left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"When click label ellipse, use mouse in canvas to draw a svg ellipse (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The ellipse's center is the rect center, x radius is the half rect width, y radius is the half rect height."} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"After label delete clicked, click any shape (line/rect/ellipse/...) in the canvas to delete it."} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"After label fill clicked, click any shape (line/rect/ellipse/...) in the canvas to set its fill color to '.color' value."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"After label copy clicked, click any shape (line/rect/ellipse/...) in the canvas to copy itself. The copied shape is placed 20 to the right and 20 below the original shape."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"When the length of the line is less than line width, keep it to be the line width."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"When the width or height of the rect is less than line width, keep it to be line width."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"When the x or y radius of the ellipse is less than half line width, keep it to be half line width."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"After label move clicked, drag and move any shape in the canvas."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"After label rotate clicked, drag and rotate any shape in the canvas around its center."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Perform move and rotate operations on a shape in any sequence, ensuring that each operation builds on the previous one."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"After label zoom clicked, drag and zoom any shape in the canvas according the distance between mouse position and its center. Zoom the shape around its center."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Perform move, rotate, and zoom operations on a shape in any sequence, ensuring that each operation builds on the previous one."} -{"id":"task-17","date":"2025-05-12","level":"easy","description":"Set label move clicked after creating or copying a shape."} -{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Press and hold the blankspace to enable moving the shape. Release it to restore the selected label if needed."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Support touch events for operations: create, copy, delete, fill."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Support touch events for operations: move, rotate, zoom."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add toolkit container (class 'toolkit') and svg element (class 'canvas') in '.root'. toolkit and canvas together fill the whole space of the browser element. Add shape container (class 'shape'), prop container (class 'prop') and operation container (class 'operation') horizontally in the toolkit. shape container (3 labels width) is at the toolkit's left side. operation container (6 labels width) is at the toolkit's right side. prop container occupies the toolkit's remaining space. Add a line width input (class 'line-width', value from 1 to 21, default is 9) in the prop container. Add a color selector input (class 'color', default is #000000) in the prop container.","project":"draw"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Add radios wrapped by label in shape container with values: line, rect, ellipse. Add radios wrapped by label in operation container with values: move, rotate, zoom, copy, delete, fill. Each radio in both shape and operation container has the same name 'operation'. Each label's class is the the value of its inner radio. Generate an SVG image using the label's class and use it as the label's background image. Set each radio width/height to 0 but not hide them.","project":"draw"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"When click label line, use mouse in canvas to draw a svg line (line width is '.line-width' value, line color is '.color' value). The line's start point is the point when mouse pressing down and end point is the point when mouse pressing up.","project":"draw"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"When click label rect, use mouse in canvas to draw a svg rect (fill color is white, line width is '.line-width' value, line color is '.color' value). The rect's left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up.","project":"draw"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"When click label ellipse, use mouse in canvas to draw a svg ellipse (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The ellipse's center is the rect center, x radius is the half rect width, y radius is the half rect height.","project":"draw"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"After label delete clicked, click any shape (line/rect/ellipse/...) in the canvas to delete it.","project":"draw"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"After label fill clicked, click any shape (line/rect/ellipse/...) in the canvas to set its fill color to '.color' value.","project":"draw"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"After label copy clicked, click any shape (line/rect/ellipse/...) in the canvas to copy itself. The copied shape is placed 20 to the right and 20 below the original shape.","project":"draw"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"When the length of the line is less than line width, keep it to be the line width.","project":"draw"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"When the width or height of the rect is less than line width, keep it to be line width.","project":"draw"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"When the x or y radius of the ellipse is less than half line width, keep it to be half line width.","project":"draw"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"After label move clicked, drag and move any shape in the canvas.","project":"draw"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"After label rotate clicked, drag and rotate any shape in the canvas around its center.","project":"draw"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Perform move and rotate operations on a shape in any sequence, ensuring that each operation builds on the previous one.","project":"draw"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"After label zoom clicked, drag and zoom any shape in the canvas according the distance between mouse position and its center. Zoom the shape around its center.","project":"draw"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Perform move, rotate, and zoom operations on a shape in any sequence, ensuring that each operation builds on the previous one.","project":"draw"} +{"id":"task-17","date":"2025-05-12","level":"easy","description":"Set label move clicked after creating or copying a shape.","project":"draw"} +{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Press and hold the blankspace to enable moving the shape. Release it to restore the selected label if needed.","project":"draw"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Support touch events for operations: create, copy, delete, fill.","project":"draw"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Support touch events for operations: move, rotate, zoom.","project":"draw"} \ No newline at end of file diff --git a/datasets/esmodule.jsonl b/datasets/esmodule.jsonl index ea87bfe378ce1a5a630675128adbccc8813aa501..703813b368f38c56bf26b01ca5227f5b97695a13 100644 --- a/datasets/esmodule.jsonl +++ b/datasets/esmodule.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Named function 'log' contains params: id (string), value(any type). log function creates a log item (class 'item', id is param 'id') appended to the '.log'. Save and export log function to es-module 'modules/log.js'. Correctly import log function and call `log('log', 'hello esmodule')` in 'index.js'."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Named function 'square' contains param value (number) and returns the square result of param value. Named constant 'PI' (number, value is '3.1415926'). Save and export 'square' and 'PI' to es-module 'modules/math.js'. Import from 'modules/math.js' as namespace 'math' in 'index.js' and call `log('PI', math.PI); log('square', math.square(2))`."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Named function 'cube' contains param value (number) and returns the cubing result of param value. Save 'cube' to 'modules/math.js' and export 'cube' as default. Import all available exports from 'modules/math.js' as namespace 'math' in 'index.js'. Import default named 'cube' from 'modules/math.js' in 'index.js' and call `log('cube1', math.default(2)); log('cube2', cube(2))`."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Class Shape (file 'modules/Shape.js') contains an getter 'area' returning the area (number, default 0) of the shape. Class Rectangle (file 'modules/Rectangle.js') inheriting from Shape contains properties 'width' (number), 'height' (number) initialized in constructor. Call `log('shape1', new Shape().area); log('rectangle1', new Rectangle(2, 3).area)` in 'index.js'."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class Circle (file 'modules/Circle.js') inherits from Shape. Circle constructor params: 'radius' (number). Circle computes area using 'PI' imported from 'modules/math.js'. Call `log('circle1', new Circle(1).area); log('circle2', new Circle(2).area);` in 'index.js'."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Set a global variable 'UNIT' to the value 'celsius' in 'modules/math.js'. 'UNIT' can not be exported from 'modules/math.js'. Call `log('global1', UNIT)` in 'index.js'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Export variable 'langs' (value ['en','zh','fr']) from 'modules/lang.js'. Export function 'getLangs' from 'modules/log.js'. 'getLangs' use 'dynamic import' to import langs from 'modules/lang.js'. Call `log('langs', (await getLangs()).join(','))` in 'index.js'."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Move 'modules/log.js', 'modules/math.js', 'modules/lang.js' to 'modules/util/' path, modify references in other files."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Move 'modules/Shape.js', 'modules/Circle.js', 'modules/Rectangle.js' to 'modules/shape/' path, modify references in other files."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Write content `{\"version\":1}` to file 'modules/resource/config.json' imported as an object 'config' in 'index.js'. Call `log('config', JSON.stringify(config))` in 'index.js'."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Write content `.log{font-weight: bold;}` to file 'modules/resource/style.css' imported as an object 'style' in 'index.js'. Call `log('style', style.cssRules[0].selectorText)` in 'index.js'."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Export all classes of 'modules/shape/' path from 'modules/shape/index.js' imported in 'index.js'. Remove all other imports of Shape class and child-classes from 'index.js'."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Use nodejs builtin modules to write file content `export const config = {lang: 'en'}` to es-module 'nodejs/test-config.js' (at the same dir as 'nodejs/index.js'). Save codes to es-module 'nodejs/index.js'."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Export variable 'lang' from 'nodejs/index.js'. Set 'lang' value to `config.lang` which is dynamic imported from 'nodejs/test-config.js'."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Export variable 'cjs' (value true) from common-js 'nodejs/cjs.cjs'. Export from 'nodejs/index.js' with a variable 'cjs' whose value is set to `cjs` dynamically imported from 'nodejs/cjs.cjs'."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Set importmap in 'index.html' with value `{\"imports\": {\"shape\": \"./modules/shape/index.js\"}}`. Import Shape (alias Shape2) from 'shape' and call `log('shape2', new Shape2().area)` in 'index.js'."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add new map rule ('shape/' to './modules/shape/') in the importmap. Import Shape (alias Shape3) from 'shape/Shape.js' and Call `log('shape3', new Shape3().area)` in 'index.js'."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Write content `{\"version\":1}` to file 'modules/nodejs/data.json' which is exported as an object 'data' in 'modules/nodejs/index.js'."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Export inline json data `{\"inline\":true}` as an object 'inlineData' by data URL in 'modules/nodejs/index.js'."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Write content `{\"zh\":1}` to 'modules/data/zh.json', `{\"en\":1}` to 'modules/data/en.json', `{\"fr\":1}` to 'modules/data/fr.json'. Dynamically import all the modules under 'modules/data/', merge all the data to an object 'data' and call `log('data', JSON.stringify(data))` in 'index.js'."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Named function 'log' contains params: id (string), value(any type). log function creates a log item (class 'item', id is param 'id') appended to the '.log'. Save and export log function to es-module 'modules/log.js'. Correctly import log function and call `log('log', 'hello esmodule')` in 'index.js'.","project":"esmodule"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Named function 'square' contains param value (number) and returns the square result of param value. Named constant 'PI' (number, value is '3.1415926'). Save and export 'square' and 'PI' to es-module 'modules/math.js'. Import from 'modules/math.js' as namespace 'math' in 'index.js' and call `log('PI', math.PI); log('square', math.square(2))`.","project":"esmodule"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Named function 'cube' contains param value (number) and returns the cubing result of param value. Save 'cube' to 'modules/math.js' and export 'cube' as default. Import all available exports from 'modules/math.js' as namespace 'math' in 'index.js'. Import default named 'cube' from 'modules/math.js' in 'index.js' and call `log('cube1', math.default(2)); log('cube2', cube(2))`.","project":"esmodule"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Class Shape (file 'modules/Shape.js') contains an getter 'area' returning the area (number, default 0) of the shape. Class Rectangle (file 'modules/Rectangle.js') inheriting from Shape contains properties 'width' (number), 'height' (number) initialized in constructor. Call `log('shape1', new Shape().area); log('rectangle1', new Rectangle(2, 3).area)` in 'index.js'.","project":"esmodule"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class Circle (file 'modules/Circle.js') inherits from Shape. Circle constructor params: 'radius' (number). Circle computes area using 'PI' imported from 'modules/math.js'. Call `log('circle1', new Circle(1).area); log('circle2', new Circle(2).area);` in 'index.js'.","project":"esmodule"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Set a global variable 'UNIT' to the value 'celsius' in 'modules/math.js'. 'UNIT' can not be exported from 'modules/math.js'. Call `log('global1', UNIT)` in 'index.js'.","project":"esmodule"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Export variable 'langs' (value ['en','zh','fr']) from 'modules/lang.js'. Export function 'getLangs' from 'modules/log.js'. 'getLangs' use 'dynamic import' to import langs from 'modules/lang.js'. Call `log('langs', (await getLangs()).join(','))` in 'index.js'.","project":"esmodule"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Move 'modules/log.js', 'modules/math.js', 'modules/lang.js' to 'modules/util/' path, modify references in other files.","project":"esmodule"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Move 'modules/Shape.js', 'modules/Circle.js', 'modules/Rectangle.js' to 'modules/shape/' path, modify references in other files.","project":"esmodule"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Write content `{\"version\":1}` to file 'modules/resource/config.json' imported as an object 'config' in 'index.js'. Call `log('config', JSON.stringify(config))` in 'index.js'.","project":"esmodule"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Write content `.log{font-weight: bold;}` to file 'modules/resource/style.css' imported as an object 'style' in 'index.js'. Call `log('style', style.cssRules[0].selectorText)` in 'index.js'.","project":"esmodule"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Export all classes of 'modules/shape/' path from 'modules/shape/index.js' imported in 'index.js'. Remove all other imports of Shape class and child-classes from 'index.js'.","project":"esmodule"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Use nodejs builtin modules to write file content `export const config = {lang: 'en'}` to es-module 'nodejs/test-config.js' (at the same dir as 'nodejs/index.js'). Save codes to es-module 'nodejs/index.js'.","project":"esmodule"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Export variable 'lang' from 'nodejs/index.js'. Set 'lang' value to `config.lang` which is dynamic imported from 'nodejs/test-config.js'.","project":"esmodule"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Export variable 'cjs' (value true) from common-js 'nodejs/cjs.cjs'. Export from 'nodejs/index.js' with a variable 'cjs' whose value is set to `cjs` dynamically imported from 'nodejs/cjs.cjs'.","project":"esmodule"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Set importmap in 'index.html' with value `{\"imports\": {\"shape\": \"./modules/shape/index.js\"}}`. Import Shape (alias Shape2) from 'shape' and call `log('shape2', new Shape2().area)` in 'index.js'.","project":"esmodule"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add new map rule ('shape/' to './modules/shape/') in the importmap. Import Shape (alias Shape3) from 'shape/Shape.js' and Call `log('shape3', new Shape3().area)` in 'index.js'.","project":"esmodule"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Write content `{\"version\":1}` to file 'modules/nodejs/data.json' which is exported as an object 'data' in 'modules/nodejs/index.js'.","project":"esmodule"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Export inline json data `{\"inline\":true}` as an object 'inlineData' by data URL in 'modules/nodejs/index.js'.","project":"esmodule"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Write content `{\"zh\":1}` to 'modules/data/zh.json', `{\"en\":1}` to 'modules/data/en.json', `{\"fr\":1}` to 'modules/data/fr.json'. Dynamically import all the modules under 'modules/data/', merge all the data to an object 'data' and call `log('data', JSON.stringify(data))` in 'index.js'.","project":"esmodule"} \ No newline at end of file diff --git a/datasets/expression-editor.jsonl b/datasets/expression-editor.jsonl index dbe55bc67b1e8fc659dcf2bf63a0d37d1b209efa..6fd88a36f463c6a8d4a34475e28f7b4425facc9d 100644 --- a/datasets/expression-editor.jsonl +++ b/datasets/expression-editor.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add a contenteditable editor in this page.\nSet font-family to `Menlo, Monaco, \"Courier New\", monospace` for it.\nAdd an `id` attribute with the value `editor` to the editor element to facilitate element lookup later.\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"The min height of the editor is 100px, and with 10px padding.\nThe final visible height of the element remains at 100px, with the padding and any border thickness included within this measurement, rather than adding extra height.\nThe editor height should always fit its content whenever user types.\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Add a toolbar above the editor.\nOn the right side of the toolbar, there is a button labeled \"Documentation\".\nUpon clicking the button, a popup appears with the title \"Document\" and the content \"WIP\".\nThis popup includes a close button labeled \"Close\", Clicking this close button will close the popup.\n"} -{"id":"task-4","date":"2025-05-12","level":"moderate","description":"On the right side of the toolbar, and before the `Documentation` button, add a new button labeled \"Uppercase\".\nWhen a user selects text in the editor and clicks the \"Uppercase\" button, the text should be converted to uppercase and then replaced with the uppercased one.\n"} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"On the right side of the toolbar, and before the `Documentation` button, add a new button labeled \"Insert Snippet\".\nUpon click the `Insert Snippet` button:\n- Ensure that the editor remains focused (meaning the cursor continues to blink within the editor) if it was initially focused.\n- The content \"true OR false\" will be inserted at the cursor's current position or replace the selected text in the editor. If the editor is not focused, insert the content at the end of the editor.\n- Considering that users may need to delete newly inserted text, the new text should be selected after insertion.\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Add parenthesis auto closing capability for the editor.\n- When a user types an opening parenthesis (, the editor should automatically insert a closing parenthesis ) immediately after the opening parenthesis.\n- After inserting the closing parenthesis, programmatically set the cursor position to be between the opening and closing parentheses, ensuring that the user can continue typing without needing to manually adjust the cursor.\n"} -{"id":"task-7","date":"2025-05-12","level":"challenging","description":"# Target\nUse JavaScript to implement a `tokenize` function in `parser.js` and export `tokenize` with ESM named export.\n\nCAUTION: I want the file to be implemented with JavaScript but NOT TypeScript, and the filename should be `parser.js`.\n\n# Technical Design Document\nTo complete the target, let's dig it deeper.\n\n## `tokenize` function implemention detail\n\n`tokenize` receive a `string` as input, and return `Token[]` as output.\n\n### Constraints\n\nIgnore all tab、whitespaces、newlines\n\n### Token Types\n\nI'll give you the TypeScript type definitions for your convenience.\n\n```ts\ntype Token = Identifier | Operator | LeftParen | RightParen\n\ntype Identifier = {\n type: 'identifier';\n from: number;\n to: number;\n value: string;\n}\n\ntype Operator = {\n type: 'operator';\n from: number;\n to: number;\n value: 'AND' | 'OR';\n}\n\ntype LeftParen = {\n type: 'lparen';\n from: number;\n to: number;\n}\n\ntype RightParen = {\n type: 'rparen';\n from: number;\n to: number;\n}\n```\n\n### Examples\nBesides these, here are some examples for you to better understand the tokenize result.\n\n \n ```js\n []\n ```\n \n\n \n ```js\n [\n {\n type: 'identifier',\n from: 0,\n to: 3,\n value: 'foo'\n }\n ]\n ```\n \n\n \n ```js\n [\n {\n type: 'identifier',\n from: 0,\n to: 3,\n value: 'foo'\n },\n {\n type: 'operator',\n from: 4,\n to: 7,\n value: 'AND'\n },\n {\n type: 'identifier',\n from: 8,\n to: 11,\n value: 'bar'\n }\n ]\n ```\n \n\n \n ```js\n [\n {\n type: 'identifier',\n from: 0,\n to: 3,\n value: 'foo'\n },\n {\n type: 'operator',\n from: 4,\n to: 6,\n value: 'OR'\n },\n {\n type: 'lparen',\n from: 7,\n to: 8,\n },\n {\n type: 'identifier',\n from: 8,\n to: 11,\n value: 'bar'\n },\n {\n type: 'operator',\n from: 12,\n to: 14,\n value: 'OR'\n },\n {\n type: 'identifier',\n from: 15,\n to: 18,\n value: 'baz'\n },\n {\n type: 'rparen',\n from: 18,\n to: 19,\n },\n ]\n ```\n \n\n"} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"# Target\nUse JavaScript to implement a `parse` function in `parser.js` and export `parse` with ESM named export.\nYou should implement `parse` based on existing `tokenize` function.\n\nCAUTION: I want the file to be implemented with JavaScript but NOT TypeScript, and the filename should be `parser.js`.\n\n# Technical Design Document\nTo complete the target, let's dig it deeper.\n\n## `parse` function implemention detail\n\n`parse` receive a `string` as input, and return `Program` as output.\n\n### Constraints\n\n#### Syntax Rules\n- Identifier: A string composed of letters (a-z, A-Z), digits (0-9), and underscores, but it cannot start with a digit.\n- LogicalExpression: Includes AND and OR. These operators are used to connect expressions and must be in uppercase.\n- Parentheses: Used to change the order of operations or to group expressions, including left parenthesis ( and right parenthesis ).\n\n#### Precedence and Associativity\n- The AND and OR operators are left-associative, meaning they are evaluated from left to right in the absence of parentheses.\n- The precedence of the AND operator is higher than that of OR.\n\n### Node Types\n\nI'll give you the TypeScript type definitions for your convenience.\n\n```ts\ntype Program = {\n type: 'Program';\n children: SyntaxNode[];\n}\n\ntype Identifier = {\n type: 'Identifier';\n name: string;\n}\n\ntype LogicalExpression = {\n type: 'LogicalExpression';\n operator: 'AND' | 'OR';\n left: SyntaxNode;\n right: SyntaxNode;\n}\n\ntype SyntaxNode = Identifier | LogicalExpression\n```\n\n### Examples\n\nBesides these, here are some examples for you to better understand the AST structure.\n\n\n \n ```js\n {\n type: 'Program',\n body: []\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'Identifier',\n name: 'foo'\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'AND',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'Identifier',\n name: 'bar'\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'LogicalExpression',\n operator: 'AND',\n left: {\n type: 'Identifier',\n name: 'bar'\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'Identifier',\n name: 'bar'\n }\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'bar'\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'bar'\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n }\n ]\n }\n ```\n \n\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add range field for every Node in AST. The type of range is Range\n\n```ts\ninterface Range {\n from: number;\n to: number;\n}\n```\n"} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Implement syntax highlighting in the editor, and avoid disrupting the original cursor position while the user is typing.\n\nThe syntax rules can be found in `parser.js`. Use `tokenize` result to highlight editor content.\n\nHere are the syntax highlight styles requirements:\n- identifier: text color is #0000ff\n- operator: text color is #00ff00\n"} -{"id":"task-11","date":"2025-05-12","level":"moderate","description":"# Background\nNow let's implement the lint capability for the editor\n\n# Target\n\n1. Refactor `parse` in parser.js\n - `parse` should be case-insensitive when encounters operator(e.g. AND, and, And are both valid operators), and should return a Syntax Tree without throwing errors.\n - add operatorRange field for LogicalExpression AST node to save the operator range, type of operatorRange is { from: number; to: number }\n - add `source` field for Program AST node, tracking the original source code.\n2. Implement a function named `lint`, and export it in `lint.js` with ESM.\n\n# Constraints\n\nDO NOT modify files other than `parser.js` and `lint.js`.\n\n# Detail of `lint`\n\n`lint` receives Program(return type of `parse`) as input, returns Diagnostic[] as output.\n\nType definition of Program is\n\n```ts\ninterface Range {\n from: number;\n to: number;\n}\n\ntype Program = {\n type: 'Program';\n source: string;\n children: SyntaxNode[];\n range: Range;\n}\n\ntype Identifier = {\n type: 'Identifier';\n name: string;\n range: Range;\n}\n\ntype LogicalExpression = {\n type: 'LogicalExpression';\n operator: string;\n operatorRange: Range;\n left: SyntaxNode;\n right: SyntaxNode;\n range: Range;\n}\n\ntype SyntaxNode = Identifier | LogicalExpression\n```\n\nType definition of Diagnostic is\n\n```ts\ntype Diagnostic = {\n range: {\n from: number;\n to: number;\n };\n level: 'error' | 'warning';\n message: string;\n}\n```\n\n## Lint Rules\n\n\n \n\n\n## Examples\n\n\n \n foo AND bar\n \n []\n \n \n\n \n foo and bar or baz\n \n [\n {\n range: {\n from: 4,\n to: 7,\n },\n level: 'error',\n message: 'Operator should be uppercase. Use AND instead of and.'\n },\n {\n range: {\n from: 12,\n to: 14,\n },\n level: 'error',\n message: 'Operator should be uppercase. Use OR instead of or.'\n }\n ]\n \n \n\n"} -{"id":"task-12","date":"2025-05-12","level":"moderate","description":"Add bottom border(with border color of #ff0000) for ranges with errors(from lint in `lint.js`) in editor.\nAdd class \"diagnostic-error\" for the wrapper element of error range.\n"} -{"id":"task-13","date":"2025-05-12","level":"easy","description":"Add `data-diagnostic-message` attribute for the wrapper element of error range showing the error message.\n"} -{"id":"task-14","date":"2025-05-12","level":"easy","description":"Show diagnostic message in tooltip when user hover on any diagnostic in editor.\n"} -{"id":"task-15","date":"2025-05-12","level":"moderate","description":"Refactor `parse` in `parser.js`, throw SyntaxError if input doesn't conform to the syntax rules.\n\nIf user input doesn't conform to the current syntax rules, display an error message showing \"Syntax Error\" below the editor element.\n\nSyntax error validation should be real-time as the user types.\n\nThe element showing \"Syntax Error\" has a red background.\n"} -{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Implement an `evaluate` function in `evaluate.js`, and export `evaluate` with ESM named export.\n\n# Details\n- When encounters some error during evaluating, return null.\n- When operator is not uppercase, return null.\n- Hard-code the builtin variables when doing evaluating. Available builtin variables:\n - foo: true\n - fooooo: false\n - bar: true\n - barrrr: false\n- Nonexistent variables should be considered as `false` when doing evaluating.\n\n# Examples\n\n\n \n \n false\n \n\n \n foo\n true\n \n\n \n foo a\n null\n \n\n \n foo AND\n null\n \n\n \n foo and bar\n null\n \n\n \n foo AND bar\n true\n \n\n \n x AND bar\n false\n \n\n \n foo AND barrrr\n false\n \n\n \n foo OR barrrr\n true\n \n\n"} -{"id":"task-17","date":"2025-05-12","level":"easy","description":"On the left side of the toolbar, add a new button labeled \"Run\".\nUpon clicking the \"Run\" button, use editor content as input for `evaluate` function in `evaluate.js`, and display the evaluate result below the editor.\n- If the evaluate result is null, display \"null\".\n- If the evaluate result is true, display \"true\".\n- If the evaluate result is false, display \"false\".\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Add autocompletion for the editor.\n\n# Details\n\n- Support auto complete builtin variables and operators.\n - builtin variables: foo, fooooo, bar, barrrr\n - operators: AND, OR\n- Use prefix match to search.\n- User can click on completion item to insert the completion item\n - Remove the common prefix already in the editor to avoid duplicate text after inserting\n- Syntax highlighting still works after inserting completion\n\nHere are some examples:\n- When user input f, suggest `foo` and `fooooo`\n- When user input fo, suggest `foo` and `fooooo`\n- When user input foa, no suggestion\n- When user input a, suggest AND\n- When user input aN, suggest AND\n- When user input aNb, no suggestion\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add keyboard support for completion navigation and inserting.\n\nThe goal of this feature is to enable users to:\n\n- Navigate through this list using the up and down arrow keys.\n- Insert the highlighted completion into the editor using the Enter key.\n\n# Details\n- When completion popover appears, select first item by default\n- Selected completion item should have a different background color from unselected one.\n- Loop from the last item back to the first (and vice versa) when navigating beyond the end (or beginning) of the list.\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add undo/redo ability to the editor.\n\nThe undo shortcut is\n- Command+z on Mac\n- Control+z on Windows\n\nThe redo shortcut is\n- Command+y on Mac\n- Control+y on Windows\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add a contenteditable editor in this page.\nSet font-family to `Menlo, Monaco, \"Courier New\", monospace` for it.\nAdd an `id` attribute with the value `editor` to the editor element to facilitate element lookup later.\n","project":"expression-editor"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"The min height of the editor is 100px, and with 10px padding.\nThe final visible height of the element remains at 100px, with the padding and any border thickness included within this measurement, rather than adding extra height.\nThe editor height should always fit its content whenever user types.\n","project":"expression-editor"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Add a toolbar above the editor.\nOn the right side of the toolbar, there is a button labeled \"Documentation\".\nUpon clicking the button, a popup appears with the title \"Document\" and the content \"WIP\".\nThis popup includes a close button labeled \"Close\", Clicking this close button will close the popup.\n","project":"expression-editor"} +{"id":"task-4","date":"2025-05-12","level":"moderate","description":"On the right side of the toolbar, and before the `Documentation` button, add a new button labeled \"Uppercase\".\nWhen a user selects text in the editor and clicks the \"Uppercase\" button, the text should be converted to uppercase and then replaced with the uppercased one.\n","project":"expression-editor"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"On the right side of the toolbar, and before the `Documentation` button, add a new button labeled \"Insert Snippet\".\nUpon click the `Insert Snippet` button:\n- Ensure that the editor remains focused (meaning the cursor continues to blink within the editor) if it was initially focused.\n- The content \"true OR false\" will be inserted at the cursor's current position or replace the selected text in the editor. If the editor is not focused, insert the content at the end of the editor.\n- Considering that users may need to delete newly inserted text, the new text should be selected after insertion.\n","project":"expression-editor"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Add parenthesis auto closing capability for the editor.\n- When a user types an opening parenthesis (, the editor should automatically insert a closing parenthesis ) immediately after the opening parenthesis.\n- After inserting the closing parenthesis, programmatically set the cursor position to be between the opening and closing parentheses, ensuring that the user can continue typing without needing to manually adjust the cursor.\n","project":"expression-editor"} +{"id":"task-7","date":"2025-05-12","level":"challenging","description":"# Target\nUse JavaScript to implement a `tokenize` function in `parser.js` and export `tokenize` with ESM named export.\n\nCAUTION: I want the file to be implemented with JavaScript but NOT TypeScript, and the filename should be `parser.js`.\n\n# Technical Design Document\nTo complete the target, let's dig it deeper.\n\n## `tokenize` function implemention detail\n\n`tokenize` receive a `string` as input, and return `Token[]` as output.\n\n### Constraints\n\nIgnore all tab、whitespaces、newlines\n\n### Token Types\n\nI'll give you the TypeScript type definitions for your convenience.\n\n```ts\ntype Token = Identifier | Operator | LeftParen | RightParen\n\ntype Identifier = {\n type: 'identifier';\n from: number;\n to: number;\n value: string;\n}\n\ntype Operator = {\n type: 'operator';\n from: number;\n to: number;\n value: 'AND' | 'OR';\n}\n\ntype LeftParen = {\n type: 'lparen';\n from: number;\n to: number;\n}\n\ntype RightParen = {\n type: 'rparen';\n from: number;\n to: number;\n}\n```\n\n### Examples\nBesides these, here are some examples for you to better understand the tokenize result.\n\n \n ```js\n []\n ```\n \n\n \n ```js\n [\n {\n type: 'identifier',\n from: 0,\n to: 3,\n value: 'foo'\n }\n ]\n ```\n \n\n \n ```js\n [\n {\n type: 'identifier',\n from: 0,\n to: 3,\n value: 'foo'\n },\n {\n type: 'operator',\n from: 4,\n to: 7,\n value: 'AND'\n },\n {\n type: 'identifier',\n from: 8,\n to: 11,\n value: 'bar'\n }\n ]\n ```\n \n\n \n ```js\n [\n {\n type: 'identifier',\n from: 0,\n to: 3,\n value: 'foo'\n },\n {\n type: 'operator',\n from: 4,\n to: 6,\n value: 'OR'\n },\n {\n type: 'lparen',\n from: 7,\n to: 8,\n },\n {\n type: 'identifier',\n from: 8,\n to: 11,\n value: 'bar'\n },\n {\n type: 'operator',\n from: 12,\n to: 14,\n value: 'OR'\n },\n {\n type: 'identifier',\n from: 15,\n to: 18,\n value: 'baz'\n },\n {\n type: 'rparen',\n from: 18,\n to: 19,\n },\n ]\n ```\n \n\n","project":"expression-editor"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"# Target\nUse JavaScript to implement a `parse` function in `parser.js` and export `parse` with ESM named export.\nYou should implement `parse` based on existing `tokenize` function.\n\nCAUTION: I want the file to be implemented with JavaScript but NOT TypeScript, and the filename should be `parser.js`.\n\n# Technical Design Document\nTo complete the target, let's dig it deeper.\n\n## `parse` function implemention detail\n\n`parse` receive a `string` as input, and return `Program` as output.\n\n### Constraints\n\n#### Syntax Rules\n- Identifier: A string composed of letters (a-z, A-Z), digits (0-9), and underscores, but it cannot start with a digit.\n- LogicalExpression: Includes AND and OR. These operators are used to connect expressions and must be in uppercase.\n- Parentheses: Used to change the order of operations or to group expressions, including left parenthesis ( and right parenthesis ).\n\n#### Precedence and Associativity\n- The AND and OR operators are left-associative, meaning they are evaluated from left to right in the absence of parentheses.\n- The precedence of the AND operator is higher than that of OR.\n\n### Node Types\n\nI'll give you the TypeScript type definitions for your convenience.\n\n```ts\ntype Program = {\n type: 'Program';\n children: SyntaxNode[];\n}\n\ntype Identifier = {\n type: 'Identifier';\n name: string;\n}\n\ntype LogicalExpression = {\n type: 'LogicalExpression';\n operator: 'AND' | 'OR';\n left: SyntaxNode;\n right: SyntaxNode;\n}\n\ntype SyntaxNode = Identifier | LogicalExpression\n```\n\n### Examples\n\nBesides these, here are some examples for you to better understand the AST structure.\n\n\n \n ```js\n {\n type: 'Program',\n body: []\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'Identifier',\n name: 'foo'\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'AND',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'Identifier',\n name: 'bar'\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'LogicalExpression',\n operator: 'AND',\n left: {\n type: 'Identifier',\n name: 'bar'\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'Identifier',\n name: 'bar'\n }\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'bar'\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n }\n ]\n }\n ```\n \n\n \n ```js\n {\n type: 'Program',\n body: [\n {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'foo'\n },\n right: {\n type: 'LogicalExpression',\n operator: 'OR',\n left: {\n type: 'Identifier',\n name: 'bar'\n },\n right: {\n type: 'Identifier',\n name: 'baz'\n }\n }\n }\n ]\n }\n ```\n \n\n","project":"expression-editor"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add range field for every Node in AST. The type of range is Range\n\n```ts\ninterface Range {\n from: number;\n to: number;\n}\n```\n","project":"expression-editor"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Implement syntax highlighting in the editor, and avoid disrupting the original cursor position while the user is typing.\n\nThe syntax rules can be found in `parser.js`. Use `tokenize` result to highlight editor content.\n\nHere are the syntax highlight styles requirements:\n- identifier: text color is #0000ff\n- operator: text color is #00ff00\n","project":"expression-editor"} +{"id":"task-11","date":"2025-05-12","level":"moderate","description":"# Background\nNow let's implement the lint capability for the editor\n\n# Target\n\n1. Refactor `parse` in parser.js\n - `parse` should be case-insensitive when encounters operator(e.g. AND, and, And are both valid operators), and should return a Syntax Tree without throwing errors.\n - add operatorRange field for LogicalExpression AST node to save the operator range, type of operatorRange is { from: number; to: number }\n - add `source` field for Program AST node, tracking the original source code.\n2. Implement a function named `lint`, and export it in `lint.js` with ESM.\n\n# Constraints\n\nDO NOT modify files other than `parser.js` and `lint.js`.\n\n# Detail of `lint`\n\n`lint` receives Program(return type of `parse`) as input, returns Diagnostic[] as output.\n\nType definition of Program is\n\n```ts\ninterface Range {\n from: number;\n to: number;\n}\n\ntype Program = {\n type: 'Program';\n source: string;\n children: SyntaxNode[];\n range: Range;\n}\n\ntype Identifier = {\n type: 'Identifier';\n name: string;\n range: Range;\n}\n\ntype LogicalExpression = {\n type: 'LogicalExpression';\n operator: string;\n operatorRange: Range;\n left: SyntaxNode;\n right: SyntaxNode;\n range: Range;\n}\n\ntype SyntaxNode = Identifier | LogicalExpression\n```\n\nType definition of Diagnostic is\n\n```ts\ntype Diagnostic = {\n range: {\n from: number;\n to: number;\n };\n level: 'error' | 'warning';\n message: string;\n}\n```\n\n## Lint Rules\n\n\n \n\n\n## Examples\n\n\n \n foo AND bar\n \n []\n \n \n\n \n foo and bar or baz\n \n [\n {\n range: {\n from: 4,\n to: 7,\n },\n level: 'error',\n message: 'Operator should be uppercase. Use AND instead of and.'\n },\n {\n range: {\n from: 12,\n to: 14,\n },\n level: 'error',\n message: 'Operator should be uppercase. Use OR instead of or.'\n }\n ]\n \n \n\n","project":"expression-editor"} +{"id":"task-12","date":"2025-05-12","level":"moderate","description":"Add bottom border(with border color of #ff0000) for ranges with errors(from lint in `lint.js`) in editor.\nAdd class \"diagnostic-error\" for the wrapper element of error range.\n","project":"expression-editor"} +{"id":"task-13","date":"2025-05-12","level":"easy","description":"Add `data-diagnostic-message` attribute for the wrapper element of error range showing the error message.\n","project":"expression-editor"} +{"id":"task-14","date":"2025-05-12","level":"easy","description":"Show diagnostic message in tooltip when user hover on any diagnostic in editor.\n","project":"expression-editor"} +{"id":"task-15","date":"2025-05-12","level":"moderate","description":"Refactor `parse` in `parser.js`, throw SyntaxError if input doesn't conform to the syntax rules.\n\nIf user input doesn't conform to the current syntax rules, display an error message showing \"Syntax Error\" below the editor element.\n\nSyntax error validation should be real-time as the user types.\n\nThe element showing \"Syntax Error\" has a red background.\n","project":"expression-editor"} +{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Implement an `evaluate` function in `evaluate.js`, and export `evaluate` with ESM named export.\n\n# Details\n- When encounters some error during evaluating, return null.\n- When operator is not uppercase, return null.\n- Hard-code the builtin variables when doing evaluating. Available builtin variables:\n - foo: true\n - fooooo: false\n - bar: true\n - barrrr: false\n- Nonexistent variables should be considered as `false` when doing evaluating.\n\n# Examples\n\n\n \n \n false\n \n\n \n foo\n true\n \n\n \n foo a\n null\n \n\n \n foo AND\n null\n \n\n \n foo and bar\n null\n \n\n \n foo AND bar\n true\n \n\n \n x AND bar\n false\n \n\n \n foo AND barrrr\n false\n \n\n \n foo OR barrrr\n true\n \n\n","project":"expression-editor"} +{"id":"task-17","date":"2025-05-12","level":"easy","description":"On the left side of the toolbar, add a new button labeled \"Run\".\nUpon clicking the \"Run\" button, use editor content as input for `evaluate` function in `evaluate.js`, and display the evaluate result below the editor.\n- If the evaluate result is null, display \"null\".\n- If the evaluate result is true, display \"true\".\n- If the evaluate result is false, display \"false\".\n","project":"expression-editor"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Add autocompletion for the editor.\n\n# Details\n\n- Support auto complete builtin variables and operators.\n - builtin variables: foo, fooooo, bar, barrrr\n - operators: AND, OR\n- Use prefix match to search.\n- User can click on completion item to insert the completion item\n - Remove the common prefix already in the editor to avoid duplicate text after inserting\n- Syntax highlighting still works after inserting completion\n\nHere are some examples:\n- When user input f, suggest `foo` and `fooooo`\n- When user input fo, suggest `foo` and `fooooo`\n- When user input foa, no suggestion\n- When user input a, suggest AND\n- When user input aN, suggest AND\n- When user input aNb, no suggestion\n","project":"expression-editor"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add keyboard support for completion navigation and inserting.\n\nThe goal of this feature is to enable users to:\n\n- Navigate through this list using the up and down arrow keys.\n- Insert the highlighted completion into the editor using the Enter key.\n\n# Details\n- When completion popover appears, select first item by default\n- Selected completion item should have a different background color from unselected one.\n- Loop from the last item back to the first (and vice versa) when navigating beyond the end (or beginning) of the list.\n","project":"expression-editor"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add undo/redo ability to the editor.\n\nThe undo shortcut is\n- Command+z on Mac\n- Control+z on Windows\n\nThe redo shortcut is\n- Command+y on Mac\n- Control+y on Windows\n","project":"expression-editor"} \ No newline at end of file diff --git a/datasets/expressjs.jsonl b/datasets/expressjs.jsonl index f4ff911ee6d54f7e20152663cb548677b90fcb86..c09ef8456a50ac00d22d920496e1a0b1977bb1f5 100644 --- a/datasets/expressjs.jsonl +++ b/datasets/expressjs.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (views/home.pug) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (views/login.pug) at route '/login' showing '💡 Please Login First' in h1 tag 3) use pug template engine to render pages"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'. 2) Add className 'site-header' to header and 'site-footer' to footer. 3) Create views/layout.pug to implement this feature. 4) header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space. 5) create public/css/style.css file to beautify CSS."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag. add button(.not-found-go-to-home) to navigate to '/' 2) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/' 3) create css to beautify UI."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.js to export a new sqlite3.Database(process.env.DB_HOST) by node-sqlite3. 2) add libs/setup.sql to create tables for products (id, name, price, image, description, quantity). 3) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 4) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully. 5) all apis generated in this tasks should be placed in routes/products/api.js and used by app entry(index.js) as Express Router"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css to beautify UI."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css to beautify UI. 5) If the product is not found, show 'Product Not Found' in the product detail page."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) In libs/setup.sql, Create User Table , setup User Table with two initial users: 1. username: admin, password: 123456, role: admin, coin: 0 2. username: user, password: 123456, role: user, coin: 1000; 2) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 3) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side 4) create css to beautify UI."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) The initial coin for new user is 1000 7) create CSS file to beautify CSS."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create css to beautify UI. DO NOT use a third-party UI library."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in public/components/HeaderUserMenu.js: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username). 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Ensure that this component is displayed on the right side of the site header. 4) Create CSS to beautify UI. DO NOT use a third-party UI library."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create css to beautify UI. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create css to beautify UI."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In public/components/Cart.js, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create css to beautify UI. Constraint: DO NOT use a third-party UI library."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.js; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (views/home.pug) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (views/login.pug) at route '/login' showing '💡 Please Login First' in h1 tag 3) use pug template engine to render pages","project":"expressjs"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'. 2) Add className 'site-header' to header and 'site-footer' to footer. 3) Create views/layout.pug to implement this feature. 4) header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space. 5) create public/css/style.css file to beautify CSS.","project":"expressjs"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag. add button(.not-found-go-to-home) to navigate to '/' 2) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/' 3) create css to beautify UI.","project":"expressjs"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.js to export a new sqlite3.Database(process.env.DB_HOST) by node-sqlite3. 2) add libs/setup.sql to create tables for products (id, name, price, image, description, quantity). 3) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 4) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully. 5) all apis generated in this tasks should be placed in routes/products/api.js and used by app entry(index.js) as Express Router","project":"expressjs"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css to beautify UI.","project":"expressjs"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css to beautify UI. 5) If the product is not found, show 'Product Not Found' in the product detail page.","project":"expressjs"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) In libs/setup.sql, Create User Table , setup User Table with two initial users: 1. username: admin, password: 123456, role: admin, coin: 0 2. username: user, password: 123456, role: user, coin: 1000; 2) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 3) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour.","project":"expressjs"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side 4) create css to beautify UI.","project":"expressjs"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) The initial coin for new user is 1000 7) create CSS file to beautify CSS.","project":"expressjs"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create css to beautify UI. DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in public/components/HeaderUserMenu.js: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username). 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Ensure that this component is displayed on the right side of the site header. 4) Create CSS to beautify UI. DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create css to beautify UI. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC.","project":"expressjs"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create css to beautify UI.","project":"expressjs"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In public/components/Cart.js, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create css to beautify UI. Constraint: DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.js; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"expressjs"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library.","project":"expressjs"} \ No newline at end of file diff --git a/datasets/fastify-react.jsonl b/datasets/fastify-react.jsonl index 8d0ee7cb5540309ac0c80772b6fd6788cd669540..7e4a52814c4a0749da7290acd75ff4b2e72cafba 100644 --- a/datasets/fastify-react.jsonl +++ b/datasets/fastify-react.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create home page (client/pages/home.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) Create login page (client/pages/login.tsx) at route '/login' showing '💡 Please Login First' in h1 tag\n3) Use React Router (v7.5.0) to render pages (configure in client/routes.tsx)\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'\n2) Add class 'site-header' to header and 'site-footer' to footer\n3) Create client/root.tsx to implement this feature\n4) Header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space\n5) Create client/root.css file to beautify CSS\n6) Hint: RootLayout can be configured by React Router v7.5.0 in client/routes.tsx\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag\n2) Add button(.not-found-go-to-home) to navigate to '/'\n3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/'\n4) Create CSS to beautify UI\n5) Hint: Use '*' Route to handle 404 errors by React Router v7.5.0\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3\n2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity)\n3) Create route POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n5) Create route GET /api/products to fetch all products\n6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n7) Create Fastify Product Plugin in plugins/product.ts to register these apis\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price), use React Router v7.5.0 to add this route\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) Add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) Create CSS to beautify UI\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI in Detail Page: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /products page, When .product-card clicked, goto related product detail page\n4) Create CSS to beautify UI\n5) If the product is not found, show 'Product Not Found' in the product detail page\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) In libs/setup.sql, Create User Table, setup User Table with two initial users:\n - username: admin, password: 123456, role: admin, coin: 0\n - username: user, password: 123456, role: user, coin: 1000\n2) Create route POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true }\n3) Create route GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status\n4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n5) Use '@fastify/cookie' plugin to manage cookies\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) Add client/context/auth.tsx to share current authenticated user information in context\n4) Create CSS to beautify UI\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) The initial coin for new user is 1000\n7) Create CSS file to beautify CSS\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS to beautify UI\n6) DO NOT use a third-party UI library\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a client-side component in client/components/HeaderUserMenu.tsx:\n - If not logged in, display a button (.header-go-login) that navigates to /login\n - If logged in, display the username (.header-username)\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - A button (.header-logout-btn) for logging out\n - A button (.header-go-user-profile) for navigating to the current user's profile page\n3) Ensure that this component is displayed on the right side of the site header\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) Button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, redirect to /login if no privilege using a Fastify hook or preHandler\n6) Create CSS to beautify UI\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) Structure wishlist items as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In client/components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) In the Detail Page, add an .add-to-cart-button\n5) When clicked, add this product to the cart\n6) Store Cart Info in the DB for the current User\n7) Place Shopping Cart which can be seen in every page in the right-bottom of page\n8) Create CSS to beautify UI\n9) DO NOT use a third-party UI library\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.ts, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - The status of the order becomes 'Finished'\n - The Coin is paid from current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n7) Implement database transaction to ensure data integrity\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - Update the order status to 'Refund Passed'\n - Ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - The username\n - The rating\n - The comment text\n6) Style using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating (with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party UI library\n7) Implement database transaction to ensure data integrity when processing referral rewards\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create home page (client/pages/home.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) Create login page (client/pages/login.tsx) at route '/login' showing '💡 Please Login First' in h1 tag\n3) Use React Router (v7.5.0) to render pages (configure in client/routes.tsx)\n","project":"fastify-react"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'\n2) Add class 'site-header' to header and 'site-footer' to footer\n3) Create client/root.tsx to implement this feature\n4) Header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space\n5) Create client/root.css file to beautify CSS\n6) Hint: RootLayout can be configured by React Router v7.5.0 in client/routes.tsx\n","project":"fastify-react"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag\n2) Add button(.not-found-go-to-home) to navigate to '/'\n3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/'\n4) Create CSS to beautify UI\n5) Hint: Use '*' Route to handle 404 errors by React Router v7.5.0\n","project":"fastify-react"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3\n2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity)\n3) Create route POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n5) Create route GET /api/products to fetch all products\n6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n7) Create Fastify Product Plugin in plugins/product.ts to register these apis\n","project":"fastify-react"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price), use React Router v7.5.0 to add this route\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) Add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) Create CSS to beautify UI\n","project":"fastify-react"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI in Detail Page: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /products page, When .product-card clicked, goto related product detail page\n4) Create CSS to beautify UI\n5) If the product is not found, show 'Product Not Found' in the product detail page\n","project":"fastify-react"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) In libs/setup.sql, Create User Table, setup User Table with two initial users:\n - username: admin, password: 123456, role: admin, coin: 0\n - username: user, password: 123456, role: user, coin: 1000\n2) Create route POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true }\n3) Create route GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status\n4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n5) Use '@fastify/cookie' plugin to manage cookies\n","project":"fastify-react"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) Add client/context/auth.tsx to share current authenticated user information in context\n4) Create CSS to beautify UI\n","project":"fastify-react"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) The initial coin for new user is 1000\n7) Create CSS file to beautify CSS\n","project":"fastify-react"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS to beautify UI\n6) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a client-side component in client/components/HeaderUserMenu.tsx:\n - If not logged in, display a button (.header-go-login) that navigates to /login\n - If logged in, display the username (.header-username)\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - A button (.header-logout-btn) for logging out\n - A button (.header-go-user-profile) for navigating to the current user's profile page\n3) Ensure that this component is displayed on the right side of the site header\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) Button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, redirect to /login if no privilege using a Fastify hook or preHandler\n6) Create CSS to beautify UI\n","project":"fastify-react"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) Structure wishlist items as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In client/components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) In the Detail Page, add an .add-to-cart-button\n5) When clicked, add this product to the cart\n6) Store Cart Info in the DB for the current User\n7) Place Shopping Cart which can be seen in every page in the right-bottom of page\n8) Create CSS to beautify UI\n9) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.ts, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - The status of the order becomes 'Finished'\n - The Coin is paid from current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n7) Implement database transaction to ensure data integrity\n","project":"fastify-react"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - Update the order status to 'Refund Passed'\n - Ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - The username\n - The rating\n - The comment text\n6) Style using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating (with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n","project":"fastify-react"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party UI library\n7) Implement database transaction to ensure data integrity when processing referral rewards\n","project":"fastify-react"} \ No newline at end of file diff --git a/datasets/fastify.jsonl b/datasets/fastify.jsonl index 8825ede2e1f836a648c91a078bfc3347c0b9d232..1522a21fb959e4c15d8bdfd202a0c36ffc001b14 100644 --- a/datasets/fastify.jsonl +++ b/datasets/fastify.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create home page (views/home.ejs) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) Create login page (views/login.ejs) at route '/login' showing '💡 Please Login First' in h1 tag\n3) Use ejs template engine with Fastify's point-of-view plugin to render pages\n4) Create Home Plugin in plugins/home.ts to render this pages\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'\n2) Add class 'site-header' to header and 'site-footer' to footer\n3) Create views/layout.ejs to implement this feature\n4) Header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space\n5) Create public/css/style.css file to beautify CSS\n6) Hint: Layout can be configured by @fastify/view plugin, and in layout.ejs, <%- body %> is the content of the page\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag\n2) Add button(.not-found-go-to-home) to navigate to '/'\n3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/'\n4) Create CSS to beautify UI\n5) Hint: Use Fastify's setNotFoundHandler to handle 404 errors\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3\n2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity)\n3) Create route POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n5) Create route GET /api/products to fetch all products\n6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n7) Create Product Plugin in plugins/product.ts to register these apis\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) Add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) Create CSS to beautify UI\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI in Detail Page: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /products page, When .product-card clicked, goto related product detail page\n4) Create CSS to beautify UI\n5) If the product is not found, show 'Product Not Found' in the product detail page\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) In libs/setup.sql, Create User Table, setup User Table with two initial users:\n - username: admin, password: 123456, role: admin, coin: 0\n - username: user, password: 123456, role: user, coin: 1000\n2) Create route POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true }\n3) Create route GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status\n4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n5) Use '@fastify/cookie' plugin to manage cookies\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side\n4) Create CSS to beautify UI\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) The initial coin for new user is 1000\n7) Create CSS file to beautify CSS\n8) Use Fastify's schema validation for request validation\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS to beautify UI\n6) DO NOT use a third-party UI library\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a client-side component in public/components/HeaderUserMenu.js:\n - If not logged in, display a button (.header-go-login) that navigates to /login\n - If logged in, display the username (.header-username)\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - A button (.header-logout-btn) for logging out\n - A button (.header-go-user-profile) for navigating to the current user's profile page\n3) Ensure that this component is displayed on the right side of the site header\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) Button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, redirect to /login if no privilege using a Fastify hook or preHandler\n6) Create CSS to beautify UI\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) Structure wishlist items as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In public/components/Cart.js, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) In the Detail Page, add an .add-to-cart-button\n5) When clicked, add this product to the cart\n6) Store Cart Info in the DB for the current User\n7) Place Shopping Cart which can be seen in every page in the right-bottom of page\n8) Create CSS to beautify UI\n9) DO NOT use a third-party UI library\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.ts, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - The status of the order becomes 'Finished'\n - The Coin is paid from current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n7) Implement database transaction to ensure data integrity\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - Update the order status to 'Refund Passed'\n - Ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - The username\n - The rating\n - The comment text\n6) Style using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating (with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party library\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create home page (views/home.ejs) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) Create login page (views/login.ejs) at route '/login' showing '💡 Please Login First' in h1 tag\n3) Use ejs template engine with Fastify's point-of-view plugin to render pages\n4) Create Home Plugin in plugins/home.ts to render this pages\n","project":"fastify"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'\n2) Add class 'site-header' to header and 'site-footer' to footer\n3) Create views/layout.ejs to implement this feature\n4) Header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space\n5) Create public/css/style.css file to beautify CSS\n6) Hint: Layout can be configured by @fastify/view plugin, and in layout.ejs, <%- body %> is the content of the page\n","project":"fastify"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag\n2) Add button(.not-found-go-to-home) to navigate to '/'\n3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/'\n4) Create CSS to beautify UI\n5) Hint: Use Fastify's setNotFoundHandler to handle 404 errors\n","project":"fastify"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3\n2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity)\n3) Create route POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n5) Create route GET /api/products to fetch all products\n6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n7) Create Product Plugin in plugins/product.ts to register these apis\n","project":"fastify"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) Add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) Create CSS to beautify UI\n","project":"fastify"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI in Detail Page: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /products page, When .product-card clicked, goto related product detail page\n4) Create CSS to beautify UI\n5) If the product is not found, show 'Product Not Found' in the product detail page\n","project":"fastify"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) In libs/setup.sql, Create User Table, setup User Table with two initial users:\n - username: admin, password: 123456, role: admin, coin: 0\n - username: user, password: 123456, role: user, coin: 1000\n2) Create route POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true }\n3) Create route GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status\n4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n5) Use '@fastify/cookie' plugin to manage cookies\n","project":"fastify"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side\n4) Create CSS to beautify UI\n","project":"fastify"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) The initial coin for new user is 1000\n7) Create CSS file to beautify CSS\n8) Use Fastify's schema validation for request validation\n","project":"fastify"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS to beautify UI\n6) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a client-side component in public/components/HeaderUserMenu.js:\n - If not logged in, display a button (.header-go-login) that navigates to /login\n - If logged in, display the username (.header-username)\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - A button (.header-logout-btn) for logging out\n - A button (.header-go-user-profile) for navigating to the current user's profile page\n3) Ensure that this component is displayed on the right side of the site header\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) Button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS to beautify UI\n5) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, redirect to /login if no privilege using a Fastify hook or preHandler\n6) Create CSS to beautify UI\n","project":"fastify"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) Structure wishlist items as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In public/components/Cart.js, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) In the Detail Page, add an .add-to-cart-button\n5) When clicked, add this product to the cart\n6) Store Cart Info in the DB for the current User\n7) Place Shopping Cart which can be seen in every page in the right-bottom of page\n8) Create CSS to beautify UI\n9) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.ts, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - The status of the order becomes 'Finished'\n - The Coin is paid from current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n7) Implement database transaction to ensure data integrity\n","project":"fastify"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - Update the order status to 'Refund Passed'\n - Ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - The username\n - The rating\n - The comment text\n6) Style using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating (with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n","project":"fastify"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party library\n","project":"fastify"} \ No newline at end of file diff --git a/datasets/flex.jsonl b/datasets/flex.jsonl index 3edc06e7dcbb893d40341721739106f1bd88b80b..57c4576a90ab58390e53b9005d1fab904ad41963 100644 --- a/datasets/flex.jsonl +++ b/datasets/flex.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'main') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header is always fixed at the top of '.root'; footer is always fixed at the bottom of '.root'; main occupies the remaining '.root' space. Use css flexbox only, NO css grid, float and position, NO js."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'content', 'rightbar') with arbitrary text in main(padding 0) to fill the whole space. leftbar(width 200px) is fixed at the left of main; rightbar(width 200px) is fixed at the right of main; content occupies the remaining main space. Use flexbox only."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. Use flexbox only too."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. Use flexbox only."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar should disappear when page width is equal to or less than 799px."} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 799px, menu items should have evenly spaced distribution in the whole header space and logo should disappear."} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, main should occupy full page width and rightbar should be at the bottom of main."} -{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar space to 20 rows and 2 columns. NO remaining space or overflow. page height is still 100vh. MUST use flexbox align-content, align-self, MUST NOT use css calc function."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"directly add 40 divs(class 'tag') in rightbar with 2 tags in each row; no other element between tags and rightbar; all tags fill whole rightbar width and height, NO remaining space and overflow. page height is still 100vh. Use flexbox only, no calc."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 cards per row in content."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap; price's minimum height is 1rem; image uses the remaining space."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change one css property to reverse the order of all cards."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'main') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header is always fixed at the top of '.root'; footer is always fixed at the bottom of '.root'; main occupies the remaining '.root' space. Use css flexbox only, NO css grid, float and position, NO js.","project":"flex"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'content', 'rightbar') with arbitrary text in main(padding 0) to fill the whole space. leftbar(width 200px) is fixed at the left of main; rightbar(width 200px) is fixed at the right of main; content occupies the remaining main space. Use flexbox only.","project":"flex"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. Use flexbox only too.","project":"flex"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. Use flexbox only.","project":"flex"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar should disappear when page width is equal to or less than 799px.","project":"flex"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 799px, menu items should have evenly spaced distribution in the whole header space and logo should disappear.","project":"flex"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, main should occupy full page width and rightbar should be at the bottom of main.","project":"flex"} +{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width.","project":"flex"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar space to 20 rows and 2 columns. NO remaining space or overflow. page height is still 100vh. MUST use flexbox align-content, align-self, MUST NOT use css calc function.","project":"flex"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"directly add 40 divs(class 'tag') in rightbar with 2 tags in each row; no other element between tags and rightbar; all tags fill whole rightbar width and height, NO remaining space and overflow. page height is still 100vh. Use flexbox only, no calc.","project":"flex"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar.","project":"flex"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled.","project":"flex"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content.","project":"flex"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 cards per row in content.","project":"flex"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap; price's minimum height is 1rem; image uses the remaining space.","project":"flex"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change one css property to reverse the order of all cards.","project":"flex"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient.","project":"flex"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content.","project":"flex"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width.","project":"flex"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height.","project":"flex"} \ No newline at end of file diff --git a/datasets/float.jsonl b/datasets/float.jsonl index ce076f4251cb75a72a7c59356719c0cf2d7139af..3e25a2d7528deaaf7b91633ff6b52eeb34a4f301 100644 --- a/datasets/float.jsonl +++ b/datasets/float.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE css float only, NO css flex, grid and position, NO js."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. USE css float only, NO css flex, grid and position, NO js."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. USE css float only, NO css flex, grid and position, NO js."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. USE css float only, NO css flex, grid and position, NO js."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px."} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear."} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content."} -{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE float only."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE float only."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled. USE float only."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE float only."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css float property to reverse the order of the last 2 cards."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE css float only, NO css flex, grid and position, NO js.","project":"float"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. USE css float only, NO css flex, grid and position, NO js.","project":"float"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. USE css float only, NO css flex, grid and position, NO js.","project":"float"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. USE css float only, NO css flex, grid and position, NO js.","project":"float"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px.","project":"float"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear.","project":"float"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content.","project":"float"} +{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width.","project":"float"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE float only.","project":"float"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE float only.","project":"float"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar.","project":"float"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled. USE float only.","project":"float"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content.","project":"float"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content.","project":"float"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE float only.","project":"float"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css float property to reverse the order of the last 2 cards.","project":"float"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient.","project":"float"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content.","project":"float"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width.","project":"float"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height.","project":"float"} \ No newline at end of file diff --git a/datasets/form.jsonl b/datasets/form.jsonl index 9ec0ce1bc012e307cedd088627af686fcef8d50c..37aba4ce78359be5b129f8e853dfe346b296fb9c 100644 --- a/datasets/form.jsonl +++ b/datasets/form.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id equals to param name) contains a title legend (class 'q-title') and a body container (class 'q-body'). Save codes to es-module 'common/Question.js' imported by 'index.js'. Create a Question instance (title 'sample empty question') and prepend its root to the form, save codes to 'index.js'."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array). Use radio as selection control whose value is the options index. Create a SingleSelectionQuestion with random title, 'single1' name and 3 random options. Prepend it to the form."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array). Selection control value is the options index. Create a MultipleSelectionQuestion with random title, 'multi1' name and 3 random options. Prepend it to the form."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Class OpenQuestion (file 'common/OpenQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), isMultilines (boolean). Create an OpenQuestion with random title, 'open1' name, single line. Create another OpenQuestion with random title, 'open2' name, multilines. Prepend open1 and open2 to the form."} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), starCount (number, default 5). Highlight stars (class 'star') up to the clicked star (class 'active'), and get the rating value (stored in param-named control) from 0 to 1. Create a RatingQuestion with random title, 'rating1' name. Create another RatingQuestion with random title, 'rating2' name, 10 stars. Prepend rating1 and rating2 to the form."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array). Insert after(or before) the target option (class 'ranking-item') when dragging the source option into the target option's bottom (or top) half. Store comma separated option indices in param-named control. Create a RankingQuestion with random title, 'ranking1' name and 3 random options. Prepend it to the form."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js') inherits from Question. Its constructor params are: title (string), name (string). Highlight the clicked score block element (class 'score'), and store score (0-10) in param-named control. Create a NpsQuestion with random title, 'nps1' name. Prepend it to the form."} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Create a LikertQuestion with random title, 'likert1' name, 5 random options, 3 statements. Prepend it to the form."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add questions contents(class 'contents') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after each new question inserted to the form. Save codes to 'common/Contents.js'."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Insert after(or before) the target contents item when dragging the source one into the target one's bottom (or top) half; Change the position of associated questions at the same time."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append a config panel (class 'q-config') to 'Question.root'. Config panel contains a checkbox (class 'q-required') associated with Question.required (boolean, default false). Form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls required attribute. Implement 'required' feature for SingleSelectionQuestion."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Implement 'required' feature for NpsQuestion, LikertQuestion, RatingQuestion."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Add property minLength (number, default 0) for OpenQuestion. A required OpenQuestion's answer length should be greater than 1. OpenQuestion's answer length should be greater than minLength."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Class Survey (file 'common/Survey.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' is used to prepend a 'question.root' to the form and to update contents. Method 'appendQuestion(question)' is used to append a 'question.root' to the form and to update contents. Replace relevant old codes to Survey."} -{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a numeric index (format `n.`) started from 1 for each question title. The topmost question index is 1."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Class DataQuestion (file 'common/DataQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), type (one of url/tel/email/date/number). Create 5 DataQuestion with random title, 'url/tel/email/date/number' type, name format `data-{type}` (e.g. `data-url`). Prepend 5 questions to the form."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Add property isSelectMode (boolean, default false) for class SingleSelectionQuestion. Set isSelectMode to true to use 'select' control to replace radios. Add a checkbox (class 'q-select') associated with SingleSelectionQuestion.isSelectMode in the config panel."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add 'Shuffle' config and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Check the checkbox (class 'q-shuffle') in the config panel to shuffle options, and uncheck it to restore the original orders."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Click export button (class 'export') to save Survey exported data to 'localStorage.data'. Survey exported data format is like `{title:'survey title', questions:[{title:'single1 title', name:'single1', options:['option 1', 'option 2'], required:false, isShuffleMode:true, isSelectMode:true}, {title:'open1 title', name:'open1', isMultilines:true, required:false, isShuffleMode:false}]}`. Each type of question's JSON data should contain all properties from constructor params and configs."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id equals to param name) contains a title legend (class 'q-title') and a body container (class 'q-body'). Save codes to es-module 'common/Question.js' imported by 'index.js'. Create a Question instance (title 'sample empty question') and prepend its root to the form, save codes to 'index.js'.","project":"form"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array). Use radio as selection control whose value is the options index. Create a SingleSelectionQuestion with random title, 'single1' name and 3 random options. Prepend it to the form.","project":"form"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array). Selection control value is the options index. Create a MultipleSelectionQuestion with random title, 'multi1' name and 3 random options. Prepend it to the form.","project":"form"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Class OpenQuestion (file 'common/OpenQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), isMultilines (boolean). Create an OpenQuestion with random title, 'open1' name, single line. Create another OpenQuestion with random title, 'open2' name, multilines. Prepend open1 and open2 to the form.","project":"form"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), starCount (number, default 5). Highlight stars (class 'star') up to the clicked star (class 'active'), and get the rating value (stored in param-named control) from 0 to 1. Create a RatingQuestion with random title, 'rating1' name. Create another RatingQuestion with random title, 'rating2' name, 10 stars. Prepend rating1 and rating2 to the form.","project":"form"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array). Insert after(or before) the target option (class 'ranking-item') when dragging the source option into the target option's bottom (or top) half. Store comma separated option indices in param-named control. Create a RankingQuestion with random title, 'ranking1' name and 3 random options. Prepend it to the form.","project":"form"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js') inherits from Question. Its constructor params are: title (string), name (string). Highlight the clicked score block element (class 'score'), and store score (0-10) in param-named control. Create a NpsQuestion with random title, 'nps1' name. Prepend it to the form.","project":"form"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Create a LikertQuestion with random title, 'likert1' name, 5 random options, 3 statements. Prepend it to the form.","project":"form"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add questions contents(class 'contents') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after each new question inserted to the form. Save codes to 'common/Contents.js'.","project":"form"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Insert after(or before) the target contents item when dragging the source one into the target one's bottom (or top) half; Change the position of associated questions at the same time.","project":"form"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append a config panel (class 'q-config') to 'Question.root'. Config panel contains a checkbox (class 'q-required') associated with Question.required (boolean, default false). Form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls required attribute. Implement 'required' feature for SingleSelectionQuestion.","project":"form"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Implement 'required' feature for NpsQuestion, LikertQuestion, RatingQuestion.","project":"form"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Add property minLength (number, default 0) for OpenQuestion. A required OpenQuestion's answer length should be greater than 1. OpenQuestion's answer length should be greater than minLength.","project":"form"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting.","project":"form"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Class Survey (file 'common/Survey.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' is used to prepend a 'question.root' to the form and to update contents. Method 'appendQuestion(question)' is used to append a 'question.root' to the form and to update contents. Replace relevant old codes to Survey.","project":"form"} +{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a numeric index (format `n.`) started from 1 for each question title. The topmost question index is 1.","project":"form"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Class DataQuestion (file 'common/DataQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), type (one of url/tel/email/date/number). Create 5 DataQuestion with random title, 'url/tel/email/date/number' type, name format `data-{type}` (e.g. `data-url`). Prepend 5 questions to the form.","project":"form"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Add property isSelectMode (boolean, default false) for class SingleSelectionQuestion. Set isSelectMode to true to use 'select' control to replace radios. Add a checkbox (class 'q-select') associated with SingleSelectionQuestion.isSelectMode in the config panel.","project":"form"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add 'Shuffle' config and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Check the checkbox (class 'q-shuffle') in the config panel to shuffle options, and uncheck it to restore the original orders.","project":"form"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Click export button (class 'export') to save Survey exported data to 'localStorage.data'. Survey exported data format is like `{title:'survey title', questions:[{title:'single1 title', name:'single1', options:['option 1', 'option 2'], required:false, isShuffleMode:true, isSelectMode:true}, {title:'open1 title', name:'open1', isMultilines:true, required:false, isShuffleMode:false}]}`. Each type of question's JSON data should contain all properties from constructor params and configs.","project":"form"} \ No newline at end of file diff --git a/datasets/grid.jsonl b/datasets/grid.jsonl index ac1f943d6e3721ca86f9425a32d579b96786f25f..b291f9779a17f79cd16c82d3dbe138f3b35768d5 100644 --- a/datasets/grid.jsonl +++ b/datasets/grid.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE css grid only, NO css flex, float and position, NO js."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. Use grid only."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. Use grid only too."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. Use grid only."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px."} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear."} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content."} -{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE grid only."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE grid only."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE grid only."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css property to reverse the order of the last 2 cards."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE css grid only, NO css flex, float and position, NO js.","project":"grid"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. Use grid only.","project":"grid"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. Use grid only too.","project":"grid"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. Use grid only.","project":"grid"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px.","project":"grid"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear.","project":"grid"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content.","project":"grid"} +{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width.","project":"grid"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE grid only.","project":"grid"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE grid only.","project":"grid"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar.","project":"grid"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled.","project":"grid"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content.","project":"grid"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content.","project":"grid"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE grid only.","project":"grid"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css property to reverse the order of the last 2 cards.","project":"grid"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient.","project":"grid"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content.","project":"grid"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width.","project":"grid"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height.","project":"grid"} \ No newline at end of file diff --git a/datasets/jotai.jsonl b/datasets/jotai.jsonl index 0290757bc42d3d144ef8b99f8bd160b49c59a933..0995979f2b29a44303841fa296fc6792fd80fb4d 100644 --- a/datasets/jotai.jsonl +++ b/datasets/jotai.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color.\n2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. \n3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }.\n3) Render Header.tsx And Main.tsx in App.tsx \n4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'.\n2) Create atoms/blog.ts, use Jotai to create an atom with blog data, initialState is: \n```\n[{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]\n```\n2) In Main.tsx, render BlogList with the data from the atom (by using useAtom hook to access the blog data)\n3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. \n4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be the first item of blog list.\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. \n2) Set 'Morning' as the default selected blog. \n3) Beautify the List without changing the size of List Item\n4) Use Jotai to manage the selected blog\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. \n2) Use Jotai to manage the 'formVisible' state with formVisibleAtom. When formVisible is true, the BlogForm should be displayed, otherwise, it should be hidden.\n3) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. \n4) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it.\n5) Place the BlogForm component in App.tsx.\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) An API is prepared, here is the docs of API:\nGET /api/blogs\n\n interface Response {\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) In atoms/blog.ts, create an async atom to fetch data from API and update the blog list atom.\n3) When App.tsx mounted, use the async atom to start fetching blogs.\n4) When API is fetching, show 'Blog is loading' in App.tsx.\n5) Notice: When Initial Blog is fetching, Header is always visible but 'Add Blog' button should be disabled.\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label (label[htmlFor=\"title\"], label[htmlFor=\"detail\"]) in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); \n2) When submitted, append this Blog to BlogList, and set this Blog as selected.\n3) Use Jotai to append form data to blogs\n4) Check title duplication when submit clicked. When title is duplicated, stop submitting and show a red border around the input field.\n5) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs by reading from the blogAtom\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx to delete the selected blog.\n2) When blog deleted, set the first blog in blogs as selected.\n3) If blogs is empty, shows 'No Blog' instead.\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. \n2) When Edit clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Blog' in this case. When submitted, update selected Blog. \n3) Use Jotai to manage edit logic.\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Here is Search API:\nGET /api/search_blogs?keywords=XXX\n\n interface Response {\n // blogs is the search result\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. \n3) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to FILTER blogs by using new Search API.\n4) Use Jotai to request Search API and manage filtered blogs. Notice: Do not change the blogs in store.\n5) Hint: When input field is typed fast, make sure the latest search result is displayed.\nConstraint: DO NOT USE any third-party packages, ONLY React/Jotai APIs can be used to optimize performance.\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add atoms/route.ts to control the Route Logic\nThe definition of state is:\n```\nconst routeAtom = atom(window.location.pathname);\n```\n2) In atoms/route.ts, create a function that listens to browser history change, and updates the routeAtom.\n3) When path is '/', shows Main.tsx, when path is '/login', shows pages/Login.tsx. Header is visible for every page.\n4) Render

User Login

in components/Login.tsx. Add Button with text '🔑' in the right of Header.tsx, when clicked, go to '/login'.\nConstraint: DO NOT USE any third-party packages, ONLY React/Jotai APIs can be used to optimize performance.\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a button with the text '🔀' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\\\d]{12}', digits in title is random. \n2) Ensure the page will not be stuck when 100000 blogs are appended by using proper Jotai patterns for large state updates.\nConstraint: DO NOT USE any third-party packages, ONLY React/Jotai APIs can be used to optimize performance.\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. \n2) Develop a utility atom to reuse Markdown-related logic. \n3) Prevent XSS attacks. \nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Implement user login, logout, and display blog poster's username.\n\n 1) Login API:\nPOST /api/login\nRequest: { username: string, password: string }\nResponse: { success: boolean }\n2) On the /login page, add a LoginForm with labels(label[htmlFor=\"username\"], label[htmlFor=\"password\"]), and a .login-submit-btn to submit the form via the Login API.\n3) Display the user's username in Header.tsx with the class '.username'.\n4) Show the blog author's username with the class '.blog-author'. If blog has no author, display 'Anonymous'.\n5) Add a '👋' Logout button (class '.logout-btn') next to the username in Header.tsx. Clicking it logs the user out.\n6) Use Jotai to manage user states with userAtom and create a derived atom for handling login/logout actions.\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement blog comment feature:\n1) Display commenter's username with class '.comment-author' and text with '.comment-text'.\n2) Add a CommentForm with a '.comment-input' textarea and a '.comment-submit-btn' below each blog.\n3) Create commentsAtom to manage comments using Jotai.\n4) Add undo functionality via Ctrl+Z (Windows/Linux) or Command+Z (Mac) to remove the last comment. Implement this with a commentHistoryAtom.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Write a Gomoku chess game in route: '/game'\n1) Add a button with the text '🎮' in Header, when clicked, jump to new page '/game'\n2) chess board is 15*15, there is black chess and white chess, black chess first \n3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\\\d{1,2}-d\\\\{1,2}. \n4) show 'White's Turn' and 'Black'Turn' to shw current player \n5) show 'White Wins!' and 'Black Wins!'.\n6) Create gameStateAtom and related atoms to manage the game logic. Beautify this game.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Enhance the Gomoku game with multi-step undo functionality.\n1) Implement keyboard shortcut (Ctrl+Z on Windows/Linux or Command+Z on Mac) to trigger the undo action.\n2) Allow multiple consecutive undos to revert the game state to any previous point by using a gameHistoryAtom.\n3) Add a move history display with className '.move-history' showing all moves in the format \"White: (x,y)\" or \"Black: (x,y)\".\n4) Each history item should have className '.history-item'.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Implement a recording and replay system for Gomoku games.\n1) Every games will be auto recorded, and can be replayed by play button (.replay-play-btn) after the game is finished. \n2) Add play/pause button (className '.replay-play-btn', '.replay-pause-btn') and a slider (className '.replay-slider') to navigate through game moves.\n3) When replaying, show the current move number with className '.current-move'. \n4) There is an interval of 1000 ms between each move.\n5) Create replayStateAtom and replayControlsAtom to manage replay functionality.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Create functionality to share Gomoku games as blog posts.\n1) Shows the \"Share to Blog\" button with className '.share-to-blog-btn' in the Gomoku game after the game is finished.\n2) When clicked, open a modal form (className '.share-modal') with title input (className '.title-input'), description input (className '.description-input'), submit button (className '.share-submit').\nGo to home page ('/') after submitted.\n3) In Blog Detail, detect if a blog contains a Gomoku game recording and display a \"Replay Game\" button (className '.blog-replay-btn').\n4) When the replay button is clicked, show a modal (className '.blog-replay-modal') with the full game replay interface.\n5) The replay interface should include the start play button (className '.blog-replay-start-play'), showing the current move number with className '.current-move'. There is an interval of 1000 ms between each move. \nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new page '/rooms':\n1) Add a button with the text '🚪' in Header, when clicked, jump to new page '/rooms'\n2) Add a \"Create Room\" button with className '.create-room-btn' that opens a room creation form.\n3) The room creation form should include a labeled input field for room name (\"Room Name\") and a \"Create\" button to submit the form and create a new game room with a unique ID. Don't enter the room instantly.\n4) Each room should be displayed as a card with className '.room-card' showing room name, creator's username, and current status.\n5) Sync room status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Implement a multi-user chat system based on rooms\n1) When a user clicks on a chat room card (with className '.room-card'), navigate to '/chat/:roomId' route.\n2) The chat room page ('/chat/:roomId') contains a message list (className '.message-list'), status display (in '.room-status'), and participant information (display all participants' usernames in '.participant-list').\n3) Implement message sending and receiving functionality, including a message input box (className '.message-input') and a send button (className '.send-button').\n4) Each message (className .message) should contains the sender's information (className '.message-sender').\n5) If the user enters the chat room, add this user to .participant-list.\n6) User will send heartbeat to check if user is in chat room, if the user is not active for 2000ms, the user will be removed from .participant-list.\n7) Sync chat room status, messages, and user connection status between all open tabs/windows using Jotai.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color.\n2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. \n3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }.\n3) Render Header.tsx And Main.tsx in App.tsx \n4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px\n","project":"jotai"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'.\n2) Create atoms/blog.ts, use Jotai to create an atom with blog data, initialState is: \n```\n[{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]\n```\n2) In Main.tsx, render BlogList with the data from the atom (by using useAtom hook to access the blog data)\n3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. \n4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be the first item of blog list.\n","project":"jotai"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. \n2) Set 'Morning' as the default selected blog. \n3) Beautify the List without changing the size of List Item\n4) Use Jotai to manage the selected blog\n","project":"jotai"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. \n2) Use Jotai to manage the 'formVisible' state with formVisibleAtom. When formVisible is true, the BlogForm should be displayed, otherwise, it should be hidden.\n3) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. \n4) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it.\n5) Place the BlogForm component in App.tsx.\n","project":"jotai"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) An API is prepared, here is the docs of API:\nGET /api/blogs\n\n interface Response {\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) In atoms/blog.ts, create an async atom to fetch data from API and update the blog list atom.\n3) When App.tsx mounted, use the async atom to start fetching blogs.\n4) When API is fetching, show 'Blog is loading' in App.tsx.\n5) Notice: When Initial Blog is fetching, Header is always visible but 'Add Blog' button should be disabled.\n","project":"jotai"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label (label[htmlFor=\"title\"], label[htmlFor=\"detail\"]) in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); \n2) When submitted, append this Blog to BlogList, and set this Blog as selected.\n3) Use Jotai to append form data to blogs\n4) Check title duplication when submit clicked. When title is duplicated, stop submitting and show a red border around the input field.\n5) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs by reading from the blogAtom\n","project":"jotai"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx to delete the selected blog.\n2) When blog deleted, set the first blog in blogs as selected.\n3) If blogs is empty, shows 'No Blog' instead.\n","project":"jotai"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. \n2) When Edit clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Blog' in this case. When submitted, update selected Blog. \n3) Use Jotai to manage edit logic.\n","project":"jotai"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Here is Search API:\nGET /api/search_blogs?keywords=XXX\n\n interface Response {\n // blogs is the search result\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. \n3) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to FILTER blogs by using new Search API.\n4) Use Jotai to request Search API and manage filtered blogs. Notice: Do not change the blogs in store.\n5) Hint: When input field is typed fast, make sure the latest search result is displayed.\nConstraint: DO NOT USE any third-party packages, ONLY React/Jotai APIs can be used to optimize performance.\n","project":"jotai"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add atoms/route.ts to control the Route Logic\nThe definition of state is:\n```\nconst routeAtom = atom(window.location.pathname);\n```\n2) In atoms/route.ts, create a function that listens to browser history change, and updates the routeAtom.\n3) When path is '/', shows Main.tsx, when path is '/login', shows pages/Login.tsx. Header is visible for every page.\n4) Render

User Login

in components/Login.tsx. Add Button with text '🔑' in the right of Header.tsx, when clicked, go to '/login'.\nConstraint: DO NOT USE any third-party packages, ONLY React/Jotai APIs can be used to optimize performance.\n","project":"jotai"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a button with the text '🔀' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\\\d]{12}', digits in title is random. \n2) Ensure the page will not be stuck when 100000 blogs are appended by using proper Jotai patterns for large state updates.\nConstraint: DO NOT USE any third-party packages, ONLY React/Jotai APIs can be used to optimize performance.\n","project":"jotai"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. \n2) Develop a utility atom to reuse Markdown-related logic. \n3) Prevent XSS attacks. \nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Implement user login, logout, and display blog poster's username.\n\n 1) Login API:\nPOST /api/login\nRequest: { username: string, password: string }\nResponse: { success: boolean }\n2) On the /login page, add a LoginForm with labels(label[htmlFor=\"username\"], label[htmlFor=\"password\"]), and a .login-submit-btn to submit the form via the Login API.\n3) Display the user's username in Header.tsx with the class '.username'.\n4) Show the blog author's username with the class '.blog-author'. If blog has no author, display 'Anonymous'.\n5) Add a '👋' Logout button (class '.logout-btn') next to the username in Header.tsx. Clicking it logs the user out.\n6) Use Jotai to manage user states with userAtom and create a derived atom for handling login/logout actions.\n","project":"jotai"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement blog comment feature:\n1) Display commenter's username with class '.comment-author' and text with '.comment-text'.\n2) Add a CommentForm with a '.comment-input' textarea and a '.comment-submit-btn' below each blog.\n3) Create commentsAtom to manage comments using Jotai.\n4) Add undo functionality via Ctrl+Z (Windows/Linux) or Command+Z (Mac) to remove the last comment. Implement this with a commentHistoryAtom.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Write a Gomoku chess game in route: '/game'\n1) Add a button with the text '🎮' in Header, when clicked, jump to new page '/game'\n2) chess board is 15*15, there is black chess and white chess, black chess first \n3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\\\d{1,2}-d\\\\{1,2}. \n4) show 'White's Turn' and 'Black'Turn' to shw current player \n5) show 'White Wins!' and 'Black Wins!'.\n6) Create gameStateAtom and related atoms to manage the game logic. Beautify this game.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Enhance the Gomoku game with multi-step undo functionality.\n1) Implement keyboard shortcut (Ctrl+Z on Windows/Linux or Command+Z on Mac) to trigger the undo action.\n2) Allow multiple consecutive undos to revert the game state to any previous point by using a gameHistoryAtom.\n3) Add a move history display with className '.move-history' showing all moves in the format \"White: (x,y)\" or \"Black: (x,y)\".\n4) Each history item should have className '.history-item'.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Implement a recording and replay system for Gomoku games.\n1) Every games will be auto recorded, and can be replayed by play button (.replay-play-btn) after the game is finished. \n2) Add play/pause button (className '.replay-play-btn', '.replay-pause-btn') and a slider (className '.replay-slider') to navigate through game moves.\n3) When replaying, show the current move number with className '.current-move'. \n4) There is an interval of 1000 ms between each move.\n5) Create replayStateAtom and replayControlsAtom to manage replay functionality.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Create functionality to share Gomoku games as blog posts.\n1) Shows the \"Share to Blog\" button with className '.share-to-blog-btn' in the Gomoku game after the game is finished.\n2) When clicked, open a modal form (className '.share-modal') with title input (className '.title-input'), description input (className '.description-input'), submit button (className '.share-submit').\nGo to home page ('/') after submitted.\n3) In Blog Detail, detect if a blog contains a Gomoku game recording and display a \"Replay Game\" button (className '.blog-replay-btn').\n4) When the replay button is clicked, show a modal (className '.blog-replay-modal') with the full game replay interface.\n5) The replay interface should include the start play button (className '.blog-replay-start-play'), showing the current move number with className '.current-move'. There is an interval of 1000 ms between each move. \nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new page '/rooms':\n1) Add a button with the text '🚪' in Header, when clicked, jump to new page '/rooms'\n2) Add a \"Create Room\" button with className '.create-room-btn' that opens a room creation form.\n3) The room creation form should include a labeled input field for room name (\"Room Name\") and a \"Create\" button to submit the form and create a new game room with a unique ID. Don't enter the room instantly.\n4) Each room should be displayed as a card with className '.room-card' showing room name, creator's username, and current status.\n5) Sync room status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Implement a multi-user chat system based on rooms\n1) When a user clicks on a chat room card (with className '.room-card'), navigate to '/chat/:roomId' route.\n2) The chat room page ('/chat/:roomId') contains a message list (className '.message-list'), status display (in '.room-status'), and participant information (display all participants' usernames in '.participant-list').\n3) Implement message sending and receiving functionality, including a message input box (className '.message-input') and a send button (className '.send-button').\n4) Each message (className .message) should contains the sender's information (className '.message-sender').\n5) If the user enters the chat room, add this user to .participant-list.\n6) User will send heartbeat to check if user is in chat room, if the user is not active for 2000ms, the user will be removed from .participant-list.\n7) Sync chat room status, messages, and user connection status between all open tabs/windows using Jotai.\nConstraint: DO NOT use any third-party packages; ONLY React/Jotai APIs are permitted.\n","project":"jotai"} \ No newline at end of file diff --git a/datasets/less.jsonl b/datasets/less.jsonl index 7c1a389dd8b634d3c2bed39509ed9358ee5c41f9..52f61968607c8df0f5258d84e63bbbd22d1369d4 100644 --- a/datasets/less.jsonl +++ b/datasets/less.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form. Save styles to 'common/Question.less' imported by 'common.less'."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page. Extract all colors to LESS map variable '@color', all padding/margin value to LESS variables (using computed value) and all border properties to mixins. Use LESS functions to handle similar colors, e.g. lighter or darker colors. Save these variables and mixins to 'common/config.less' which should be imported by 'common.less'."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'. Save styles to 'common/SurveyDesign.less' imported by 'common.less'."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable. Save styles to 'common/SurveyPreview.less' imported by 'common.less'."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place. Save styles to 'common/SingleSelectionQuestion.less' imported by 'common.less'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js', 'common/MultiSelectionQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js', 'common/OpenQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js', 'common/RatingQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js', 'common/RankingQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control."} -{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js', 'common/NpsQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js', 'common/LikertQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time. Save styles to 'common/Content.less' imported by 'common.less'."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion."} -{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js', 'common/DataQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form. Save styles to 'common/Question.less' imported by 'common.less'.","project":"less"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page. Extract all colors to LESS map variable '@color', all padding/margin value to LESS variables (using computed value) and all border properties to mixins. Use LESS functions to handle similar colors, e.g. lighter or darker colors. Save these variables and mixins to 'common/config.less' which should be imported by 'common.less'.","project":"less"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'. Save styles to 'common/SurveyDesign.less' imported by 'common.less'.","project":"less"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'.","project":"less"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable. Save styles to 'common/SurveyPreview.less' imported by 'common.less'.","project":"less"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place. Save styles to 'common/SingleSelectionQuestion.less' imported by 'common.less'.","project":"less"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js', 'common/MultiSelectionQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place.","project":"less"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js', 'common/OpenQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel.","project":"less"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js', 'common/RatingQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1.","project":"less"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js', 'common/RankingQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control.","project":"less"} +{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js', 'common/NpsQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control.","project":"less"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js', 'common/LikertQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form.","project":"less"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place.","project":"less"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time. Save styles to 'common/Content.less' imported by 'common.less'.","project":"less"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion.","project":"less"} +{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength.","project":"less"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting.","project":"less"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js', 'common/DataQuestion.less') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'.","project":"less"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page.","project":"less"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel.","project":"less"} \ No newline at end of file diff --git a/datasets/lowdb.jsonl b/datasets/lowdb.jsonl index da00ee4a27aeba4da2507f7bcdf085e21d80bb76..3cd8f83e225e5ce5f4e898e1790b09e8f1310075 100644 --- a/datasets/lowdb.jsonl +++ b/datasets/lowdb.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts)\n2) in this api, return a string list in body to get all usernames by User Model (db.data.users), example: ['user1', 'user2']\n3) Hint: use global.db.data.users and get user model by lowdb API\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) define a Product type in global.d.ts, update defaultData in instrumentation.ts\n2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n3) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n4) GET /api/products to fetch all products\n5) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n6) Hint: use global.db.data.products and get product model by lowdb API\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id\n2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}\n3) when product not found, return { success: true, data: null }\n4) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n5) Return { success: true, data: {'id': 'xxxx' } } when updated successfully\n6) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) create css file to beautify CSS\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /product page, When .product-card clicked, goto related product detail page\n4) create css file to beautify CSS\n5) If Not Found, show 'Product Not Found'\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } \n2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}\n3) if not login, return 401 status\n4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}\n5) secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth\n4) create css file to beautify CSS\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) Add Server Action to handle register form submission, the initial coin for new user is 1000\n7) create CSS file to beautify CSS\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS file to beautify CSS\n6) DO NOT use a third-party UI library\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx:\n - if not logged in, display a button (.header-go-login) that navigates to /login\n - if logged in, display the username (.header-username) on the right side of the site header\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - a button (.header-logout-btn) for logging out\n - a button (.header-go-user-profile) for navigating to the current user's profile page\n3) Create CSS file to beautify CSS\n4) DO NOT use a third-party UI library\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS file to beautify CSS\n5) DO NOT use a third-party UI library\n6) Keep profile page STATIC\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every product and user is wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) On the Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, Redirect to /login if there is no privilege\n6) Create CSS files to beautify CSS\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) structured as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) On the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart\n5) Store Cart Info in the DB for the current User\n6) Place Shopping Cart which can be seen in every page in the right-bottom of page\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - the status of the order becomes 'Finished'\n - the Coin is paid by current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - update the order status to 'Refund Passed'\n - ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - the username\n - the rating\n - the comment text\n6) styled using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating(with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party library\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag\n","project":"lowdb"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts)\n2) in this api, return a string list in body to get all usernames by User Model (db.data.users), example: ['user1', 'user2']\n3) Hint: use global.db.data.users and get user model by lowdb API\n","project":"lowdb"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) define a Product type in global.d.ts, update defaultData in instrumentation.ts\n2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n3) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n4) GET /api/products to fetch all products\n5) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n6) Hint: use global.db.data.products and get product model by lowdb API\n","project":"lowdb"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id\n2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}\n3) when product not found, return { success: true, data: null }\n4) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n5) Return { success: true, data: {'id': 'xxxx' } } when updated successfully\n6) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)\n","project":"lowdb"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) create css file to beautify CSS\n","project":"lowdb"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /product page, When .product-card clicked, goto related product detail page\n4) create css file to beautify CSS\n5) If Not Found, show 'Product Not Found'\n","project":"lowdb"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } \n2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}\n3) if not login, return 401 status\n4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}\n5) secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n","project":"lowdb"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth\n4) create css file to beautify CSS\n","project":"lowdb"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) Add Server Action to handle register form submission, the initial coin for new user is 1000\n7) create CSS file to beautify CSS\n","project":"lowdb"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS file to beautify CSS\n6) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx:\n - if not logged in, display a button (.header-go-login) that navigates to /login\n - if logged in, display the username (.header-username) on the right side of the site header\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - a button (.header-logout-btn) for logging out\n - a button (.header-go-user-profile) for navigating to the current user's profile page\n3) Create CSS file to beautify CSS\n4) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS file to beautify CSS\n5) DO NOT use a third-party UI library\n6) Keep profile page STATIC\n","project":"lowdb"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every product and user is wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) On the Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, Redirect to /login if there is no privilege\n6) Create CSS files to beautify CSS\n","project":"lowdb"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) structured as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) On the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart\n5) Store Cart Info in the DB for the current User\n6) Place Shopping Cart which can be seen in every page in the right-bottom of page\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - the status of the order becomes 'Finished'\n - the Coin is paid by current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - update the order status to 'Refund Passed'\n - ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - the username\n - the rating\n - the comment text\n6) styled using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating(with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n","project":"lowdb"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party library\n","project":"lowdb"} \ No newline at end of file diff --git a/datasets/mobx.jsonl b/datasets/mobx.jsonl index f55a9ed8549d78d50c70deefd45c9b3e592e46d5..0c6332049965bf22447dac4c3a98329d3d7cd4f2 100644 --- a/datasets/mobx.jsonl +++ b/datasets/mobx.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color.\n2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. \n3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }.\n3) Render Header.tsx And Main.tsx in App.tsx \n4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'.\n2) Create stores/blog.ts, use MobX to create a store with blog data, initialState is: \n```\n{ blogs: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}] }\n```\n2) In Main.tsx, render BlogList with the data from the store (by using observer in mobx-react-lite to auto update the BlogList when the blog data changes)\n3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. \n4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be the first item of blog list.\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. \n2) Set 'Morning' as the default selected blog. \n3) Beautify the List without changing the size of List Item\n4) Use MobX to manage the selected blog. Use observer in mobx-react-lite to auto update.\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. \n2) Use MobX to manage the 'formVisible' state. When formVisible is true, the BlogForm should be displayed, otherwise, it should be hidden.\n3) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. \n4) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it.\n5) Place the BlogForm component in App.tsx. Use observer in mobx-react-lite to auto update.\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) An API is prepared, here is the docs of API:\nGET /api/blogs\n\n interface Response {\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) In stores/blog.ts, add an async action to fetch data from API and update the blog list data in the store.\n3) When App.tsx mounted, call the fetch action to start fetching blogs.\n4) When API is fetching, show 'Blog is loading' in App.tsx. Use observer in mobx-react-lite to auto update.\n5) Notice: When Initial Blog is fetching, Header is always visible but 'Add Blog' button should be disabled.\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label (label[htmlFor=\"title\"], label[htmlFor=\"detail\"]) in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); \n2) When submitted, append this Blog to BlogList, and set this Blog as selected.\n3) Use MobX actions to append form data to blogs. \n4) Check title duplication when submit clicked. When title is duplicated, stop submitting and show a red border around the input field.\n5) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx to delete the selected blog.\n2) When blog deleted, set the first blog in blogs as selected.\n3) If blogs is empty, shows 'No Blog' instead.\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. \n2) When Edit clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Blog' in this case. When submitted, update selected Blog. \n3) Use MobX to manage edit logic.\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Here is Search API:\nGET /api/search_blogs?keywords=XXX\n\n interface Response {\n // blogs is the search result\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. \n3) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to FILTER blogs by using new Search API.\n4) Use MobX to request Search API and manage filtered blogs. Notice: Do not change the blogs in store.\n5) Hint: When input field is typed fast, make sure the latest search result is displayed.\nConstraint: DO NOT USE any third-party packages, ONLY React/MobX APIs can be used to optimize performance.\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add stores/route.ts to control the Route Logic\nThe definition of state is:\n```\nclass RouteStore {\n currentRoute: string;\n}\n```\nThe initial state of route will be the pathname of the current page.\n2) In stores/route.ts, listens to browser history change, and updates the currentRoute in the store.\n3) When path is '/', shows Main.tsx, when path is '/login', shows pages/Login.tsx. Header is visible for every page.\n4) Render

User Login

in components/Login.tsx. Add Button with text '🔑' in the right of Header.tsx, when clicked, go to '/login'.\nConstraint: DO NOT USE any third-party packages, ONLY React/MobX APIs can be used to optimize performance.\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a button with the text '🔀' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\\\d]{12}', digits in title is random. \n2) Ensure the page will not be stuck when 100000 blogs are appended. \nConstraint: DO NOT USE any third-party packages, ONLY React/MobX APIs can be used to optimize performance.\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. \n2) Develop a utility to reuse Markdown-related logic. \n3) Prevent XSS attacks. \nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Implement user login, logout, and display blog poster's username.\n\n 1) Login API:\nPOST /api/login\nRequest: { username: string, password: string }\nResponse: { success: boolean }\n2) On the /login page, add a LoginForm with labels(label[htmlFor=\"username\"], label[htmlFor=\"password\"]), and a .login-submit-btn to submit the form via the Login API.\n3) Display the user's username in Header.tsx with the class '.username'.\n4) Show the blog author's username with the class '.blog-author'. If blog has no author, display 'Anonymous'.\n5) Add a '👋' Logout button (class '.logout-btn') next to the username in Header.tsx. Clicking it logs the user out.\n6) Use MobX to manage user states.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement blog comment feature:\n1) Display commenter's username with class '.comment-author' and text with '.comment-text'.\n2) Add a CommentForm with a '.comment-input' textarea and a '.comment-submit-btn' below each blog.\n3) Use MobX to manage comments.\n4) Add undo functionality via Ctrl+Z (Windows/Linux) or Command+Z (Mac) to remove the last comment.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Write a Gomoku chess game in route: '/game'\n1) Add a button with the text '🎮' in Header, when clicked, jump to new page '/game'\n2) chess board is 15*15, there is black chess and white chess, black chess first \n3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\\\d{1,2}-d\\\\{1,2}. \n4) show 'White's Turn' and 'Black'Turn' to shw current player \n5) show 'White Wins!' and 'Black Wins!'.\n6) Use MobX to manage the game logic. Beautify this game \nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Enhance the Gomoku game with multi-step undo functionality.\n1) Implement keyboard shortcut (Ctrl+Z on Windows/Linux or Command+Z on Mac) to trigger the undo action.\n2) Allow multiple consecutive undos to revert the game state to any previous point.\n3) Add a move history display with className '.move-history' showing all moves in the format \"White: (x,y)\" or \"Black: (x,y)\".\n4) Each history item should have className '.history-item'.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic;\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Implement a recording and replay system for Gomoku games.\n1) Every games will be auto recorded, and can be replayed by play button (.replay-play-btn) after the game is finished. \n2) Add play/pause button (className '.replay-play-btn', '.replay-pause-btn') and a slider (className '.replay-slider') to navigate through game moves.\n3) When replaying, show the current move number with className '.current-move'. \n4) There is an interval of 1000 ms between each move.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic;\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Create functionality to share Gomoku games as blog posts.\n1) Shows the \"Share to Blog\" button with className '.share-to-blog-btn' in the Gomoku game after the game is finished.\n2) When clicked, open a modal form (className '.share-modal') with title input (className '.title-input'), description input (className '.description-input'), submit button (className '.share-submit').\nGo to home page ('/') after submitted.\n3) In Blog Detail, detect if a blog contains a Gomoku game recording and display a \"Replay Game\" button (className '.blog-replay-btn').\n4) When the replay button is clicked, show a modal (className '.blog-replay-modal') with the full game replay interface.\n5) The replay interface should include the start play button (className '.blog-replay-start-play'), showing the current move number with className '.current-move'. There is an interval of 1000 ms between each move. \nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic.\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new page '/rooms':\n1) Add a button with the text '🚪' in Header, when clicked, jump to new page '/rooms'\n2) Add a \"Create Room\" button with className '.create-room-btn' that opens a room creation form.\n3) The room creation form should include a labeled input field for room name (\"Room Name\") and a \"Create\" button to submit the form and create a new game room with a unique ID. Don't enter the room instantly.\n4) Each room should be displayed as a card with className '.room-card' showing room name, creator's username, and current status.\n5) Sync room status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the state and sync logic.\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Implement a multi-user chat system based on rooms\n1) When a user clicks on a chat room card (with className '.room-card'), navigate to '/chat/:roomId' route.\n2) The chat room page ('/chat/:roomId') contains a message list (className '.message-list'), status display (in '.room-status'), and participant information (display all participants' usernames in '.participant-list').\n3) Implement message sending and receiving functionality, including a message input box (className '.message-input') and a send button (className '.send-button').\n4) Each message (className .message) should contains the sender's information (className '.message-sender').\n5) If the user enters the chat room, add this user to .participant-list.\n6) User will send heartbeat to check if user is in chat room, if the user is not active for 2000ms, the user will be removed from .participant-list.\n7) Sync chat room status, messages, and user connection status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic.\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color.\n2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. \n3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }.\n3) Render Header.tsx And Main.tsx in App.tsx \n4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px\n","project":"mobx"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'.\n2) Create stores/blog.ts, use MobX to create a store with blog data, initialState is: \n```\n{ blogs: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}] }\n```\n2) In Main.tsx, render BlogList with the data from the store (by using observer in mobx-react-lite to auto update the BlogList when the blog data changes)\n3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. \n4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be the first item of blog list.\n","project":"mobx"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. \n2) Set 'Morning' as the default selected blog. \n3) Beautify the List without changing the size of List Item\n4) Use MobX to manage the selected blog. Use observer in mobx-react-lite to auto update.\n","project":"mobx"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. \n2) Use MobX to manage the 'formVisible' state. When formVisible is true, the BlogForm should be displayed, otherwise, it should be hidden.\n3) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. \n4) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it.\n5) Place the BlogForm component in App.tsx. Use observer in mobx-react-lite to auto update.\n","project":"mobx"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) An API is prepared, here is the docs of API:\nGET /api/blogs\n\n interface Response {\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) In stores/blog.ts, add an async action to fetch data from API and update the blog list data in the store.\n3) When App.tsx mounted, call the fetch action to start fetching blogs.\n4) When API is fetching, show 'Blog is loading' in App.tsx. Use observer in mobx-react-lite to auto update.\n5) Notice: When Initial Blog is fetching, Header is always visible but 'Add Blog' button should be disabled.\n","project":"mobx"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label (label[htmlFor=\"title\"], label[htmlFor=\"detail\"]) in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); \n2) When submitted, append this Blog to BlogList, and set this Blog as selected.\n3) Use MobX actions to append form data to blogs. \n4) Check title duplication when submit clicked. When title is duplicated, stop submitting and show a red border around the input field.\n5) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs\n","project":"mobx"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx to delete the selected blog.\n2) When blog deleted, set the first blog in blogs as selected.\n3) If blogs is empty, shows 'No Blog' instead.\n","project":"mobx"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. \n2) When Edit clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Blog' in this case. When submitted, update selected Blog. \n3) Use MobX to manage edit logic.\n","project":"mobx"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Here is Search API:\nGET /api/search_blogs?keywords=XXX\n\n interface Response {\n // blogs is the search result\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. \n3) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to FILTER blogs by using new Search API.\n4) Use MobX to request Search API and manage filtered blogs. Notice: Do not change the blogs in store.\n5) Hint: When input field is typed fast, make sure the latest search result is displayed.\nConstraint: DO NOT USE any third-party packages, ONLY React/MobX APIs can be used to optimize performance.\n","project":"mobx"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add stores/route.ts to control the Route Logic\nThe definition of state is:\n```\nclass RouteStore {\n currentRoute: string;\n}\n```\nThe initial state of route will be the pathname of the current page.\n2) In stores/route.ts, listens to browser history change, and updates the currentRoute in the store.\n3) When path is '/', shows Main.tsx, when path is '/login', shows pages/Login.tsx. Header is visible for every page.\n4) Render

User Login

in components/Login.tsx. Add Button with text '🔑' in the right of Header.tsx, when clicked, go to '/login'.\nConstraint: DO NOT USE any third-party packages, ONLY React/MobX APIs can be used to optimize performance.\n","project":"mobx"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a button with the text '🔀' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\\\d]{12}', digits in title is random. \n2) Ensure the page will not be stuck when 100000 blogs are appended. \nConstraint: DO NOT USE any third-party packages, ONLY React/MobX APIs can be used to optimize performance.\n","project":"mobx"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. \n2) Develop a utility to reuse Markdown-related logic. \n3) Prevent XSS attacks. \nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n","project":"mobx"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Implement user login, logout, and display blog poster's username.\n\n 1) Login API:\nPOST /api/login\nRequest: { username: string, password: string }\nResponse: { success: boolean }\n2) On the /login page, add a LoginForm with labels(label[htmlFor=\"username\"], label[htmlFor=\"password\"]), and a .login-submit-btn to submit the form via the Login API.\n3) Display the user's username in Header.tsx with the class '.username'.\n4) Show the blog author's username with the class '.blog-author'. If blog has no author, display 'Anonymous'.\n5) Add a '👋' Logout button (class '.logout-btn') next to the username in Header.tsx. Clicking it logs the user out.\n6) Use MobX to manage user states.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n","project":"mobx"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement blog comment feature:\n1) Display commenter's username with class '.comment-author' and text with '.comment-text'.\n2) Add a CommentForm with a '.comment-input' textarea and a '.comment-submit-btn' below each blog.\n3) Use MobX to manage comments.\n4) Add undo functionality via Ctrl+Z (Windows/Linux) or Command+Z (Mac) to remove the last comment.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n","project":"mobx"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Write a Gomoku chess game in route: '/game'\n1) Add a button with the text '🎮' in Header, when clicked, jump to new page '/game'\n2) chess board is 15*15, there is black chess and white chess, black chess first \n3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\\\d{1,2}-d\\\\{1,2}. \n4) show 'White's Turn' and 'Black'Turn' to shw current player \n5) show 'White Wins!' and 'Black Wins!'.\n6) Use MobX to manage the game logic. Beautify this game \nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted.\n","project":"mobx"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Enhance the Gomoku game with multi-step undo functionality.\n1) Implement keyboard shortcut (Ctrl+Z on Windows/Linux or Command+Z on Mac) to trigger the undo action.\n2) Allow multiple consecutive undos to revert the game state to any previous point.\n3) Add a move history display with className '.move-history' showing all moves in the format \"White: (x,y)\" or \"Black: (x,y)\".\n4) Each history item should have className '.history-item'.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic;\n","project":"mobx"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Implement a recording and replay system for Gomoku games.\n1) Every games will be auto recorded, and can be replayed by play button (.replay-play-btn) after the game is finished. \n2) Add play/pause button (className '.replay-play-btn', '.replay-pause-btn') and a slider (className '.replay-slider') to navigate through game moves.\n3) When replaying, show the current move number with className '.current-move'. \n4) There is an interval of 1000 ms between each move.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic;\n","project":"mobx"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Create functionality to share Gomoku games as blog posts.\n1) Shows the \"Share to Blog\" button with className '.share-to-blog-btn' in the Gomoku game after the game is finished.\n2) When clicked, open a modal form (className '.share-modal') with title input (className '.title-input'), description input (className '.description-input'), submit button (className '.share-submit').\nGo to home page ('/') after submitted.\n3) In Blog Detail, detect if a blog contains a Gomoku game recording and display a \"Replay Game\" button (className '.blog-replay-btn').\n4) When the replay button is clicked, show a modal (className '.blog-replay-modal') with the full game replay interface.\n5) The replay interface should include the start play button (className '.blog-replay-start-play'), showing the current move number with className '.current-move'. There is an interval of 1000 ms between each move. \nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic.\n","project":"mobx"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new page '/rooms':\n1) Add a button with the text '🚪' in Header, when clicked, jump to new page '/rooms'\n2) Add a \"Create Room\" button with className '.create-room-btn' that opens a room creation form.\n3) The room creation form should include a labeled input field for room name (\"Room Name\") and a \"Create\" button to submit the form and create a new game room with a unique ID. Don't enter the room instantly.\n4) Each room should be displayed as a card with className '.room-card' showing room name, creator's username, and current status.\n5) Sync room status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the state and sync logic.\n","project":"mobx"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Implement a multi-user chat system based on rooms\n1) When a user clicks on a chat room card (with className '.room-card'), navigate to '/chat/:roomId' route.\n2) The chat room page ('/chat/:roomId') contains a message list (className '.message-list'), status display (in '.room-status'), and participant information (display all participants' usernames in '.participant-list').\n3) Implement message sending and receiving functionality, including a message input box (className '.message-input') and a send button (className '.send-button').\n4) Each message (className .message) should contains the sender's information (className '.message-sender').\n5) If the user enters the chat room, add this user to .participant-list.\n6) User will send heartbeat to check if user is in chat room, if the user is not active for 2000ms, the user will be removed from .participant-list.\n7) Sync chat room status, messages, and user connection status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/MobX APIs are permitted; Use MobX to manage the logic.\n","project":"mobx"} \ No newline at end of file diff --git a/datasets/nextjs.jsonl b/datasets/nextjs.jsonl index 907c7aecd7f51208f69b2beb69d8487aa79f7163..bae281524ea8dcce51765677b539e35b246cc4d4 100644 --- a/datasets/nextjs.jsonl +++ b/datasets/nextjs.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'. 2) Add className 'site-header' to header and 'site-footer' to footer. 3) Create app/layout.tsx to implement this feature. 4) header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space. 5) create app/layout.css and import it in app/layout.tsx to beautify CSS."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag. add button(.not-found-go-to-home) to navigate to '/' 2) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/' 3) create app/not-found.css to beautify CSS."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3. 2) add libs/setup.sql to create tables for products (id, name, price, image, description, quantity). 3) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 4) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css file to beautify CSS."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css file to beautify CSS. 5) If Not Found, show 'Product Not Found'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Create User Table, setup User Table with two initial users: 1. username: admin, password: 123456, role: admin, coin: 0 2. username: user, password: 123456, role: user, coin: 1000; 2) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 3) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth 4) create css file to beautify CSS."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) Add Server Action to handle register form submission, the initial coin for new user is 1000 7) create CSS file to beautify CSS."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create CSS file to beautify CSS. DO NOT use a third-party UI library."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username) on the right side of the site header. 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Create CSS file to beautify CSS. DO NOT use a third-party UI library."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create CSS file to beautify CSS."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag","project":"nextjs"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'. 2) Add className 'site-header' to header and 'site-footer' to footer. 3) Create app/layout.tsx to implement this feature. 4) header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space. 5) create app/layout.css and import it in app/layout.tsx to beautify CSS.","project":"nextjs"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag. add button(.not-found-go-to-home) to navigate to '/' 2) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/' 3) create app/not-found.css to beautify CSS.","project":"nextjs"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3. 2) add libs/setup.sql to create tables for products (id, name, price, image, description, quantity). 3) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 4) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully.","project":"nextjs"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css file to beautify CSS.","project":"nextjs"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css file to beautify CSS. 5) If Not Found, show 'Product Not Found'.","project":"nextjs"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Create User Table, setup User Table with two initial users: 1. username: admin, password: 123456, role: admin, coin: 0 2. username: user, password: 123456, role: user, coin: 1000; 2) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 3) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour.","project":"nextjs"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth 4) create css file to beautify CSS.","project":"nextjs"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) Add Server Action to handle register form submission, the initial coin for new user is 1000 7) create CSS file to beautify CSS.","project":"nextjs"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create CSS file to beautify CSS. DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username) on the right side of the site header. 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Create CSS file to beautify CSS. DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC.","project":"nextjs"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create CSS file to beautify CSS.","project":"nextjs"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nextjs"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library.","project":"nextjs"} \ No newline at end of file diff --git a/datasets/nosql.jsonl b/datasets/nosql.jsonl index ed37267ff00206963ec91694ff5f39bdb5b58006..85026a6c0e6296a3d4328a967abc5b405551c0db 100644 --- a/datasets/nosql.jsonl +++ b/datasets/nosql.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts) 2) in this api, return a string list in body to get all usernames in User Model (model/user.ts), example: ['user1', 'user2'] 3) Hint: import User from '@/model/user' to get Model of User and get usernames by mongoose API"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) add model/product.ts to create mongoose Model for products (id, name, price, image, description, quantity). 2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 3) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id 2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}, when product not found, return { success: true, data: null } 3) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when updated successfully 4) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css file to beautify CSS."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css file to beautify CSS. 5) If Not Found, show 'Product Not Found'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 3) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth 4) create css file to beautify CSS."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) Add Server Action to handle register form submission, the initial coin for new user is 1000 7) create CSS file to beautify CSS."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create CSS file to beautify CSS. DO NOT use a third-party UI library."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username) on the right side of the site header. 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Create CSS file to beautify CSS. DO NOT use a third-party UI library."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create CSS file to beautify CSS."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag","project":"nosql"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts) 2) in this api, return a string list in body to get all usernames in User Model (model/user.ts), example: ['user1', 'user2'] 3) Hint: import User from '@/model/user' to get Model of User and get usernames by mongoose API","project":"nosql"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) add model/product.ts to create mongoose Model for products (id, name, price, image, description, quantity). 2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 3) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully.","project":"nosql"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id 2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}, when product not found, return { success: true, data: null } 3) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when updated successfully 4) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)","project":"nosql"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css file to beautify CSS.","project":"nosql"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css file to beautify CSS. 5) If Not Found, show 'Product Not Found'.","project":"nosql"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 3) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour.","project":"nosql"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth 4) create css file to beautify CSS.","project":"nosql"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) Add Server Action to handle register form submission, the initial coin for new user is 1000 7) create CSS file to beautify CSS.","project":"nosql"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create CSS file to beautify CSS. DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username) on the right side of the site header. 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Create CSS file to beautify CSS. DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC.","project":"nosql"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create CSS file to beautify CSS.","project":"nosql"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"nosql"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library.","project":"nosql"} \ No newline at end of file diff --git a/datasets/nuxt.jsonl b/datasets/nuxt.jsonl index bd0f7a2058e2cc08740102abc0e2cc3224280346..86b89d9b183ee817a2be64f333947f7deaa81939 100644 --- a/datasets/nuxt.jsonl +++ b/datasets/nuxt.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create home page (pages/index.vue) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) Create login page (pages/login.vue) at route '/login' showing '💡 Please Login First' in h1 tag\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'\n2) Add class 'site-header' to header and 'site-footer' to footer\n3) Create layouts/default.vue to implement this feature\n4) Header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space\n5) Add style section in layouts/default.vue to implement the layout CSS\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag\n2) Add button(.not-found-go-to-home) to navigate to '/'\n3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/'\n4) Add Style to beautify UI\n5) 404 Page share the same layout with other pages\n6) Hint: error.vue in the root dir can handle 404, NuxtLayout can be used to implement layout in error page\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3\n2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity)\n3) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n5) GET /api/products to fetch all products\n6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) Add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) Add Style to beautify UI\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /products page, When .product-card clicked, goto related product detail page\n4) Add Style to beautify UI\n5) If Not Found, show 'Product Not Found'\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Create User Table, setup User Table with two initial users:\n - username: admin, password: 123456, role: admin, coin: 0\n - username: user, password: 123456, role: user, coin: 1000\n2) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true }\n3) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status\n4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side, create a new Server Route (server/api/auth.ts) to get current auth\n4) Add Style to beautify UI\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) Add Server Route to handle register form submission, the initial coin for new user is 1000\n7) Add Style to beautify UI\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Add Style to beautify UI\n6) DO NOT use a third-party UI library\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.vue:\n - If not logged in, display a button (.header-go-login) that navigates to /login\n - If logged in, display the username (.header-username) on the right side of the site header\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - A button (.header-logout-btn) for logging out\n - A button (.header-go-user-profile) for navigating to the current user's profile page\n3) Add Style to beautify UI\n4) DO NOT use a third-party UI library\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) Button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Add Style to beautify UI\n5) DO NOT use a third-party UI library\n6) Keep profile page STATIC\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, Redirect to /login if no privilege\n6) Add Style to beautify UI\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) Structure wishlist items as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create assets/css/wishlist.css to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.vue, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) In the Detail Page, add an .add-to-cart-button\n5) When clicked, add this product to the cart\n6) Store Cart Info in the DB for the current User\n7) Place Shopping Cart which can be seen in every page in the right-bottom of page\n8) Add Style to beautify UI\n9) DO NOT use a third-party UI library\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.vue, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Add Style to beautify UI\n10) DO NOT use a third-party UI library\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - The status of the order becomes 'Finished'\n - The Coin is paid from current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Add Style to beautify UI\n6) DO NOT use a third-party UI library\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - Update the order status to 'Refund Passed'\n - Ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Add Style to beautify UI\n8) DO NOT use a third-party UI library\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - The username\n - The rating\n - The comment text\n6) Style using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating(with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Add Style to beautify UI\n9) DO NOT use a third-party UI library\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Add Style to beautify UI\n6) DO NOT use a third-party library\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create home page (pages/index.vue) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) Create login page (pages/login.vue) at route '/login' showing '💡 Please Login First' in h1 tag\n","project":"nuxt"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Every page in this app will have a appealing header showing '🛍️ WebBench Shopping Mart', and a beautiful footer showing 'Copyright: Web Bench'\n2) Add class 'site-header' to header and 'site-footer' to footer\n3) Create layouts/default.vue to implement this feature\n4) Header is fixed at the page top; footer is fixed at the page bottom; main(children) occupies the remaining space\n5) Add style section in layouts/default.vue to implement the layout CSS\n","project":"nuxt"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) If Page Not Found, shows 'Oops! Looks like you have wandered off the beaten path.' in h1 tag\n2) Add button(.not-found-go-to-home) to navigate to '/'\n3) When click '🛍️ WebBench Shopping Mart' in header, navigate to '/'\n4) Add Style to beautify UI\n5) 404 Page share the same layout with other pages\n6) Hint: error.vue in the root dir can handle 404, NuxtLayout can be used to implement layout in error page\n","project":"nuxt"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create libs/db.ts to export a new sqlite3.Database(process.env.DB_HOST!) by node-sqlite3\n2) Add libs/setup.sql to create tables for products (id, name, price, image, description, quantity)\n3) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n4) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n5) GET /api/products to fetch all products\n6) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n","project":"nuxt"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) Add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) Add Style to beautify UI\n","project":"nuxt"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /products page, When .product-card clicked, goto related product detail page\n4) Add Style to beautify UI\n5) If Not Found, show 'Product Not Found'\n","project":"nuxt"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Create User Table, setup User Table with two initial users:\n - username: admin, password: 123456, role: admin, coin: 0\n - username: user, password: 123456, role: user, coin: 1000\n2) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true }\n3) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status\n4) Use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n","project":"nuxt"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) On successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side, create a new Server Route (server/api/auth.ts) to get current auth\n4) Add Style to beautify UI\n","project":"nuxt"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) Add Server Route to handle register form submission, the initial coin for new user is 1000\n7) Add Style to beautify UI\n","project":"nuxt"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Add Style to beautify UI\n6) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.vue:\n - If not logged in, display a button (.header-go-login) that navigates to /login\n - If logged in, display the username (.header-username) on the right side of the site header\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - A button (.header-logout-btn) for logging out\n - A button (.header-go-user-profile) for navigating to the current user's profile page\n3) Add Style to beautify UI\n4) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) Button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Add Style to beautify UI\n5) DO NOT use a third-party UI library\n6) Keep profile page STATIC\n","project":"nuxt"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, Redirect to /login if no privilege\n6) Add Style to beautify UI\n","project":"nuxt"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) Structure wishlist items as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create assets/css/wishlist.css to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.vue, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) In the Detail Page, add an .add-to-cart-button\n5) When clicked, add this product to the cart\n6) Store Cart Info in the DB for the current User\n7) Place Shopping Cart which can be seen in every page in the right-bottom of page\n8) Add Style to beautify UI\n9) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) When clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.vue, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Add Style to beautify UI\n10) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - The status of the order becomes 'Finished'\n - The Coin is paid from current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Add Style to beautify UI\n6) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - Update the order status to 'Refund Passed'\n - Ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Add Style to beautify UI\n8) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - The username\n - The rating\n - The comment text\n6) Style using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating(with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Add Style to beautify UI\n9) DO NOT use a third-party UI library\n","project":"nuxt"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) Explain the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Add Style to beautify UI\n6) DO NOT use a third-party library\n","project":"nuxt"} \ No newline at end of file diff --git a/datasets/parcel.jsonl b/datasets/parcel.jsonl index bda1382bc731a6d84996c3e093c28f05fd23a97d..5740a1ee183687faa4f9529dbaca34f7262fdcd7 100644 --- a/datasets/parcel.jsonl +++ b/datasets/parcel.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Setup project with parcel. Here are the requirements:\n- Add dev and build to npm scripts.\n- Set dev server port to environment variable `process.env.PROJECT_PORT`.\n- Generate sourceMap after bundling(If parcel generates sourceMap by default, then you don't need to do anything here).\n- Set output directory to `dist` for build command.\n- Set output directory to `dist-serve` for dev command.\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Add path alias `@` for `src`.\n\nBesides this:\nAdd `import alias from '@/alias'` in `src/index.js`.\nDisplay `alias` value in `src/index.js`.\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Setup global constants replacement for process.env.__VERSION__ via bundler capability.\nprocess.env.__VERSION__ should be replaced with \"v1.0.0\" during bundling.\n\nBesides this:\n- Add `import './version'` in `src/index.js`.\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"I want to write a Single Page Application.\nWhen visiting non-existent page, dev server should fallback to `index.html`.\nIf it's already the default behavior in parcel, do nothing.\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"My targeting browsers support `?.` (Optional Chaining Operator), so I want to keep this syntax as is after bundling.\nTry to address it.\n"} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"I want to proxy every request prefixed with `/postman/` to `https://postman-echo.com` in dev server.\nFor example, request to `/postman/get` will be forwarded to `https://postman-echo.com/get`.\nTry to address it using .proxyrc.js.\n"} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"Add `import bird from './images/bird.png'` in `src/index.js`.\nUpdate `src/index.js` to display the png image in element with id `bird`.\n\nAdd `import svg from './images/TablerAntennaBars5.svg'` in `src/index.js`.\nUpdate `src/index.js` to display the svg image in element with id `svg`.\n\nUpdate bundler configuration if necessary.\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Add `import './index.css'` in `src/index.js`.\nDisplay text `hello css` in div with CSS class `.css` in `src/index.js`.\n\nAdd `import './index.less'` in `src/index.js`.\nDisplay text `hello less` in div with CSS class `.less` in `src/index.js`.\n\nAdd `import lessStyles from './index.module.less'` in `src/index.js`.\nDisplay text `hello less modules` in div with CSS class referencing to variable`lessStyles.lessModules` in `src/index.js`.\n\nAlso help me update other files in this project to ensure `dev` and `build` commands won't throw errors after doing that.\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add `import ts from './index.ts'` in `src/index.js`.\nDisplay `ts()` return value in `src/index.js`.\n\nAlso help me update other files in this project to ensure `dev` and `build` commands won't throw errors after doing that.\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Add `import VueComponent from './component.vue';` in `src/index.js`.\nMount VueComponent in `src/index.js`.\n\nAdd `import ReactComponent from './component.jsx'` in `src/index.js`.\nMount ReactComponent in `src/index.js`.\n\nDO NOT use jsx syntax.\n\nAlso help me update other files in this project to ensure `dev` and `build` commands won't throw errors after doing that.\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"I want to do something with sourcemap files in output directory.\nImplement this as a local parcel reporter plugin.\n\n## Requirements\n- Move all sourcemap files into `/sourcemaps` after build.\n- Add `//# sourceMappingURL=https://internal.com/sourcemaps/` at the end of original js file.\n\n## Examples\nAssume we have following files in dist directory before moving:\n- dist/assets/index.js\n- dist/assets/index.js.map\n- dist/assets/index.css\n- dist/assets/index.css.map\n\nAfter moving, the files should be:\n- dist/assets/index.js\n- dist/assets/index.css\n- sourcemaps/assets/index.js.map\n- sourcemaps/assets/index.css.map\n\nAnd the `dist/assets/index.js` should contain the following content at its end(Using JS comment):\n//# sourceMappingURL=https://internal.com/sourcemaps/assets/index.js.map\n\nAnd the `dist/assets/index.css` should contain the following content at its end(Using CSS comment):\n/*# sourceMappingURL=https://internal.com/sourcemaps/assets/index.css.map */\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Update the bundler configuration to remove all `console.log` call expression after running build command.\nDONOT use terser or other compressor tool, implement it on your own locally.\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"During bundling, extract all license information into `dist/vendor-licenses.txt` from all npm packages imported directly or transitively in source file.\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement dynamical generation of in-memory virtual modules as a parcel plugin.\n\nFor example:\n\nsrc/files/a.ts\n```js\nexport default 'a'\n```\n\nsrc/files/b.ts\n```js\nexport default 'b'\n```\n\nsrc/index.js\n```js\nimport files from '~files'\nfiles.a.default // should be 'a'\nfiles.b.default // should be 'b'\n```\n\nYou can hardcode `src/files` and `~files` as a builtin rule when implementing this.\n\nBesides this\n- Add `import files from '~files'` in `src/index.js`\n- Display JSON stringified files(without any whitespaces) in div element in `src/index.js`\n"} -{"id":"task-15","date":"2025-05-12","level":"moderate","description":"I have some mock data in `/mock.json`, setup dev server to return them as mock data.\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Implement an image compression plugin for bundler, only for build command\n"} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"I want to import markdown files directly, and get rendered html by importing them.\nFor example:\n```js\nimport md from './hello.md'\n```\n\nThe `md` variable is expected to be a html string rendered by its markdown content.\n\nImplement this in a local parcel plugin.\n\nBesides this:\n- Add `import md from './hello.md'` in `src/index.js`.\n- Display `md` inside a div in `src/index.js`.\n"} -{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Supporting importing frontmatter from markdown files.\n\nFor example:\n\nhello.md\n```md\n---\nauthor: hello\ntags:\n - foo\n - bar\n---\n\n## Markdown Heading\n```\n\nindex.js\n```js\nimport md, { frontmatter } from './hello.md'\n\nfrontmatter.author // should be \"hello\"\nfrontmatter.tags // should be [\"foo\", \"bar\"]\n```\n\nBesides this\n- Update `import md from './hello.md'` to `import md, { frontmatter } from './hello.md'` in `src/index.js`.\n- Display `frontmatter.author` in div element in `src/index.js`\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new feature for markdown parcel plugin.\nWhen markdown content includes images, the images should be recognized as dependency of markdown file.\nImage url in rendered html string should reference to the image in output directory.\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add `language` option for markdown parcel plugin\n\nFor example:\n```js\nimport md from './hello.md'\n```\nIf langauge is 'en', `./hello.md` will resolved to `./hello.en.md` if it exists.\nIf langauge is 'zh', `./hello.md` will resolved to `./hello.zh.md` if it exists.\nIf both `./hello.en.md` and `./hello.zh.md` are not found, fallback to its original path `./hello.md`\n\nBesides this, set language=\"zh\" as default value.\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Setup project with parcel. Here are the requirements:\n- Add dev and build to npm scripts.\n- Set dev server port to environment variable `process.env.PROJECT_PORT`.\n- Generate sourceMap after bundling(If parcel generates sourceMap by default, then you don't need to do anything here).\n- Set output directory to `dist` for build command.\n- Set output directory to `dist-serve` for dev command.\n","project":"parcel"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Add path alias `@` for `src`.\n\nBesides this:\nAdd `import alias from '@/alias'` in `src/index.js`.\nDisplay `alias` value in `src/index.js`.\n","project":"parcel"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Setup global constants replacement for process.env.__VERSION__ via bundler capability.\nprocess.env.__VERSION__ should be replaced with \"v1.0.0\" during bundling.\n\nBesides this:\n- Add `import './version'` in `src/index.js`.\n","project":"parcel"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"I want to write a Single Page Application.\nWhen visiting non-existent page, dev server should fallback to `index.html`.\nIf it's already the default behavior in parcel, do nothing.\n","project":"parcel"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"My targeting browsers support `?.` (Optional Chaining Operator), so I want to keep this syntax as is after bundling.\nTry to address it.\n","project":"parcel"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"I want to proxy every request prefixed with `/postman/` to `https://postman-echo.com` in dev server.\nFor example, request to `/postman/get` will be forwarded to `https://postman-echo.com/get`.\nTry to address it using .proxyrc.js.\n","project":"parcel"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"Add `import bird from './images/bird.png'` in `src/index.js`.\nUpdate `src/index.js` to display the png image in element with id `bird`.\n\nAdd `import svg from './images/TablerAntennaBars5.svg'` in `src/index.js`.\nUpdate `src/index.js` to display the svg image in element with id `svg`.\n\nUpdate bundler configuration if necessary.\n","project":"parcel"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Add `import './index.css'` in `src/index.js`.\nDisplay text `hello css` in div with CSS class `.css` in `src/index.js`.\n\nAdd `import './index.less'` in `src/index.js`.\nDisplay text `hello less` in div with CSS class `.less` in `src/index.js`.\n\nAdd `import lessStyles from './index.module.less'` in `src/index.js`.\nDisplay text `hello less modules` in div with CSS class referencing to variable`lessStyles.lessModules` in `src/index.js`.\n\nAlso help me update other files in this project to ensure `dev` and `build` commands won't throw errors after doing that.\n","project":"parcel"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Add `import ts from './index.ts'` in `src/index.js`.\nDisplay `ts()` return value in `src/index.js`.\n\nAlso help me update other files in this project to ensure `dev` and `build` commands won't throw errors after doing that.\n","project":"parcel"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Add `import VueComponent from './component.vue';` in `src/index.js`.\nMount VueComponent in `src/index.js`.\n\nAdd `import ReactComponent from './component.jsx'` in `src/index.js`.\nMount ReactComponent in `src/index.js`.\n\nDO NOT use jsx syntax.\n\nAlso help me update other files in this project to ensure `dev` and `build` commands won't throw errors after doing that.\n","project":"parcel"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"I want to do something with sourcemap files in output directory.\nImplement this as a local parcel reporter plugin.\n\n## Requirements\n- Move all sourcemap files into `/sourcemaps` after build.\n- Add `//# sourceMappingURL=https://internal.com/sourcemaps/` at the end of original js file.\n\n## Examples\nAssume we have following files in dist directory before moving:\n- dist/assets/index.js\n- dist/assets/index.js.map\n- dist/assets/index.css\n- dist/assets/index.css.map\n\nAfter moving, the files should be:\n- dist/assets/index.js\n- dist/assets/index.css\n- sourcemaps/assets/index.js.map\n- sourcemaps/assets/index.css.map\n\nAnd the `dist/assets/index.js` should contain the following content at its end(Using JS comment):\n//# sourceMappingURL=https://internal.com/sourcemaps/assets/index.js.map\n\nAnd the `dist/assets/index.css` should contain the following content at its end(Using CSS comment):\n/*# sourceMappingURL=https://internal.com/sourcemaps/assets/index.css.map */\n","project":"parcel"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Update the bundler configuration to remove all `console.log` call expression after running build command.\nDONOT use terser or other compressor tool, implement it on your own locally.\n","project":"parcel"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"During bundling, extract all license information into `dist/vendor-licenses.txt` from all npm packages imported directly or transitively in source file.\n","project":"parcel"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement dynamical generation of in-memory virtual modules as a parcel plugin.\n\nFor example:\n\nsrc/files/a.ts\n```js\nexport default 'a'\n```\n\nsrc/files/b.ts\n```js\nexport default 'b'\n```\n\nsrc/index.js\n```js\nimport files from '~files'\nfiles.a.default // should be 'a'\nfiles.b.default // should be 'b'\n```\n\nYou can hardcode `src/files` and `~files` as a builtin rule when implementing this.\n\nBesides this\n- Add `import files from '~files'` in `src/index.js`\n- Display JSON stringified files(without any whitespaces) in div element in `src/index.js`\n","project":"parcel"} +{"id":"task-15","date":"2025-05-12","level":"moderate","description":"I have some mock data in `/mock.json`, setup dev server to return them as mock data.\n","project":"parcel"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Implement an image compression plugin for bundler, only for build command\n","project":"parcel"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"I want to import markdown files directly, and get rendered html by importing them.\nFor example:\n```js\nimport md from './hello.md'\n```\n\nThe `md` variable is expected to be a html string rendered by its markdown content.\n\nImplement this in a local parcel plugin.\n\nBesides this:\n- Add `import md from './hello.md'` in `src/index.js`.\n- Display `md` inside a div in `src/index.js`.\n","project":"parcel"} +{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Supporting importing frontmatter from markdown files.\n\nFor example:\n\nhello.md\n```md\n---\nauthor: hello\ntags:\n - foo\n - bar\n---\n\n## Markdown Heading\n```\n\nindex.js\n```js\nimport md, { frontmatter } from './hello.md'\n\nfrontmatter.author // should be \"hello\"\nfrontmatter.tags // should be [\"foo\", \"bar\"]\n```\n\nBesides this\n- Update `import md from './hello.md'` to `import md, { frontmatter } from './hello.md'` in `src/index.js`.\n- Display `frontmatter.author` in div element in `src/index.js`\n","project":"parcel"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new feature for markdown parcel plugin.\nWhen markdown content includes images, the images should be recognized as dependency of markdown file.\nImage url in rendered html string should reference to the image in output directory.\n","project":"parcel"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add `language` option for markdown parcel plugin\n\nFor example:\n```js\nimport md from './hello.md'\n```\nIf langauge is 'en', `./hello.md` will resolved to `./hello.en.md` if it exists.\nIf langauge is 'zh', `./hello.md` will resolved to `./hello.zh.md` if it exists.\nIf both `./hello.en.md` and `./hello.zh.md` are not found, fallback to its original path `./hello.md`\n\nBesides this, set language=\"zh\" as default value.\n","project":"parcel"} \ No newline at end of file diff --git a/datasets/prisma.jsonl b/datasets/prisma.jsonl index a5a073683da38f73329eaf7e860153725130382d..6f22390b0fe5c26ec7cd5c77f849ea3775b85ed6 100644 --- a/datasets/prisma.jsonl +++ b/datasets/prisma.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts)\n2) in this api, return a string list in body to get all usernames by User Model (prisma.user), example: ['user1', 'user2']\n3) Hint: import { prisma } from '@/libs/db', use prisma.user and get user model by prisma API\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) add product model schema in prisma/schema.prisma\n2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n3) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n4) GET /api/products to fetch all products\n5) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n3) Hint: import { prisma } from '@/libs/db', use prisma.product and get product model by prisma API\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id\n2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}\n3) when product not found, return { success: true, data: null }\n4) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n5) Return { success: true, data: {'id': 'xxxx' } } when updated successfully\n6) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) create css file to beautify CSS\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /product page, When .product-card clicked, goto related product detail page\n4) create css file to beautify CSS\n5) If Not Found, show 'Product Not Found'\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } \n2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}\n3) if not login, return 401 status\n4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}\n5) secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth\n4) create css file to beautify CSS\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) Add Server Action to handle register form submission, the initial coin for new user is 1000\n7) create CSS file to beautify CSS\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS file to beautify CSS\n6) DO NOT use a third-party UI library\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx:\n - if not logged in, display a button (.header-go-login) that navigates to /login\n - if logged in, display the username (.header-username) on the right side of the site header\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - a button (.header-logout-btn) for logging out\n - a button (.header-go-user-profile) for navigating to the current user's profile page\n3) Create CSS file to beautify CSS\n4) DO NOT use a third-party UI library\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS file to beautify CSS\n5) DO NOT use a third-party UI library\n6) Keep profile page STATIC\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every product and user is wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) On the Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, Redirect to /login if there is no privilege\n6) Create CSS files to beautify CSS\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) structured as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) On the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart\n5) Store Cart Info in the DB for the current User\n6) Place Shopping Cart which can be seen in every page in the right-bottom of page\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - the status of the order becomes 'Finished'\n - the Coin is paid by current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - update the order status to 'Refund Passed'\n - ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - the username\n - the rating\n - the comment text\n6) styled using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating(with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party library\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag\n2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag\n","project":"prisma"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts)\n2) in this api, return a string list in body to get all usernames by User Model (prisma.user), example: ['user1', 'user2']\n3) Hint: import { prisma } from '@/libs/db', use prisma.user and get user model by prisma API\n","project":"prisma"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) add product model schema in prisma/schema.prisma\n2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n3) Return { success: true, data: {'id': 'xxxx' } } when inserted successfully\n4) GET /api/products to fetch all products\n5) Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully\n3) Hint: import { prisma } from '@/libs/db', use prisma.product and get product model by prisma API\n","project":"prisma"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id\n2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}\n3) when product not found, return { success: true, data: null }\n4) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100})\n5) Return { success: true, data: {'id': 'xxxx' } } when updated successfully\n6) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)\n","project":"prisma"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price)\n2) UI Structure For Product Cards:
{{name}}
{{price}}
\n3) add a button (.home-go-products-link) in home page to navigate to '/products'\n4) .product-card is wrapped in .product-list\n5) create css file to beautify CSS\n","project":"prisma"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id'\n2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description\n3) In /product page, When .product-card clicked, goto related product detail page\n4) create css file to beautify CSS\n5) If Not Found, show 'Product Not Found'\n","project":"prisma"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } \n2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}\n3) if not login, return 401 status\n4) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}\n5) secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour\n","project":"prisma"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn)\n2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message\n3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth\n4) create css file to beautify CSS\n","project":"prisma"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing:\n - username (input.username)\n - password (input.password)\n - confirm password input (input.confirm-password)\n - submit button (.register-button)\n2) Show error messages in .error-message div for validation failures, error text is:\n - 'Passwords must match'\n - 'Username already exists'\n3) Redirect to home page and auto login when register successful\n4) Add .login-link, clicked to /login\n5) Add a .register-link in /login page, clicked to /register\n6) Add Server Action to handle register form submission, the initial coin for new user is 1000\n7) create CSS file to beautify CSS\n","project":"prisma"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI:\n - h1.profile-username\n - .profile-coin\n2) Users can only visit their own profile, and Admins can visit the profiles of all people\n3) If the privilege is violated, redirect to the /login page\n4) If User not found, shows User not found\n5) Create CSS file to beautify CSS\n6) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx:\n - if not logged in, display a button (.header-go-login) that navigates to /login\n - if logged in, display the username (.header-username) on the right side of the site header\n2) If user is logged in, when the .header-username is hovered, show a dropdown menu with:\n - a button (.header-logout-btn) for logging out\n - a button (.header-go-user-profile) for navigating to the current user's profile page\n3) Create CSS file to beautify CSS\n4) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page\n2) button is only visible when the user of the profile is current user\n3) When Recharge Button clicked, recharge 1000 coin\n4) Create CSS file to beautify CSS\n5) DO NOT use a third-party UI library\n6) Keep profile page STATIC\n","project":"prisma"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'\n2) Every product and user is wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively\n3) Display the full information of products and users in table rows\n4) On the Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals\n5) For any route inside /admin, Redirect to /login if there is no privilege\n6) Create CSS files to beautify CSS\n","project":"prisma"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page\n2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added\n3) structured as
\n4) Add functionality to remove items from wishlist with button (.remove-from-wishlist)\n5) Store wishlist items in the database\n6) Add button (.home-go-wish-list) in home page to navigate to '/wishlist'\n7) Create CSS file to beautify the Wishlist UI\n8) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart\n2) When clicked, it shows a popover of all items in the cart\n3) Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id}\n4) On the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart\n5) Store Cart Info in the DB for the current User\n6) Place Shopping Cart which can be seen in every page in the right-bottom of page\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart\n2) when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity\n3) When Order created, redirect to /order/:order-id\n4) When Order created, clear Cart\n5) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx, when clicked, go to the Orders Page of the current user\n6) Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}\n7) Clicking on an order should jump to the order detail page at /order/:order-id\n8) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}, display the order price and order status\n9) Create CSS files to beautify CSS\n10) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id\n2) Button is visible when the status is 'Pending payment'\n3) When .pay-my-order is clicked:\n - the status of the order becomes 'Finished'\n - the Coin is paid by current user\n - Decrease product quantity\n4) If payment fails, update the order status to 'Failed'\n5) Create CSS files to beautify CSS\n6) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid\n2) When .refund-button is clicked, change the order status to 'Refund Reviewing'\n3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}\n4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'\n5) When .pass-refund-review-button is clicked:\n - update the order status to 'Refund Passed'\n - ensure that the Coin is refunded to the user's account\n6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders\n7) Create CSS files to beautify CSS\n8) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction\n2) Store comments in DB\n3) On the product detail page, display the average rating of the product at the top, using classNames:\n - .product-average-rating (with number inside)\n4) When a user has purchased the product, display a form on the product page with classNames:\n - .comment-form\n - .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star)\n - .comment-textarea\n - .comment-submit-button\n5) Display all comments in a list on the product page, with each comment showing:\n - the username\n - the rating\n - the comment text\n6) styled using classNames:\n - .comment-item\n - .comment-username\n - .comment-rating(with number inside)\n - .comment-text\n7) Every User can ONLY comment a product for one time\n8) Create CSS files to beautify CSS\n9) DO NOT use a third-party UI library\n","project":"prisma"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page\n2) explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.'\n3) The system should automatically credit the referring user with reward by this rule\n4) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration\n5) Create CSS files to beautify the invitation system, ensuring a cohesive look\n6) DO NOT use a third-party library\n","project":"prisma"} \ No newline at end of file diff --git a/datasets/react-no-ts.jsonl b/datasets/react-no-ts.jsonl index 84e7f7fe5f910f925feb7ea19369f0afcdc0eace..4fe8fdcafcc6f2f0ce30af95c30b3882d1cee256 100644 --- a/datasets/react-no-ts.jsonl +++ b/datasets/react-no-ts.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.jsx that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/Main.jsx where content is aligned at the top left and fills the remaining space. 3) Develop components/Blog.jsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.jsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 4) Render Header.jsx And Main.jsx in App.jsx 4) The classname of title in Blog.jsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'. 2) In Main.jsx, mock the blog data and display it using BlogList with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position BlogList on the left side of Main.jsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One Blog.jsx occupies the remaining space of Main.jsx. The content of Blog.jsx should be from first item of the mock data."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of Header.jsx to toggle the BlogForm's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it. 4) Place the BlogForm component in App.jsx."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of BlogForm showing '0' initially. 2) Increment .visible-count by 1 each time BlogForm becomes visible."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); 2) When submitted, append this Blog to BlogList, and set this Blog as selected. Keep Previous MockData."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create context/BlogContext.jsx with React Context API to manage related context (blog list and selected blog) in App.jsx 2) When submit a new BlogForm, check title duplication. Constraint: The duplication check code should be written in BlogForm; 3) Add a span(.blog-list-len) near 'Hello Blog' in Header.jsx to show the length of blogs"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.jsx. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is encapsulated in a custom hook hooks/useDelete.jsx."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.jsx. When clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is encapsulated in a custom hook hooks/useEdit.jsx;"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a Search.jsx(width: 200px, border-box) component above BlogList.jsx in Main.jsx. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs."} -{"id":"task-11","date":"2025-05-12","level":"chanllenging","description":"1) Add a button with the text 'Random Blogs' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not be stuck when 100000 blogs are appended. 3) Constraint: DO NOT USE any third-party packages, ONLY React APIs can be used to optimize performance."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing Comments.jsx with the title 'Comments' at the bottom of Blog.jsx. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the className '.comment-item', placed above the TextArea. 4) Create store/Comment.jsx to implement CommentStore without ReactContext API、Redux、mobx etc., and connect CommentStore to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize React APIs."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.jsx that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are allowed."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.jsx. 2) Develop a hook or utility to reuse Markdown-related logic. 3) Prevent XSS attacks. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.jsx to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follow the rules, create reusable component. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in Header with text 'Fast Comment'. 2) When clicked, focus Textarea in Comments.jsx and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted. DO NOT use BOM API. DO NOT use DOM query API."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/Game.jsx with text 'Hello Game'. 2) Add router.jsx in to control the Route Logic: When browser location is '/', routed to App. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in App's Header.jsx to jump to Game page, and user can go back to App when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to shw current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse utils/toast.jsx to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.jsx that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/Main.jsx where content is aligned at the top left and fills the remaining space. 3) Develop components/Blog.jsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.jsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 4) Render Header.jsx And Main.jsx in App.jsx 4) The classname of title in Blog.jsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px","project":"react-no-ts"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'. 2) In Main.jsx, mock the blog data and display it using BlogList with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position BlogList on the left side of Main.jsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One Blog.jsx occupies the remaining space of Main.jsx. The content of Blog.jsx should be from first item of the mock data.","project":"react-no-ts"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item","project":"react-no-ts"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of Header.jsx to toggle the BlogForm's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it. 4) Place the BlogForm component in App.jsx.","project":"react-no-ts"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of BlogForm showing '0' initially. 2) Increment .visible-count by 1 each time BlogForm becomes visible.","project":"react-no-ts"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); 2) When submitted, append this Blog to BlogList, and set this Blog as selected. Keep Previous MockData.","project":"react-no-ts"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create context/BlogContext.jsx with React Context API to manage related context (blog list and selected blog) in App.jsx 2) When submit a new BlogForm, check title duplication. Constraint: The duplication check code should be written in BlogForm; 3) Add a span(.blog-list-len) near 'Hello Blog' in Header.jsx to show the length of blogs","project":"react-no-ts"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.jsx. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is encapsulated in a custom hook hooks/useDelete.jsx.","project":"react-no-ts"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.jsx. When clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is encapsulated in a custom hook hooks/useEdit.jsx;","project":"react-no-ts"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a Search.jsx(width: 200px, border-box) component above BlogList.jsx in Main.jsx. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs.","project":"react-no-ts"} +{"id":"task-11","date":"2025-05-12","level":"chanllenging","description":"1) Add a button with the text 'Random Blogs' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not be stuck when 100000 blogs are appended. 3) Constraint: DO NOT USE any third-party packages, ONLY React APIs can be used to optimize performance.","project":"react-no-ts"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing Comments.jsx with the title 'Comments' at the bottom of Blog.jsx. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the className '.comment-item', placed above the TextArea. 4) Create store/Comment.jsx to implement CommentStore without ReactContext API、Redux、mobx etc., and connect CommentStore to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize React APIs.","project":"react-no-ts"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.jsx that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are allowed.","project":"react-no-ts"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.jsx. 2) Develop a hook or utility to reuse Markdown-related logic. 3) Prevent XSS attacks. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react-no-ts"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.jsx to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react-no-ts"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follow the rules, create reusable component. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react-no-ts"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in Header with text 'Fast Comment'. 2) When clicked, focus Textarea in Comments.jsx and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted. DO NOT use BOM API. DO NOT use DOM query API.","project":"react-no-ts"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/Game.jsx with text 'Hello Game'. 2) Add router.jsx in to control the Route Logic: When browser location is '/', routed to App. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in App's Header.jsx to jump to Game page, and user can go back to App when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react-no-ts"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to shw current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse utils/toast.jsx to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react-no-ts"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react-no-ts"} \ No newline at end of file diff --git a/datasets/react.jsonl b/datasets/react.jsonl index 5c6d9ef7a81b276e51cd8d4b2d7709ee48c6e92a..279ecdfaeb31a6671eae94f049a799e44ea2f903 100644 --- a/datasets/react.jsonl +++ b/datasets/react.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. 3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 4) Render Header.tsx And Main.tsx in App.tsx 4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'. 2) In Main.tsx, mock the blog data and display it using BlogList with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be from first item of the mock data."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it. 4) Place the BlogForm component in App.tsx."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of BlogForm showing '0' initially. 2) Increment .visible-count by 1 each time BlogForm becomes visible."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); 2) When submitted, append this Blog to BlogList, and set this Blog as selected. Keep Previous MockData."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create context/BlogContext.tsx with React Context API to manage related context (blog list and selected blog) in App.tsx 2) When submit a new BlogForm, check title duplication. Constraint: The duplication check code should be written in BlogForm; 3) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is encapsulated in a custom hook hooks/useDelete.tsx."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. When clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is encapsulated in a custom hook hooks/useEdit.tsx;"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs."} -{"id":"task-11","date":"2025-05-12","level":"chanllenging","description":"1) Add a button with the text 'Random Blogs' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not be stuck when 100000 blogs are appended. 3) Constraint: DO NOT USE any third-party packages, ONLY React APIs can be used to optimize performance."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing Comments.tsx with the title 'Comments' at the bottom of Blog.tsx. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the className '.comment-item', placed above the TextArea. 4) Create store/Comment.tsx to implement CommentStore without ReactContext API、Redux、mobx etc., and connect CommentStore to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize React APIs."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.tsx that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are allowed."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. 2) Develop a hook or utility to reuse Markdown-related logic. 3) Prevent XSS attacks. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.tsx to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follow the rules, create reusable component. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in Header with text 'Fast Comment'. 2) When clicked, focus Textarea in Comments.tsx and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted. DO NOT use BOM API. DO NOT use DOM query API."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/Game.tsx with text 'Hello Game'. 2) Add router.tsx in to control the Route Logic: When browser location is '/', routed to App. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in App's Header.tsx to jump to Game page, and user can go back to App when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to shw current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse utils/toast.tsx to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. 3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 4) Render Header.tsx And Main.tsx in App.tsx 4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px","project":"react"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'. 2) In Main.tsx, mock the blog data and display it using BlogList with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be from first item of the mock data.","project":"react"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item","project":"react"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it. 4) Place the BlogForm component in App.tsx.","project":"react"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of BlogForm showing '0' initially. 2) Increment .visible-count by 1 each time BlogForm becomes visible.","project":"react"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); 2) When submitted, append this Blog to BlogList, and set this Blog as selected. Keep Previous MockData.","project":"react"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create context/BlogContext.tsx with React Context API to manage related context (blog list and selected blog) in App.tsx 2) When submit a new BlogForm, check title duplication. Constraint: The duplication check code should be written in BlogForm; 3) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs","project":"react"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is encapsulated in a custom hook hooks/useDelete.tsx.","project":"react"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. When clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is encapsulated in a custom hook hooks/useEdit.tsx;","project":"react"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs.","project":"react"} +{"id":"task-11","date":"2025-05-12","level":"chanllenging","description":"1) Add a button with the text 'Random Blogs' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not be stuck when 100000 blogs are appended. 3) Constraint: DO NOT USE any third-party packages, ONLY React APIs can be used to optimize performance.","project":"react"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing Comments.tsx with the title 'Comments' at the bottom of Blog.tsx. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the className '.comment-item', placed above the TextArea. 4) Create store/Comment.tsx to implement CommentStore without ReactContext API、Redux、mobx etc., and connect CommentStore to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize React APIs.","project":"react"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.tsx that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are allowed.","project":"react"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. 2) Develop a hook or utility to reuse Markdown-related logic. 3) Prevent XSS attacks. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.tsx to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follow the rules, create reusable component. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in Header with text 'Fast Comment'. 2) When clicked, focus Textarea in Comments.tsx and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted. DO NOT use BOM API. DO NOT use DOM query API.","project":"react"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/Game.tsx with text 'Hello Game'. 2) Add router.tsx in to control the Route Logic: When browser location is '/', routed to App. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in App's Header.tsx to jump to Game page, and user can go back to App when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to shw current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse utils/toast.tsx to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY React APIs are permitted.","project":"react"} \ No newline at end of file diff --git a/datasets/redux.jsonl b/datasets/redux.jsonl index a1b969a4befd963862151c50207195b13626cb4b..398c9221d6c7fe3a0110219e8e820681c5dd349b 100644 --- a/datasets/redux.jsonl +++ b/datasets/redux.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color.\n2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. \n3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }.\n3) Render Header.tsx And Main.tsx in App.tsx \n4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'.\n2) Create models/blog.ts, use @reduxjs/toolkit to create a slice with name 'blog', include this slice in store.tsx, initialState is: \n```\n{ blogs: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}] }\n```\n2) In Main.tsx, render BlogList with the data from the store (by using useSelector to pick the data from the store)\n3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. \n4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be the first item of blog list.\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. \n2) Set 'Morning' as the default selected blog. \n3) Beautify the List without changing the size of List Item\n4) Use redux to manage the selected blog\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. \n2) Use redux to manage the 'formVisible' state. When formVisible is true, the BlogForm should be displayed, otherwise, it should be hidden.\n3) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. \n4) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it.\n5) Place the BlogForm component in App.tsx.\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) An API is prepared, here is the docs of API:\nGET /api/blogs\n\n interface Response {\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) In models/blog.ts, use createAsyncThunk from @reduxjs/toolkit to fetch data from API and update the Blog List data in store.\n3) When App.tsx mounted, dispatch action to start fetching blogs.\n4) When API is fetching, show 'Blog is loading' in App.tsx\n5) Notice: When Initial Blog is fetching, Header is always visible but 'Add Blog' button should be disabled.\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label (label[htmlFor=\"title\"], label[htmlFor=\"detail\"]) in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); \n2) When submitted, append this Blog to BlogList, and set this Blog as selected.\n3) Use Redux to append form data to blogs. \n4) Check title duplication when submit clicked. When title is duplicated, stop submitting and show a red border around the input field.\n5) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx to delete the selected blog.\n2) When blog deleted, set the first blog in blogs as selected.\n3) If blogs is empty, shows 'No Blog' instead.\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. \n2) When Edit clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Blog' in this case. When submitted, update selected Blog. \n3) Use Redux to manage edit logic.\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Here is Search API:\nGET /api/search_blogs?keywords=XXX\n\n interface Response {\n // blogs is the search result\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. \n3) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to FILTER blogs by using new Search API.\n4) Use Redux to request Search API and manage filtered blogs. Notice: Do not change the blogs in store.\n5) Hint: When input field is typed fast, make sure the latest search result is displayed.\nConstraint: DO NOT USE any third-party packages, ONLY React/Redux APIs can be used to optimize performance.\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add models/route.ts to control the Route Logic\nThe definition of state is:\n```\ninterface RouteState {\n currentRoute: string;\n}\n```\nThe initial state of route will be the pathname of the current page.\n2) Write middleware/route.ts, listen to browser history change, and update the currentRoute in store.\n3) When path is '/', shows Main.tsx, when path is '/login', shows pages/Login.tsx. Header is visible for every page.\n4) Render

User Login

in components/Login.tsx. Add Button with text '🔑' in the right of Header.tsx, when clicked, go to '/login'.\nConstraint: DO NOT USE any third-party packages, ONLY React/Redux APIs can be used to optimize performance.\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a button with the text '🔀' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\\\d]{12}', digits in title is random. \n2) Ensure the page will not be stuck when 100000 blogs are appended. \nConstraint: DO NOT USE any third-party packages, ONLY React/Redux APIs can be used to optimize performance.\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. \n2) Develop a utility to reuse Markdown-related logic. \n3) Prevent XSS attacks. \nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Implement user login, logout, and display blog poster's username.\n\n 1) Login API:\nPOST /api/login\nRequest: { username: string, password: string }\nResponse: { success: boolean }\n2) On the /login page, add a LoginForm with labels(label[htmlFor=\"username\"], label[htmlFor=\"password\"]), and a .login-submit-btn to submit the form via the Login API.\n3) Display the user's username in Header.tsx with the class '.username'.\n4) Show the blog author's username with the class '.blog-author'. If blog has no author, display 'Anonymous'.\n5) Add a '👋' Logout button (class '.logout-btn') next to the username in Header.tsx. Clicking it logs the user out.\n6) Use Redux to manage user states.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement blog comment feature:\n1) Display commenter's username with class '.comment-author' and text with '.comment-text'.\n2) Add a CommentForm with a '.comment-input' textarea and a '.comment-submit-btn' below each blog.\n3) Use Redux to manage comments.\n4) Add undo functionality via Ctrl+Z (Windows/Linux) or Command+Z (Mac) to remove the last comment.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Write a Gomoku chess game in route: '/game'\n1) Add a button with the text '🎮' in Header, when clicked, jump to new page '/game'\n2) chess board is 15*15, there is black chess and white chess, black chess first \n3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\\\d{1,2}-d\\\\{1,2}. \n4) show 'White's Turn' and 'Black'Turn' to shw current player \n5) show 'White Wins!' and 'Black Wins!'.\n6) Use redux to manage the game logic. Beautify this game \nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Enhance the Gomoku game with multi-step undo functionality.\n1) Implement keyboard shortcut (Ctrl+Z on Windows/Linux or Command+Z on Mac) to trigger the undo action.\n2) Allow multiple consecutive undos to revert the game state to any previous point.\n3) Add a move history display with className '.move-history' showing all moves in the format \"White: (x,y)\" or \"Black: (x,y)\".\n4) Each history item should have className '.history-item'.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic;\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Implement a recording and replay system for Gomoku games.\n1) Every games will be auto recorded, and can be replayed by play button (.replay-play-btn) after the game is finished. \n2) Add play/pause button (className '.replay-play-btn', '.replay-pause-btn') and a slider (className '.replay-slider') to navigate through game moves.\n3) When replaying, show the current move number with className '.current-move'. \n4) There is an interval of 1000 ms between each move.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic;\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Create functionality to share Gomoku games as blog posts.\n1) Shows the \"Share to Blog\" button with className '.share-to-blog-btn' in the Gomoku game after the game is finished.\n2) When clicked, open a modal form (className '.share-modal') with title input (className '.title-input'), description input (className '.description-input'), submit button (className '.share-submit').\nGo to home page ('/') after submitted.\n3) In Blog Detail, detect if a blog contains a Gomoku game recording and display a \"Replay Game\" button (className '.blog-replay-btn').\n4) When the replay button is clicked, show a modal (className '.blog-replay-modal') with the full game replay interface.\n5) The replay interface should include the start play button (className '.blog-replay-start-play'), showing the current move number with className '.current-move'. There is an interval of 1000 ms between each move. \nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic.\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new page '/rooms':\n1) Add a button with the text '🚪' in Header, when clicked, jump to new page '/rooms'\n2) Add a \"Create Room\" button with className '.create-room-btn' that opens a room creation form.\n3) The room creation form should include a labeled input field for room name (\"Room Name\") and a \"Create\" button to submit the form and create a new game room with a unique ID. Don't enter the room instantly.\n4) Each room should be displayed as a card with className '.room-card' showing room name, creator's username, and current status.\n5) Sync room status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the state and sync logic.\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Implement a multi-user chat system based on rooms\n1) When a user clicks on a chat room card (with className '.room-card'), navigate to '/chat/:roomId' route.\n2) The chat room page ('/chat/:roomId') contains a message list (className '.message-list'), status display (in '.room-status'), and participant information (display all participants' usernames in '.participant-list').\n3) Implement message sending and receiving functionality, including a message input box (className '.message-input') and a send button (className '.send-button').\n4) Each message (className .message) should contains the sender's information (className '.message-sender').\n5) If the user enters the chat room, add this user to .participant-list.\n6) User will send heartbeat to check if user is in chat room, if the user is not active for 2000ms, the user will be removed from .participant-list.\n7) Sync chat room status, messages, and user connection status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic.\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx that displays 'Hello Blog' at the top of the page with appealing background color.\n2) Create components/Main.tsx where content is aligned at the top left and fills the remaining space. \n3) Develop components/Blog.tsx that accepts 'title' and 'detail' as props. Display mock blog data in Main.tsx using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }.\n3) Render Header.tsx And Main.tsx in App.tsx \n4) The classname of title in Blog.tsx is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px\n","project":"redux"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'.\n2) Create models/blog.ts, use @reduxjs/toolkit to create a slice with name 'blog', include this slice in store.tsx, initialState is: \n```\n{ blogs: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}] }\n```\n2) In Main.tsx, render BlogList with the data from the store (by using useSelector to pick the data from the store)\n3) Position BlogList on the left side of Main.tsx with a width of 300px; each blog item should have a height of 40px and a border-box layout. \n4) Only One Blog.tsx occupies the remaining space of Main.tsx. The content of Blog.tsx should be the first item of blog list.\n","project":"redux"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. \n2) Set 'Morning' as the default selected blog. \n3) Beautify the List without changing the size of List Item\n4) Use redux to manage the selected blog\n","project":"redux"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. \n2) Use redux to manage the 'formVisible' state. When formVisible is true, the BlogForm should be displayed, otherwise, it should be hidden.\n3) Add an 'Add Blog' appealing blue button in the right of Header.tsx to toggle the BlogForm's visibility. \n4) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it.\n5) Place the BlogForm component in App.tsx.\n","project":"redux"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) An API is prepared, here is the docs of API:\nGET /api/blogs\n\n interface Response {\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) In models/blog.ts, use createAsyncThunk from @reduxjs/toolkit to fetch data from API and update the Blog List data in store.\n3) When App.tsx mounted, dispatch action to start fetching blogs.\n4) When API is fetching, show 'Blog is loading' in App.tsx\n5) Notice: When Initial Blog is fetching, Header is always visible but 'Add Blog' button should be disabled.\n","project":"redux"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label (label[htmlFor=\"title\"], label[htmlFor=\"detail\"]) in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); \n2) When submitted, append this Blog to BlogList, and set this Blog as selected.\n3) Use Redux to append form data to blogs. \n4) Check title duplication when submit clicked. When title is duplicated, stop submitting and show a red border around the input field.\n5) Add a span(.blog-list-len) near 'Hello Blog' in Header.tsx to show the length of blogs\n","project":"redux"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.tsx to delete the selected blog.\n2) When blog deleted, set the first blog in blogs as selected.\n3) If blogs is empty, shows 'No Blog' instead.\n","project":"redux"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.tsx. \n2) When Edit clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Blog' in this case. When submitted, update selected Blog. \n3) Use Redux to manage edit logic.\n","project":"redux"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Here is Search API:\nGET /api/search_blogs?keywords=XXX\n\n interface Response {\n // blogs is the search result\n blogs: { title: string; detail:string; }[];\n }\n\n\n{\n blogs: [\n { title: 'XXX', detail: 'XXX' },\n ],\n }\n\n2) Add a Search.tsx(width: 200px, border-box) component above BlogList.tsx in Main.tsx. \n3) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to FILTER blogs by using new Search API.\n4) Use Redux to request Search API and manage filtered blogs. Notice: Do not change the blogs in store.\n5) Hint: When input field is typed fast, make sure the latest search result is displayed.\nConstraint: DO NOT USE any third-party packages, ONLY React/Redux APIs can be used to optimize performance.\n","project":"redux"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add models/route.ts to control the Route Logic\nThe definition of state is:\n```\ninterface RouteState {\n currentRoute: string;\n}\n```\nThe initial state of route will be the pathname of the current page.\n2) Write middleware/route.ts, listen to browser history change, and update the currentRoute in store.\n3) When path is '/', shows Main.tsx, when path is '/login', shows pages/Login.tsx. Header is visible for every page.\n4) Render

User Login

in components/Login.tsx. Add Button with text '🔑' in the right of Header.tsx, when clicked, go to '/login'.\nConstraint: DO NOT USE any third-party packages, ONLY React/Redux APIs can be used to optimize performance.\n","project":"redux"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a button with the text '🔀' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\\\d]{12}', digits in title is random. \n2) Ensure the page will not be stuck when 100000 blogs are appended. \nConstraint: DO NOT USE any third-party packages, ONLY React/Redux APIs can be used to optimize performance.\n","project":"redux"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.tsx. \n2) Develop a utility to reuse Markdown-related logic. \n3) Prevent XSS attacks. \nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n","project":"redux"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Implement user login, logout, and display blog poster's username.\n\n 1) Login API:\nPOST /api/login\nRequest: { username: string, password: string }\nResponse: { success: boolean }\n2) On the /login page, add a LoginForm with labels(label[htmlFor=\"username\"], label[htmlFor=\"password\"]), and a .login-submit-btn to submit the form via the Login API.\n3) Display the user's username in Header.tsx with the class '.username'.\n4) Show the blog author's username with the class '.blog-author'. If blog has no author, display 'Anonymous'.\n5) Add a '👋' Logout button (class '.logout-btn') next to the username in Header.tsx. Clicking it logs the user out.\n6) Use Redux to manage user states.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n","project":"redux"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Implement blog comment feature:\n1) Display commenter's username with class '.comment-author' and text with '.comment-text'.\n2) Add a CommentForm with a '.comment-input' textarea and a '.comment-submit-btn' below each blog.\n3) Use Redux to manage comments.\n4) Add undo functionality via Ctrl+Z (Windows/Linux) or Command+Z (Mac) to remove the last comment.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n","project":"redux"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Write a Gomoku chess game in route: '/game'\n1) Add a button with the text '🎮' in Header, when clicked, jump to new page '/game'\n2) chess board is 15*15, there is black chess and white chess, black chess first \n3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\\\d{1,2}-d\\\\{1,2}. \n4) show 'White's Turn' and 'Black'Turn' to shw current player \n5) show 'White Wins!' and 'Black Wins!'.\n6) Use redux to manage the game logic. Beautify this game \nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted.\n","project":"redux"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Enhance the Gomoku game with multi-step undo functionality.\n1) Implement keyboard shortcut (Ctrl+Z on Windows/Linux or Command+Z on Mac) to trigger the undo action.\n2) Allow multiple consecutive undos to revert the game state to any previous point.\n3) Add a move history display with className '.move-history' showing all moves in the format \"White: (x,y)\" or \"Black: (x,y)\".\n4) Each history item should have className '.history-item'.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic;\n","project":"redux"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Implement a recording and replay system for Gomoku games.\n1) Every games will be auto recorded, and can be replayed by play button (.replay-play-btn) after the game is finished. \n2) Add play/pause button (className '.replay-play-btn', '.replay-pause-btn') and a slider (className '.replay-slider') to navigate through game moves.\n3) When replaying, show the current move number with className '.current-move'. \n4) There is an interval of 1000 ms between each move.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic;\n","project":"redux"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Create functionality to share Gomoku games as blog posts.\n1) Shows the \"Share to Blog\" button with className '.share-to-blog-btn' in the Gomoku game after the game is finished.\n2) When clicked, open a modal form (className '.share-modal') with title input (className '.title-input'), description input (className '.description-input'), submit button (className '.share-submit').\nGo to home page ('/') after submitted.\n3) In Blog Detail, detect if a blog contains a Gomoku game recording and display a \"Replay Game\" button (className '.blog-replay-btn').\n4) When the replay button is clicked, show a modal (className '.blog-replay-modal') with the full game replay interface.\n5) The replay interface should include the start play button (className '.blog-replay-start-play'), showing the current move number with className '.current-move'. There is an interval of 1000 ms between each move. \nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic.\n","project":"redux"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add new page '/rooms':\n1) Add a button with the text '🚪' in Header, when clicked, jump to new page '/rooms'\n2) Add a \"Create Room\" button with className '.create-room-btn' that opens a room creation form.\n3) The room creation form should include a labeled input field for room name (\"Room Name\") and a \"Create\" button to submit the form and create a new game room with a unique ID. Don't enter the room instantly.\n4) Each room should be displayed as a card with className '.room-card' showing room name, creator's username, and current status.\n5) Sync room status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the state and sync logic.\n","project":"redux"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Implement a multi-user chat system based on rooms\n1) When a user clicks on a chat room card (with className '.room-card'), navigate to '/chat/:roomId' route.\n2) The chat room page ('/chat/:roomId') contains a message list (className '.message-list'), status display (in '.room-status'), and participant information (display all participants' usernames in '.participant-list').\n3) Implement message sending and receiving functionality, including a message input box (className '.message-input') and a send button (className '.send-button').\n4) Each message (className .message) should contains the sender's information (className '.message-sender').\n5) If the user enters the chat room, add this user to .participant-list.\n6) User will send heartbeat to check if user is in chat room, if the user is not active for 2000ms, the user will be removed from .participant-list.\n7) Sync chat room status, messages, and user connection status between all open tabs/windows.\nConstraint: DO NOT use any third-party packages; ONLY React/Redux APIs are permitted; Use redux to manage the logic.\n","project":"redux"} \ No newline at end of file diff --git a/datasets/sass.jsonl b/datasets/sass.jsonl index c5ca55b890a433e2dc21b3193d9d1ea697a578bd..d6f99975121c3fd76b6f355aef249e9184731a31 100644 --- a/datasets/sass.jsonl +++ b/datasets/sass.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form. Save styles to 'common/Question.scss' imported by 'common.scss'."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page. Extract all colors to SASS map variable '$color', all padding/margin value to SASS variables (using computed value) and all border properties to mixins. Use SASS functions to handle similar colors, e.g. lighter or darker colors. Save these variables and mixins to 'common/config.scss' which should be imported by 'common.scss'."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'. Save styles to 'common/SurveyDesign.scss' imported by 'common.scss'."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable. Save styles to 'common/SurveyPreview.scss' imported by 'common.scss'."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place. Save styles to 'common/SingleSelectionQuestion.scss' imported by 'common.scss'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js', 'common/MultiSelectionQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js', 'common/OpenQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js', 'common/RatingQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js', 'common/RankingQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control."} -{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js', 'common/NpsQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js', 'common/LikertQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time. Save styles to 'common/Content.scss' imported by 'common.scss'."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion."} -{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js', 'common/DataQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form. Save styles to 'common/Question.scss' imported by 'common.scss'.","project":"sass"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page. Extract all colors to SASS map variable '$color', all padding/margin value to SASS variables (using computed value) and all border properties to mixins. Use SASS functions to handle similar colors, e.g. lighter or darker colors. Save these variables and mixins to 'common/config.scss' which should be imported by 'common.scss'.","project":"sass"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'. Save styles to 'common/SurveyDesign.scss' imported by 'common.scss'.","project":"sass"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'.","project":"sass"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable. Save styles to 'common/SurveyPreview.scss' imported by 'common.scss'.","project":"sass"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place. Save styles to 'common/SingleSelectionQuestion.scss' imported by 'common.scss'.","project":"sass"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js', 'common/MultiSelectionQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place.","project":"sass"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js', 'common/OpenQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel.","project":"sass"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js', 'common/RatingQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1.","project":"sass"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js', 'common/RankingQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control.","project":"sass"} +{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js', 'common/NpsQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control.","project":"sass"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js', 'common/LikertQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form.","project":"sass"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place.","project":"sass"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time. Save styles to 'common/Content.scss' imported by 'common.scss'.","project":"sass"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion.","project":"sass"} +{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength.","project":"sass"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting.","project":"sass"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js', 'common/DataQuestion.scss') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'.","project":"sass"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page.","project":"sass"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel.","project":"sass"} \ No newline at end of file diff --git a/datasets/selector.jsonl b/datasets/selector.jsonl index 39ee56745f183c11e48ff28cef34e80c5fbe494a..bfd8f0d0ba9fa9c1b6428ae5e5ee22eeb21289d7 100644 --- a/datasets/selector.jsonl +++ b/datasets/selector.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"- append an element

with arbitrary text, class `class1` and id `id1` to `.root`\n- write css to the page with:\n - type selector to set its `padding` to `5px`\n - class selector to set its `text-decoration` to `underline`\n - id selector to set its `font-family` to `monospace`\n- no js, modify html file directly\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"- write css to the page with:\n - compound selector (type & class & id) to set `#id1`'s `font-size` to `15px`\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"- append with arbitrary text and id `id3` to `.root`\n- write css to the page with:\n - selector list (near to `.class1` property) to set its `text-decoration` to `underline` \n - universal selector to set all elements' `color` to `red`\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"- append

with id `id4` to `.root`\n - append 5
to `#id4` with arbitrary text and id `id4-{index}` (index is 0-based)\n- write css with:\n - child combinator selector to set its children `color` to `green`\n"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"- write css with:\n - subsequent-sibling combinator selector to set the `color` of all siblings next to `#id4-1` to `blue` \n - next-sibling combinator selector to set the `color` of `#id4-3`'s next-sibling to `yellow`\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"- write css for elements in `#form`:\n - descendant combinator selector to set `#form` children `color` to `green` \n - set the `color` of all children next to the third child to `blue` \n - set the `color` of the last forth child's next-sibling to `yellow`\n"} -{"id":"task-7","date":"2025-05-12","level":"challenging","description":"write css for elements in `#form`:\n- set `background-color` to `yellow` for those without attribute `name`\n- set `background-color` to `red` for those whose attribute `name` starts with `form`\n- set `background-color` to `green` for those whose attribute `name` ends with `end`\n- set `background-color` to `blue` for those whose attribute `class` contains `c2`\n- set `background-color` to `white` for those whose attribute `name` equals to `form-1`\n- set `background-color` to `white` for those whose attribute `name` contains `unique`\n- set `background-color` to `white` for those whose attribute `lang` starts with `en` immediately followed by a hyphen\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"use nesting selector to modify css for elements in `#form`:\n- set input's `outline` to `2px solid red` when hovering it\n- set input's `background-color` to `black` when focusing it\n"} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#form`:\n- set `font-size` of all inputs to `20px` when focusing any input\n"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"- append
with id `id10`(no content) to `.root`\n- modify css to add separate line (height 1px) before and after the `#form`\n- modify css to prepend `><` for any element with no children other than white-space characters \n- do not modify html or js\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#table`:\n- set `background-color` of the third cell in the forth row to `yellow` \n- set `background-color` of all cells in even rows to `lightgray`\n- do not use `!important` anytime\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"modify html and css for `#table`:\n- `cell(x,y)` means the yth cell in the xth row\n- append `

` in 4 cell(1,2), cell(2,3), cell(3,4), cell(4,2)\n- set `background-color` of cells with `

` to `yellow`\n- do not use `!important` anytime\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#form`:\n- set `background-color` to `pink` for all direct children\n- keep setting input's `background-color` to `black` when focusing it\n- do not use `!important` anytime\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#table`:\n- append in cell(1,3) with: \n `

\n \n \n \n \n
` \n - set enabled control `background-color` to `green`\n - set disabled control `background-color` to `yellow`\n - suffix the required control with a red `*`\n - set invalid control `background-color` to `red`\n- do not use `!important` anytime\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#table`:\n- append in cell(1,4) with: \n `table\n form\n test` \n - set default links `text-decoration` to `underline`\n - set visited links `text-decoration` to `none`\n - set active links `outline` to `1px solid blue`\n- set page's targeted element `background-color` to `lightgreen`\n- do not use `!important` anytime\n"} -{"id":"task-16","date":"2025-05-12","level":"moderate","description":"- append to `.root` with:\n `
\n

H1

\n
\n

H1

\n
\n

H1

\n \n
\n
\n
`\n- modify css for

in `#id16`:\n - the first level (direct child)

`font-size` is `30px`\n - the second level

`font-size` is `25px`\n - the third level

`font-size` is `20px`\n - the forth and deeper level

`font-size` is `15px`\n"} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"- append to `.root` with:\n `
\n

H1

\n \n

H1

\n \n

H1

\n \n

H1

\n
\n
\n
\n
`\n- `x` is one of section, article, aside, nav\n- modify css for

in `#id17`:\n - the first level (direct child)

`font-size` is `30px`\n - the second level

`font-size` is `25px`\n - the third and more level

`font-size` is `20px`\n"} -{"id":"task-18","date":"2025-05-12","level":"moderate","description":"- append to `.root` with:\n `
\n

H1

\n \n

H1

\n \n

H1

\n \n

H1

\n \n

H1

\n
\n
\n
\n
\n
`\n- `x` is one of section, article, aside, nav\n- modify css for

in `#id18`:\n - the first level (direct child)

`font-size` is `30px`\n - the second level

`font-size` is `25px`\n - the third level

`font-size` is `20px`\n - the forth and deeper level

`font-size` is `15px`\n"} -{"id":"task-19","date":"2025-05-12","level":"moderate","description":"- modify css for

in `#id18`:\n - the first level (direct child)

`text-indent` is `0`\n - the second level

`text-indent` is `10px`\n - the third level

`text-indent` is `20px`\n - the forth and deeper level

`text-indent` is `30px`\n"} -{"id":"task-20","date":"2025-05-12","level":"moderate","description":"- add new css for

in `#id18`:\n - do not modify existed css rules\n - the second level

`font-style` is `italic`\n - the forth and deeper level

`font-weight` is `normal`\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"- append an element

with arbitrary text, class `class1` and id `id1` to `.root`\n- write css to the page with:\n - type selector to set its `padding` to `5px`\n - class selector to set its `text-decoration` to `underline`\n - id selector to set its `font-family` to `monospace`\n- no js, modify html file directly\n","project":"selector"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"- write css to the page with:\n - compound selector (type & class & id) to set `#id1`'s `font-size` to `15px`\n","project":"selector"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"- append with arbitrary text and id `id3` to `.root`\n- write css to the page with:\n - selector list (near to `.class1` property) to set its `text-decoration` to `underline` \n - universal selector to set all elements' `color` to `red`\n","project":"selector"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"- append

with id `id4` to `.root`\n - append 5
to `#id4` with arbitrary text and id `id4-{index}` (index is 0-based)\n- write css with:\n - child combinator selector to set its children `color` to `green`\n","project":"selector"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"- write css with:\n - subsequent-sibling combinator selector to set the `color` of all siblings next to `#id4-1` to `blue` \n - next-sibling combinator selector to set the `color` of `#id4-3`'s next-sibling to `yellow`\n","project":"selector"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"- write css for elements in `#form`:\n - descendant combinator selector to set `#form` children `color` to `green` \n - set the `color` of all children next to the third child to `blue` \n - set the `color` of the last forth child's next-sibling to `yellow`\n","project":"selector"} +{"id":"task-7","date":"2025-05-12","level":"challenging","description":"write css for elements in `#form`:\n- set `background-color` to `yellow` for those without attribute `name`\n- set `background-color` to `red` for those whose attribute `name` starts with `form`\n- set `background-color` to `green` for those whose attribute `name` ends with `end`\n- set `background-color` to `blue` for those whose attribute `class` contains `c2`\n- set `background-color` to `white` for those whose attribute `name` equals to `form-1`\n- set `background-color` to `white` for those whose attribute `name` contains `unique`\n- set `background-color` to `white` for those whose attribute `lang` starts with `en` immediately followed by a hyphen\n","project":"selector"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"use nesting selector to modify css for elements in `#form`:\n- set input's `outline` to `2px solid red` when hovering it\n- set input's `background-color` to `black` when focusing it\n","project":"selector"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#form`:\n- set `font-size` of all inputs to `20px` when focusing any input\n","project":"selector"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"- append
with id `id10`(no content) to `.root`\n- modify css to add separate line (height 1px) before and after the `#form`\n- modify css to prepend `><` for any element with no children other than white-space characters \n- do not modify html or js\n","project":"selector"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#table`:\n- set `background-color` of the third cell in the forth row to `yellow` \n- set `background-color` of all cells in even rows to `lightgray`\n- do not use `!important` anytime\n","project":"selector"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"modify html and css for `#table`:\n- `cell(x,y)` means the yth cell in the xth row\n- append `

` in 4 cell(1,2), cell(2,3), cell(3,4), cell(4,2)\n- set `background-color` of cells with `

` to `yellow`\n- do not use `!important` anytime\n","project":"selector"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#form`:\n- set `background-color` to `pink` for all direct children\n- keep setting input's `background-color` to `black` when focusing it\n- do not use `!important` anytime\n","project":"selector"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#table`:\n- append in cell(1,3) with: \n `

\n \n \n \n \n
` \n - set enabled control `background-color` to `green`\n - set disabled control `background-color` to `yellow`\n - suffix the required control with a red `*`\n - set invalid control `background-color` to `red`\n- do not use `!important` anytime\n","project":"selector"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"modify css for elements in `#table`:\n- append in cell(1,4) with: \n `table\n form\n test` \n - set default links `text-decoration` to `underline`\n - set visited links `text-decoration` to `none`\n - set active links `outline` to `1px solid blue`\n- set page's targeted element `background-color` to `lightgreen`\n- do not use `!important` anytime\n","project":"selector"} +{"id":"task-16","date":"2025-05-12","level":"moderate","description":"- append to `.root` with:\n `
\n

H1

\n
\n

H1

\n
\n

H1

\n \n
\n
\n
`\n- modify css for

in `#id16`:\n - the first level (direct child)

`font-size` is `30px`\n - the second level

`font-size` is `25px`\n - the third level

`font-size` is `20px`\n - the forth and deeper level

`font-size` is `15px`\n","project":"selector"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"- append to `.root` with:\n `
\n

H1

\n \n

H1

\n \n

H1

\n \n

H1

\n
\n
\n
\n
`\n- `x` is one of section, article, aside, nav\n- modify css for

in `#id17`:\n - the first level (direct child)

`font-size` is `30px`\n - the second level

`font-size` is `25px`\n - the third and more level

`font-size` is `20px`\n","project":"selector"} +{"id":"task-18","date":"2025-05-12","level":"moderate","description":"- append to `.root` with:\n `
\n

H1

\n \n

H1

\n \n

H1

\n \n

H1

\n \n

H1

\n
\n
\n
\n
\n
`\n- `x` is one of section, article, aside, nav\n- modify css for

in `#id18`:\n - the first level (direct child)

`font-size` is `30px`\n - the second level

`font-size` is `25px`\n - the third level

`font-size` is `20px`\n - the forth and deeper level

`font-size` is `15px`\n","project":"selector"} +{"id":"task-19","date":"2025-05-12","level":"moderate","description":"- modify css for

in `#id18`:\n - the first level (direct child)

`text-indent` is `0`\n - the second level

`text-indent` is `10px`\n - the third level

`text-indent` is `20px`\n - the forth and deeper level

`text-indent` is `30px`\n","project":"selector"} +{"id":"task-20","date":"2025-05-12","level":"moderate","description":"- add new css for

in `#id18`:\n - do not modify existed css rules\n - the second level

`font-style` is `italic`\n - the forth and deeper level

`font-weight` is `normal`\n","project":"selector"} \ No newline at end of file diff --git a/datasets/sequelize.jsonl b/datasets/sequelize.jsonl index 296dcade39ee1ec79f1d5a5cb35f77132254d483..a5f5da4962da53c17fcf50b143acd37eb9b8d4b8 100644 --- a/datasets/sequelize.jsonl +++ b/datasets/sequelize.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts) 2) in this api, return a string list in body to get all usernames in User Model (model/user.ts), example: ['user1', 'user2'] 3) Hint: import { User } from '@/model' to get Model of User and get usernames by sequelize API"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) add model/product.ts and export it in model/index.ts to create sequelize Model for products (id, name, price, image, description, quantity). 2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 3) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id 2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}, when product not found, return { success: true, data: null } 3) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when updated successfully 4) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css file to beautify CSS."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css file to beautify CSS. 5) If Not Found, show 'Product Not Found'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 3) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth 4) create css file to beautify CSS."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) Add Server Action to handle register form submission, the initial coin for new user is 1000 7) create CSS file to beautify CSS."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create CSS file to beautify CSS. DO NOT use a third-party UI library."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username) on the right side of the site header. 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Create CSS file to beautify CSS. DO NOT use a third-party UI library."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create CSS file to beautify CSS."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create home page (app/page.tsx) with route '/' showing '🛍️🛍️🛍️ Welcome to Shopping Mart !' in h1 tag 2) create login page (app/login/page.tsx) at route '/login' showing '💡 Please Login First' in h1 tag","project":"sequelize"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) create a new api (GET /api/usernames) by creating api route file (app/api/usernames/route.ts) 2) in this api, return a string list in body to get all usernames in User Model (model/user.ts), example: ['user1', 'user2'] 3) Hint: import { User } from '@/model' to get Model of User and get usernames by sequelize API","project":"sequelize"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) add model/product.ts and export it in model/index.ts to create sequelize Model for products (id, name, price, image, description, quantity). 2) POST /api/products to insert product data (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when inserted successfully 3) GET /api/products to fetch all products. Return { success: true, products: [{'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}] } when fetched successfully.","project":"sequelize"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) create api route file (app/api/products/[id]/route.ts) for /api/products/:product_id 2) GET /api/products/:product_id to get single products information, Return { success: true, data: {'id':'xxx', 'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}}, when product not found, return { success: true, data: null } 3) PUT /api/products/:product_id to update products information (Request Body follow {'name': 'SKU', 'price': 1234, image: 'xxx', description: 'xxx', quantity: 100}). Return { success: true, data: {'id': 'xxxx' } } when updated successfully 4) DELETE /api/products/:product_id to delete product data (Return { success: true, data: {'id': 'xxxx' } } when deleted successfully)","project":"sequelize"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add page with path '/products' to display all products (image, name, price). 2) UI Structure For Product Cards:
{{name}}
{{price}}
. 3) add a button (.home-go-products-link) in home page to navigate to '/products' 4) .product-card is wrapped in .product-list. 5) create css file to beautify CSS.","project":"sequelize"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add product detail page with path '/products/:product_id' . 2) Add classNames for UI: .product-card, .product-image, .product-name, .product-price, .product_quantity, .product-description. 3) In /product page, When .product-card clicked, goto related product detail page 4) create css file to beautify CSS. 5) If Not Found, show 'Product Not Found'.","project":"sequelize"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) POST /api/auth to login into system with example payload {username: 'xxx', password: 'xxx'} and example response { success: true } 2) GET /api/auth to get the full information of current user, example response {'username': 'xxx', 'role': 'xxx', 'coin': xxx}, if not login, return 401 status 3) use 'jose' to generate JWT in cookie by key: 'TOKEN', the payload of JWT follow example{'username': 'xxx', 'role': 'xxx'}, secret is 'WEBBENCH-SECRET', use default HS256 algorithm and expired in 1 hour.","project":"sequelize"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Create login form (.login-form) with username input (.username), password input (.password), and submit button (.login-btn) 2) on successful login redirect to home page showing 'Hello {username}!'(h1), on failed login show 'Login Failed' message 3) The username in home page should be rendered in Server Side, create a new Server Action (actions/auth.ts) to get current auth 4) create css file to beautify CSS.","project":"sequelize"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Create register page with route '/register' with form (.register-form) containing: username (input.username), password (input.password), confirm password input (input.confirm-password), and submit button (.register-button) 2) Show error messages in .error-message div for validation failures, error text is: 'Passwords must match', 'Username already exists' 3) Redirect to home page and auto login when register successful 4) Add .login-link, clicked to /login 5) Add a .register-link in /login page, clicked to /register 6) Add Server Action to handle register form submission, the initial coin for new user is 1000 7) create CSS file to beautify CSS.","project":"sequelize"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Render STATIC page /profile/:username to display the user profile with UI: h1.profile-username, .profile-coin. 2) Users can only visit their own profile, and Admins can visit the profiles of all people. If the privilege is violated, redirect to the /login page. 3) If User not found, shows User not found 4) Create CSS file to beautify CSS. DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) Add a component in components/HeaderUserMenu.tsx: if not logged in, display a button (.header-go-login) that navigates to /login; if logged in, display the username (.header-username) on the right side of the site header. 2) If user is logged in, when the .header-username is hovered, show a dropdown menu with: a button (.header-logout-btn) for logging out, and a button (.header-go-user-profile) for navigating to the current user's profile page. 3) Create CSS file to beautify CSS. DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add Recharge Button (.recharge-button) in Profile page, button is only visible when the user of the profile is current user. 2) When Recharge Button clicked, recharge 1000 coin 3) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library. Keep profile page STATIC.","project":"sequelize"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create Admin Portal for admin role with routes '/admin/products' and '/admin/users'. 2) Every products and users are wrapped in table row with IDs #admin_product_{product_id} and #admin_user_{username} respectively. Display the full information of products and users in table rows 2) In Home page, add .home-go-product-portal-link and .home-go-user-portal-link to navigate to respective portals. 3) For any route inside /admin, Redirect to /login if no privilege. 4) Create CSS file to beautify CSS.","project":"sequelize"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Implement Wishlist feature where users can add products to their wishlist using button (.add-to-wishlist) in the product detail page. 2) Create a separate Wishlist page at route '/wishlist' displaying all products the user has added, structured as
. 3) Add functionality to remove items from wishlist with button (.remove-from-wishlist). 4) Store wishlist items in the database 5) Add button (.home-go-wish-list) in home page to navigate to '/wishlist' 6) Create CSS file to beautify the Wishlist UI. Constraint: DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) In components/Cart.tsx, create an appealing cart button .cart-button that shows the number of items in the cart. When clicked, it shows a popover of all items in the cart. Wrap Product Title, image, quantity (.cart-item-quantity), remove button (.cart-item-remove) in #cart_item_{product_id} 2) In the Detail Page, add an .add-to-cart-button. When clicked, add this product to the cart. 3) Store Cart Info in the DB for the current User. 4) Place Shopping Cart which can be seen in every page in the right-bottom of page 5) Create CSS file to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) Add a button .place-order-in-cart in the Popover of Shopping Cart; when clicked, create an order with 'Pending payment' status without paying or decreasing product quantity, and redirect to /order/:order-id; 2) When Order created, clear Cart 3) Add .header-go-to-my-orders to the dropdown in HeaderUserMenu.tsx; when clicked, go to the Orders Page of the current user; Each order in my orders page should be displayed with id, status total price inside #my_order_${order_id}; and clicking on an order should jump to the order detail page at /order/:order-id; 4) In /order/:order-id, display the product title, images, price in tr#product_in_order_${product_id}; display the order price and order status. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add the .pay-my-order button to /order/:order-id; Button is visible when the status is 'Pending payment' 2) When .pay-my-order is clicked, the status of the order becomes 'Finished', and the Coin is paid by current user; 3) Decrease product quantity; 4) If payment fails, update the order status to 'Failed'. 5) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add a .refund-button in Order Detail Page when order is paid; 2) When .refund-button is clicked, change the order status to 'Refund Reviewing'; 3) Create /admin/orders for admin to manage all orders, with a unique identifier #admin_order_{order_id}; 4) Add a .pass-refund-review-button in #admin_order_{order_id} if the order is under 'Refund Reviewing'; 5) When .pass-refund-review-button is clicked, update the order status to 'Refund Passed' and ensure that the Coin is refunded to the user's account. 6) In Home page, add .home-go-order-portal-link to navigate to /admin/orders. 7) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Implement a Comment and Rating System where users can leave feedback on products only after completing a payment transaction. Store comments in DB. 2) On the product detail page, display the average rating of the product at the top, using classNames: .product-average-rating (with number inside). 3) When a user has purchased the product, display a form on the product page with classNames: .comment-form, .rate-input with five stars inside: (.rate-1-star, .rate-2-star, ... , .rate-5-star), , .comment-textarea, .comment-submit-button allowing users to submit their ratings and comments. 4) Display all comments in a list on the product page, with each comment showing the username, the rating, and the comment text, styled using classNames: .comment-item, .comment-username, .comment-rating(with number inside), .comment-text. 5) Every User can ONLY comment a product for one time 6) Create CSS files to beautify CSS. Constraint: DO NOT use a third-party UI library.","project":"sequelize"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) Implement an invitation system where current users can view their unique .referral-code (with pure referral-code as innerText) on their profile page, explaining the invitation rule under .referral-code: 'When a new user registers through your referral code, you will earn $888, and an additional $1888 when they pay for their first order.' And the system should automatically credit the referring user with reward by this rule. 2) On the register page, add a .referral-code-input field allowing new users to input the referral code during registration. 3) Create CSS files to beautify the invitation system, ensuring a cohesive look. Constraint: DO NOT use a third-party UI library.","project":"sequelize"} \ No newline at end of file diff --git a/datasets/styled-components.jsonl b/datasets/styled-components.jsonl index b21c13c06b01600707953a7d59389ba24f6eb0f5..4270fb6e4bf48c313accfb714408a951456674fa 100644 --- a/datasets/styled-components.jsonl +++ b/datasets/styled-components.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create 'global.style.tsx' file, export GlobalStyle (created by styled-components) to set the global style for this App; 2) the global style should set the body's padding and margin to 0; 3) import GlobalStyle into App.tsx"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx fixed on the top of the page, with 'Hello Blog' as its text. 2) Create components/Footer.tsx fixed on the bottom of the page 3) Create components/Main.tsx which occupies the remaining space, with 'Welcome to Blog System' as its text 4) Add className 'site-header' to Header, 'site-footer' to Footer, 'site-main' to Main. 5) Import and render Header, Main, Footer in App.tsx 6) Constraint: use styled-components to set appealing style for Header、Footer"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Create components/Button.tsx, export default ONLY a styled.button component with props '$type' 2) when $type of Button is 'primary', background becomes #0064fa, 'secondary' becomes #0095ee, 'danger' becomes #d52515 3) Render Three Buttons in the RIGHT of Header: 'primary' Button with text 'Add Blog', 'secondary' Button with text 'Read Blogs', 'danger' Button with text 'Theme' 4) Constraint: use styled-components to set the appealing style"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) When Button Hovered, opacity of Button switched to 0.7; 2) When Button Focused, the size enlarged by 120% 3) Constraint: use styled-components to set the appealing style"} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Render A secondary Button with text 'My Friends' in Footer 2) Only if when Button displayed in Footer, the backgroundColor of text becomes transparent, and the color the text in Button is #0095ee 4) Constraint: use styled-components to set the appealing style"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Create three pages: components/AddBlog.tsx (with h1 'Add Blog'), components/ReadBlogs.tsx (with h1 'Read Blogs'), components/ThemePage.tsx (with h1 'Theme') 2) Render pages in Main.tsx, only one page is visible to User at one time 3) When click 'Add Blog', switch to show AddBlog.tsx, when click 'Read Blogs', switch to show ReadBlogs.tsx, when click 'Theme', switch to show ThemePage.tsx 4) When No Button in Header Clicked, shows 'Welcome to Blog System' by default 5) Constraint: use styled-components to set the appealing style"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) When page in Main.tsx switched, switch pages by animations in 1s: new page moved from the right side of viewport to show it 2) Create keyframes (import from 'styled-components') and PageContainer (styled.div with classname .page-container) in Main.tsx to implement this feature 3) Constraint: use styled-components to set the appealing style&animation"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":" 3) create context/BlogContext.tsx to manage blog list data 2) The initial Blog List Data is [{title: 'Morning', content: 'Morning My Friends'}, {title: 'Travel', content: 'I love traveling!'}] 3) In ReadBlogs.tsx, render titles of blogs in div elements (.list-item) 4) Constraint: use styled-components to set the appealing style"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Make .list-item clickable, when clicked, switch to show the content of the blog in a div element (.blog-content) 2) .blog-content is placed in the right of Blog List. 3) When Blog Content Changed, shows animation for .blog-content: switch content opacity from 0 to 1 in 1s 4) Constraint: use styled-components to set the appealing style&animation"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) create components/BlogForm.tsx, which consists of input(with placeholder 'Title'), textarea(with placeholder 'Content') a submit button (.submit-btn) 2) Add a BlogForm.tsx to AddBlog.tsx 3) when Form in AddBlog submitted, submit the Blog and switch to ReadBlogs Page, select the Blog just submitted 4) Constraint: use styled-components to set the appealing style&animation"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) When Submit Blog clicked, add new animation to .blog-content in ReadBlogs.tsx: fade in from the bottom side of viewport 2) The animation of .blog-content will not change when .list-item in ReadBlogs.tsx clicked 3) Constraint: use styled-components to set the appealing style&animation"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Create components/Markdown.tsx, support Markdown Parse and render for blog content in ReadBlogs.tsx 2) Use styled-components to set the text color of elements in Markdown: h1 #000000, h2 #333333, h3 #666666, h4 #999999 3) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.tsx that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) The Tooltip should be appended to document.body. 3) Shows Tooltip with text '🪄' when hovered on 'Add Blog' Button; Shows Tooltip with text '🍉' when hovered on 'Read Blogs' Button; Shows Tooltip with text '🎨' when hovered on 'Theme' Button; 4) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Create components/Modal.tsx that display a modal (.modal) appended to document.body. 2) Modal accepts title(JSX.Element) and content(JSX.Element) as its props 3) The overlay of Modal (.modal-overlay) has opacity 0.3 and backgroundColor #999999 4) The Modal should have a close button (.close-btn) 5) Add a Preview Button(.preview-btn) in BlogForm.tsx, when clicked, toggle a Modal with title ('Preview Blog Markdown') to shows the Markdown-Parsed Blog Content, Markdown style are same as the style of Blog Content in ReadBlogs.tsx 6) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.tsx to display a one-line message (fontSize: 12px) in a appealing green box (.toast) at the top of the page for 2000ms. 2) Display 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When hovered in 'My Friends' Button in Footer, shows Tooltip with text '🐶🐱🐭🐹🐰🦊🐻🐼' in the TOP of 'My Friends' 2) Custom style of Tooltip by using 'styled(Tooltip)' in Footer.tsx, the fontSize of text in this Tooltip is 50px 3) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) When clicked in 'My Friends' Button in Footer, shows Modal with title ('My Friends') 2) Shows Animals 🐶🐱🐭🐹🐰🦊🐻🐼 in the content of Modal, every animal is wrapped in .animal, and every animal has a infinite animation: rotate from -45deg to 45deg in 1s, and rotate back from 45deg to -45deg in 1s 3) Custom style of this Modal by using 'styled(Modal)' in Footer.tsx, the overlay Background Color of Modal is customized to #FF69B4 4) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) create context/ThemeContent.tsx by using styled's ThemeProvider to manage the theme configuration. 2) In Theme Page, add input(.header-background) with label 'Header Background' which will represent the background color of Header, and add input(.footer-background) with label 'Footer Background' which will represent the background color of Footer 4) When the input value in Theme Page changed, the theme configuration updated instantly 5) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation "} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) In Theme Page, add input(.markdown-h1) with label 'Markdown H1' which will represent the text color of Markdown H1, add input(.markdown-h2) with label 'Markdown H2' which will represent the text color of Markdown H2, add input(.markdown-h3) with label 'Markdown H3' which will represent the text color of Markdown H3, add input(.markdown-h4) with label 'Markdown H4' which will represent the text color of Markdown H4 2) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) In Theme Page, add input(.button-primary) with label 'Button Primary' which will represent the background color of Button Primary, add input(.button-secondary) with label 'Button Secondary' which will represent the background color of Button Secondary, add input(.button-danger) with label 'Button Danger' which will represent the background color of Button Danger 2) In Theme Page, add input(.toast-background) with label 'Toast Background' which will represent the background color of Toast 3) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) create 'global.style.tsx' file, export GlobalStyle (created by styled-components) to set the global style for this App; 2) the global style should set the body's padding and margin to 0; 3) import GlobalStyle into App.tsx","project":"styled-components"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create components/Header.tsx fixed on the top of the page, with 'Hello Blog' as its text. 2) Create components/Footer.tsx fixed on the bottom of the page 3) Create components/Main.tsx which occupies the remaining space, with 'Welcome to Blog System' as its text 4) Add className 'site-header' to Header, 'site-footer' to Footer, 'site-main' to Main. 5) Import and render Header, Main, Footer in App.tsx 6) Constraint: use styled-components to set appealing style for Header、Footer","project":"styled-components"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Create components/Button.tsx, export default ONLY a styled.button component with props '$type' 2) when $type of Button is 'primary', background becomes #0064fa, 'secondary' becomes #0095ee, 'danger' becomes #d52515 3) Render Three Buttons in the RIGHT of Header: 'primary' Button with text 'Add Blog', 'secondary' Button with text 'Read Blogs', 'danger' Button with text 'Theme' 4) Constraint: use styled-components to set the appealing style","project":"styled-components"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) When Button Hovered, opacity of Button switched to 0.7; 2) When Button Focused, the size enlarged by 120% 3) Constraint: use styled-components to set the appealing style","project":"styled-components"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Render A secondary Button with text 'My Friends' in Footer 2) Only if when Button displayed in Footer, the backgroundColor of text becomes transparent, and the color the text in Button is #0095ee 4) Constraint: use styled-components to set the appealing style","project":"styled-components"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Create three pages: components/AddBlog.tsx (with h1 'Add Blog'), components/ReadBlogs.tsx (with h1 'Read Blogs'), components/ThemePage.tsx (with h1 'Theme') 2) Render pages in Main.tsx, only one page is visible to User at one time 3) When click 'Add Blog', switch to show AddBlog.tsx, when click 'Read Blogs', switch to show ReadBlogs.tsx, when click 'Theme', switch to show ThemePage.tsx 4) When No Button in Header Clicked, shows 'Welcome to Blog System' by default 5) Constraint: use styled-components to set the appealing style","project":"styled-components"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"1) When page in Main.tsx switched, switch pages by animations in 1s: new page moved from the right side of viewport to show it 2) Create keyframes (import from 'styled-components') and PageContainer (styled.div with classname .page-container) in Main.tsx to implement this feature 3) Constraint: use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":" 3) create context/BlogContext.tsx to manage blog list data 2) The initial Blog List Data is [{title: 'Morning', content: 'Morning My Friends'}, {title: 'Travel', content: 'I love traveling!'}] 3) In ReadBlogs.tsx, render titles of blogs in div elements (.list-item) 4) Constraint: use styled-components to set the appealing style","project":"styled-components"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Make .list-item clickable, when clicked, switch to show the content of the blog in a div element (.blog-content) 2) .blog-content is placed in the right of Blog List. 3) When Blog Content Changed, shows animation for .blog-content: switch content opacity from 0 to 1 in 1s 4) Constraint: use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) create components/BlogForm.tsx, which consists of input(with placeholder 'Title'), textarea(with placeholder 'Content') a submit button (.submit-btn) 2) Add a BlogForm.tsx to AddBlog.tsx 3) when Form in AddBlog submitted, submit the Blog and switch to ReadBlogs Page, select the Blog just submitted 4) Constraint: use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"1) When Submit Blog clicked, add new animation to .blog-content in ReadBlogs.tsx: fade in from the bottom side of viewport 2) The animation of .blog-content will not change when .list-item in ReadBlogs.tsx clicked 3) Constraint: use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Create components/Markdown.tsx, support Markdown Parse and render for blog content in ReadBlogs.tsx 2) Use styled-components to set the text color of elements in Markdown: h1 #000000, h2 #333333, h3 #666666, h4 #999999 3) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed.","project":"styled-components"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.tsx that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) The Tooltip should be appended to document.body. 3) Shows Tooltip with text '🪄' when hovered on 'Add Blog' Button; Shows Tooltip with text '🍉' when hovered on 'Read Blogs' Button; Shows Tooltip with text '🎨' when hovered on 'Theme' Button; 4) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation.","project":"styled-components"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Create components/Modal.tsx that display a modal (.modal) appended to document.body. 2) Modal accepts title(JSX.Element) and content(JSX.Element) as its props 3) The overlay of Modal (.modal-overlay) has opacity 0.3 and backgroundColor #999999 4) The Modal should have a close button (.close-btn) 5) Add a Preview Button(.preview-btn) in BlogForm.tsx, when clicked, toggle a Modal with title ('Preview Blog Markdown') to shows the Markdown-Parsed Blog Content, Markdown style are same as the style of Blog Content in ReadBlogs.tsx 6) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.tsx to display a one-line message (fontSize: 12px) in a appealing green box (.toast) at the top of the page for 2000ms. 2) Display 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When hovered in 'My Friends' Button in Footer, shows Tooltip with text '🐶🐱🐭🐹🐰🦊🐻🐼' in the TOP of 'My Friends' 2) Custom style of Tooltip by using 'styled(Tooltip)' in Footer.tsx, the fontSize of text in this Tooltip is 50px 3) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) When clicked in 'My Friends' Button in Footer, shows Modal with title ('My Friends') 2) Shows Animals 🐶🐱🐭🐹🐰🦊🐻🐼 in the content of Modal, every animal is wrapped in .animal, and every animal has a infinite animation: rotate from -45deg to 45deg in 1s, and rotate back from 45deg to -45deg in 1s 3) Custom style of this Modal by using 'styled(Modal)' in Footer.tsx, the overlay Background Color of Modal is customized to #FF69B4 4) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) create context/ThemeContent.tsx by using styled's ThemeProvider to manage the theme configuration. 2) In Theme Page, add input(.header-background) with label 'Header Background' which will represent the background color of Header, and add input(.footer-background) with label 'Footer Background' which will represent the background color of Footer 4) When the input value in Theme Page changed, the theme configuration updated instantly 5) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation ","project":"styled-components"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) In Theme Page, add input(.markdown-h1) with label 'Markdown H1' which will represent the text color of Markdown H1, add input(.markdown-h2) with label 'Markdown H2' which will represent the text color of Markdown H2, add input(.markdown-h3) with label 'Markdown H3' which will represent the text color of Markdown H3, add input(.markdown-h4) with label 'Markdown H4' which will represent the text color of Markdown H4 2) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation","project":"styled-components"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) In Theme Page, add input(.button-primary) with label 'Button Primary' which will represent the background color of Button Primary, add input(.button-secondary) with label 'Button Secondary' which will represent the background color of Button Secondary, add input(.button-danger) with label 'Button Danger' which will represent the background color of Button Danger 2) In Theme Page, add input(.toast-background) with label 'Toast Background' which will represent the background color of Toast 3) Constraint: DO NOT use any third-party packages; ONLY React and styled-components are allowed. use styled-components to set the appealing style&animation","project":"styled-components"} \ No newline at end of file diff --git a/datasets/stylus.jsonl b/datasets/stylus.jsonl index 3bc859b2ed72555cc3c72a12cd4c5a5add52c4a0..571a3b65e74cb4188c3fa4e7a181ce376f030816 100644 --- a/datasets/stylus.jsonl +++ b/datasets/stylus.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form. Save styles to 'common/Question.styl' imported by 'common.styl'."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page. Extract all colors to stylus nested variable '$color', all padding/margin value to stylus variables (using computed value) and all border properties to mixins. Use stylus functions to handle similar colors, e.g. lighter or darker colors. Save these variables and mixins to 'common/config.styl' which should be imported by 'common.styl'."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'. Save styles to 'common/SurveyDesign.styl' imported by 'common.styl'."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable. Save styles to 'common/SurveyPreview.styl' imported by 'common.styl'."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place. Save styles to 'common/SingleSelectionQuestion.styl' imported by 'common.styl'."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js', 'common/MultiSelectionQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js', 'common/OpenQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js', 'common/RatingQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js', 'common/RankingQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control."} -{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js', 'common/NpsQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js', 'common/LikertQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time. Save styles to 'common/Content.styl' imported by 'common.styl'."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion."} -{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js', 'common/DataQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form. Save styles to 'common/Question.styl' imported by 'common.styl'.","project":"stylus"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page. Extract all colors to stylus nested variable '$color', all padding/margin value to stylus variables (using computed value) and all border properties to mixins. Use stylus functions to handle similar colors, e.g. lighter or darker colors. Save these variables and mixins to 'common/config.styl' which should be imported by 'common.styl'.","project":"stylus"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'. Save styles to 'common/SurveyDesign.styl' imported by 'common.styl'.","project":"stylus"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'.","project":"stylus"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable. Save styles to 'common/SurveyPreview.styl' imported by 'common.styl'.","project":"stylus"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place. Save styles to 'common/SingleSelectionQuestion.styl' imported by 'common.styl'.","project":"stylus"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js', 'common/MultiSelectionQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place.","project":"stylus"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js', 'common/OpenQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel.","project":"stylus"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js', 'common/RatingQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1.","project":"stylus"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js', 'common/RankingQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control.","project":"stylus"} +{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js', 'common/NpsQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control.","project":"stylus"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js', 'common/LikertQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form.","project":"stylus"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place.","project":"stylus"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time. Save styles to 'common/Content.styl' imported by 'common.styl'.","project":"stylus"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion.","project":"stylus"} +{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength.","project":"stylus"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting.","project":"stylus"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js', 'common/DataQuestion.styl') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'.","project":"stylus"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page.","project":"stylus"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel.","project":"stylus"} \ No newline at end of file diff --git a/datasets/survey.jsonl b/datasets/survey.jsonl index 10de12814035e03f5d8514404f88493e7a30f9e3..563eadcb5db10de79fd2ace95e829549fbf42f3e 100644 --- a/datasets/survey.jsonl +++ b/datasets/survey.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control."} -{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion."} -{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"JS class Question constructor params are: title (string), name (string), preview (boolean, default false), and has a member 'root'. 'Question.root' is a fieldset (class 'q', id is param 'name',) containing a title legend (class 'q-title') and a body container (class 'q-body'). Save codes as es-module file 'common/Question.js'. Add a button 'Add Question' (class 'add-question') in 'design.js', and click it to create a Question (random title and unique name) whose root is prepended to the form.","project":"survey"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"In design page, a Question title is clicked to edit (contenteditable=true) in place. In preview page, title can not be edited. Append 'Question.root' with a config panel (class 'q-config') containing a button (class 'q-remove') clicked to remove the question from the form. Config panel should be hidden in preview page.","project":"survey"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Class SurveyDesign constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Save codes to 'common/SurveyDesign.js' imported by 'design.js'. Move '.add-question' button codes to 'common/SurveyDesign.js' which should import './Question.js'.","project":"survey"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add 'Save' button (class 'save') and 'Preview' button (class 'preview') in 'common/SurveyDesign.js'. Click 'Save' button to save Survey data to 'localStorage.data'. Survey data format is like `{title:'survey title', questions:[{className:'Question', title:'title 1', name:'question1'}, {className:'Question', title:'title2', name:'question2'}]}`. Each type of question's JSON data should contain all properties from constructor params and configs. Click 'Preview' button to save Survey data and open preview page in new window. Save codes to 'common/SurveyDesign.js'.","project":"survey"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"Class SurveyPreview (file 'common/SurveyPreview.js', used by 'preview.js') constructor params are: formSelector (string), title (string). Method 'prependQuestion(question)' and 'appendQuestion(question)' are used to prepend/append a 'question.root' to the form (got by param 'formSelector'). Create a SurveyPreview instance with data parsed from 'localStorage.data' and all questions should use preview mode in which config panel should be hidden and question can not be editable.","project":"survey"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place.","project":"survey"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Class MultiSelectionQuestion (file 'common/MultiSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use checkbox as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-multi') in 'common/SurveyDesign.js', and click it to create a MultiSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place.","project":"survey"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Class OpenQuestion (file 'common/OpenQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), isMultilines (boolean). When isMultilines is false question value does not contain any line break character. Add a button (class 'add-open') in 'common/SurveyDesign.js', and click it to create an OpenQuestion (random title, unique name) whose root is prepended to the form. Add a checkbox (class 'q-multilines') associated with 'OpenQuestion.isMultilines' to the config panel.","project":"survey"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"Class RatingQuestion (file 'common/RatingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), starCount (number, default 5). Add a button (class 'add-rating') in 'common/SurveyDesign.js', and click it to create a RatingQuestion (random title, unique name) whose root is prepended to the form. Add a config panel checkbox (class 'q-starCount') associated with 'RatingQuestion.starCount'. Highlight star options (class 'option') up to the clicked star option, and get the rating value (stored in param-named control) from 0 to 1.","project":"survey"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Class RankingQuestion (file 'common/RankingQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Add a button (class 'add-ranking') in 'common/SurveyDesign.js', and click it to create a RankingQuestion (random title, unique name and 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page, each option row (class 'option'), user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it in place. In preview page, insert after the target option (class 'option') when dragging the source option to drop into the target one; Store comma separated option indices in param-named control.","project":"survey"} +{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Class NpsQuestion (file 'common/NpsQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean). Add a button (class 'add-nps') in 'common/SurveyDesign.js', and click it to create a NpsQuestion (random title, unique name) whose root is prepended the form. In preview page, highlight the clicked score option (class 'option'), and store score (0-10) in param-named control.","project":"survey"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Class LikertQuestion (file 'common/LikertQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array), statements (string array). LikertQuestion is a table whose each row represents a statement (single selection), and each column is a radio option. Store each statement selection value in the control whose name is like {param-name}_{statement-index}. Add a button (class 'add-likert') in 'common/SurveyDesign.js', and click it to create a LikertQuestion (random title, unique name, 5 random options, 3 statements) whose root is prepended to the form.","project":"survey"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Click config panel button (class 'add-statement') to add an statement row. In design page each statement row (class 'statement'), user can click button (class 'remove-statement') to remove an statement row, click statement text (class 'statement-text') to edit it in place. In design page each option cell (class 'option'), user can click button (class 'add-option') to add an option column, click button (class 'remove-option') to remove an option column, click option text (class 'option-text') to edit it in place.","project":"survey"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add questions contents (class 'contents', file 'common/Contents.js' used by 'common/SurveyDesign.js' and 'common/SurveyPreview.js') panel fixed at the right side of the page. Contents can not cover any question content. Each contents item (class 'contents-item') has the text from the associated question's title. Click each contents item to scroll page to the associated question. Update contents after questions updated in the form. Insert after the target contents item when dragging the source one into the target one; Change the position of associated questions at the same time.","project":"survey"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Add a config panel checkbox (class 'q-required') associated with Question.required (boolean, default false). Preview page form can not be submitted when any required question has no/empty value. Give priority to implement 'required' feature using each Question's form controls 'required' attribute. Implement 'required' feature for SingleSelectionQuestion, NpsQuestion, LikertQuestion, RatingQuestion.","project":"survey"} +{"id":"task-16","date":"2025-05-12","level":"moderate","description":"Add a config panel checkbox (class 'q-minLength') associated with 'OpenQuestion.minLength' (number, default 0). A required OpenQuestion's answer length should be greater than 0. OpenQuestion's answer length should be equal or greater than minLength.","project":"survey"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"A required MultiSelectionQuestion should contain at least one checked option. If not valid, use alert dialog to display information and prevent form submitting.","project":"survey"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Class DataQuestion (file 'common/DataQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), type (one of url/tel/email/date/number, as input element type). Add a button (class 'add-data') in 'common/SurveyDesign.js', and click it to create a DataQuestion (random title, unique name, random type) whose root is prepended to the form. Add a config panel select (class 'q-type', options url/tel/email/date/number) associated with 'DataQuestion.type'.","project":"survey"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a config checkbox 'Shuffle' (class 'q-shuffle') and 'isShuffleMode' property for SingleSelectionQuestion, MultiSelectionQuestion, RankingQuestion. Shuffle options if needed in preview page.","project":"survey"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add button 'Add' (class 'add') in each question config panel. Click '.add' button to display the popup panel whose buttons are clicked to insert a new question after the current one. The popup panel (class 'popup') contains all buttons clicked to add different type of question to the form. Click page to close the popup panel.","project":"survey"} \ No newline at end of file diff --git a/datasets/svelte.jsonl b/datasets/svelte.jsonl index c4740ee9f6b2dbd479023d5b3c1fbf544f1348cd..770fb10cd845dde2fd7385cc2230ed9dbf5ad003 100644 --- a/datasets/svelte.jsonl +++ b/datasets/svelte.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.svelte that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/Main.svelte where content is aligned at the top left and fills the remaining space. 3) Develop components/Blog.svelte that accepts 'title' and 'detail' as props. Display mock blog data in Main.svelte using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 3) Include Header.svelte and Main.svelte in App.svelte 4) The classname of title in Blog.svelte is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'. 2) In Main.svelte, mock the blog data and display it using BlogList with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position BlogList on the left side of Main.svelte with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One Blog.svelte occupies the remaining space of Main.svelte. The content of Blog.svelte should be from first item of the mock data."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of Header.svelte to toggle the BlogForm's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it. 4) Place the BlogForm component in App.svelte."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of BlogForm showing '0' initially. 2) Increment .visible-count by 1 each time BlogForm becomes visible using onMount."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); 2) When submitted, append this Blog to BlogList, and set this Blog as selected. Keep Previous MockData."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create stores/blogStore.ts using Svelte's writable store to manage related state (blog list and selected blog) 2) When submit a new BlogForm, check title duplication. Constraint: The duplication check code should be written in BlogForm; 3) Add a span(.blog-list-len) near 'Hello Blog' in Header.svelte to show the length of blogs"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.svelte. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is appended in stores/blogStore.ts."} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.svelte. When clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is appended in stores/blogStore.ts;"} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a Search.svelte(width: 200px, border-box) component above BlogList.svelte in Main.svelte. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs using derived stores."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":" 1) Add a button with the text 'Random Blogs' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not stuck when 100000 blogs appended. 3) Constraint: DO NOT USE any third-party packages, ONLY Svelte APIs can be used to optimize the performance."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing Comments.svelte with the title 'Comments' at the bottom of Blog.svelte. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the className '.comment-item', placed above the TextArea. 4) Create stores/commentStore.ts to implement CommentStore using Svelte's store mechanism, and connect CommentStore to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize Svelte APIs."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.svelte that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body using Portal. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are allowed."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.svelte. 2) Develop a store or utility to reuse Markdown-related logic. 3) Prevent XSS attacks. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.ts to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follow the rules, create reusable component. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in Header with text 'Fast Comment'. 2) When clicked, focus Textarea in Comments.svelte and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted. DO NOT use BOM API. DO NOT use DOM query API. Use bind:this instead."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/Game.svelte with text 'Hello Game'. 2) Add router.ts to control the Route Logic: When browser location is '/', routed to App. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in App's Header.svelte to jump to Game page, and user can go back to App when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to show current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse utils/toast.ts to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"1) Create components/Header.svelte that displays 'Hello Blog' at the top of the page with appealing background color. 2) Create components/Main.svelte where content is aligned at the top left and fills the remaining space. 3) Develop components/Blog.svelte that accepts 'title' and 'detail' as props. Display mock blog data in Main.svelte using this Blog component with the mock data: { title: 'Morning', detail: 'Morning My Friends' }. 3) Include Header.svelte and Main.svelte in App.svelte 4) The classname of title in Blog.svelte is 'blog-title', the width of blog-title is 'fit-content', fontSize is 24px","project":"svelte"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"1) Create a appealing BlogList component that accepts an array of blogs as props and displays the titles in div elements with the className 'list-item'. 2) In Main.svelte, mock the blog data and display it using BlogList with this data: [{title: 'Morning', detail: 'Morning My Friends'}, {title: 'Travel', detail: 'I love traveling!'}]. 3) Position BlogList on the left side of Main.svelte with a width of 300px; each blog item should have a height of 40px and a border-box layout. 4) Only One Blog.svelte occupies the remaining space of Main.svelte. The content of Blog.svelte should be from first item of the mock data.","project":"svelte"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1) Make blog items in BlogList selectable. When an item in BlogList is selected, highlight it with appealing style and display its content in the Blog Component. 2) Set 'Morning' as the default selected blog. 3) Beautify the List without changing the size of List Item","project":"svelte"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"1) Create a BlogForm component as a appealing Modal with the title 'Create Blog'. 2) Add an 'Add Blog' appealing blue button in the right of Header.svelte to toggle the BlogForm's visibility. 3) Place a close button (.close-btn) with 'x' in the top right of BlogForm to hide it. 4) Place the BlogForm component in App.svelte.","project":"svelte"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"1) Add .visible-count in the top-left of BlogForm showing '0' initially. 2) Increment .visible-count by 1 each time BlogForm becomes visible using onMount.","project":"svelte"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"1) Add appealing Form with label in BlogForm to input title and detail; BlogForm can be submitted by button (.submit-btn); 2) When submitted, append this Blog to BlogList, and set this Blog as selected. Keep Previous MockData.","project":"svelte"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":" 1) Create stores/blogStore.ts using Svelte's writable store to manage related state (blog list and selected blog) 2) When submit a new BlogForm, check title duplication. Constraint: The duplication check code should be written in BlogForm; 3) Add a span(.blog-list-len) near 'Hello Blog' in Header.svelte to show the length of blogs","project":"svelte"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"1) Add 'Delete' appealing red button (.delete-btn) in top&right of Blog.svelte. When clicked, delete selected Blog and select the first blog. 2) The logic of Delete is appended in stores/blogStore.ts.","project":"svelte"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"1) Add 'Edit' appealing blue button (.edit-btn) in top&right of Blog.svelte. When clicked, toggle BlogForm to edit the content of selected Blog. The Title of BlogForm is 'Edit Form' in this case. When submitted, update selected Blog. 2) The logic of Edit is appended in stores/blogStore.ts;","project":"svelte"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"1) Add a Search.svelte(width: 200px, border-box) component above BlogList.svelte in Main.svelte. 2) Include an input field with the placeholder 'Search Blogs'. The keywords in the input field are used to filter blogs using derived stores.","project":"svelte"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":" 1) Add a button with the text 'Random Blogs' in Header to append 100,000 blogs to BlogList at one time. Each blog should have a title formatted in regex 'RandomBlog-[\\d]{12}', digits in title is random. 2) Ensure the page will not stuck when 100000 blogs appended. 3) Constraint: DO NOT USE any third-party packages, ONLY Svelte APIs can be used to optimize the performance.","project":"svelte"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"1) Add appealing Comments.svelte with the title 'Comments' at the bottom of Blog.svelte. 2) Include a TextArea with the placeholder 'Enter Your Comment' and a submit button (.comment-btn) to submit the comment. 3) Only display comments related to the selected blog, showing them in cards with the className '.comment-item', placed above the TextArea. 4) Create stores/commentStore.ts to implement CommentStore using Svelte's store mechanism, and connect CommentStore to UI. 5) Preserve comments when a blog is edited, and clear them when a blog is deleted. 6) Constraint: DO NOT USE any third-party packages; ONLY utilize Svelte APIs.","project":"svelte"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"1) Create components/Tooltip.svelte that displays a tooltip (.tooltip) at the bottom of the child component when hovered over. 2) Implement this tooltip on the 'Add Blog' button to show 'Write a New Blog For everyone' when hovered. 3) The Tooltip should be appended to document.body using Portal. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are allowed.","project":"svelte"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"1) Enable Markdown text input for blog details. Preview the Markdown in Blog.svelte. 2) Develop a store or utility to reuse Markdown-related logic. 3) Prevent XSS attacks. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.","project":"svelte"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"1) Create utils/toast.ts to display a one-line message (fontSize: 12px) in a appealing green box at the top of the page for 2000ms. 2) Display a toast with 'New Comment Created Successfully!' when a new comment is submitted, and 'New Blog Created Successfully!' when a new blog is submitted. 3) If a toast is already visible when another is triggered, remove the old toast before showing the new one. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.","project":"svelte"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"1) When the title of Blog is longer than 300px, show '...' to hide longer text. 2) Title can be hovered to show full content in Tooltip when Title is longer than 300px. DO NOT show tooltip when Title is less than 300px 3) Make sure EVERY title displayed in the page follow the rules, create reusable component. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.","project":"svelte"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"1) Add appealing button in Header with text 'Fast Comment'. 2) When clicked, focus Textarea in Comments.svelte and type 'Charming Blog!' DO NOT submit this comment. 3) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted. DO NOT use BOM API. DO NOT use DOM query API. Use bind:this instead.","project":"svelte"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"1) Add pages/Game.svelte with text 'Hello Game'. 2) Add router.ts to control the Route Logic: When browser location is '/', routed to App. When browser location is '/game', routed to Game. 3) Add a appealing button with text '🎮' in App's Header.svelte to jump to Game page, and user can go back to App when browser page go Back. 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.","project":"svelte"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"1) Write a Gomoku chess game 2) chess board is 15*15, there is black chess and white chess, black chess first 3) Add the className for important element: white chess(.chess-white), black chess(.chess-black), position chess can be clicked to drop follow regex: .chess-pos-\\d{1,2}-d\\{1,2}. 4) show 'White's Turn' and 'Black'Turn' to show current player 5) show 'White Wins!' and 'Black Wins!' when player wins, reuse utils/toast.ts to toast BIG 'Congratulations!' with style: 50px fontSize 6) keep 'Hello Game' 7) Beautify this game 8) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.","project":"svelte"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"1) When gamer wins, add a button with Text 'Post Game Records', when clicked, post a new blog to record the history of this game. Return to blog page and show this blog 2) The Blog Content Example: '# White is Winner!\n```game\nWhite(1,5);\nBlack(14,11);\nWhite(11,4);\n```' 3) Title of Blog follow Game-[Date]-[Time] 4) Constraint: DO NOT use any third-party packages; ONLY Svelte APIs are permitted.","project":"svelte"} \ No newline at end of file diff --git a/datasets/svg-chart.jsonl b/datasets/svg-chart.jsonl index 4e3cca6330c900df78b4bb93a419697685d1e2c1..4eab53ea6ee328d41a8d1939a181905468f8231d 100644 --- a/datasets/svg-chart.jsonl +++ b/datasets/svg-chart.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"challenging","description":"In `index.js`, import `assets/data.js` object `configs`. Each item in `configs` is a `config` object.\nDo not generate `assets/data.js` which is existed in project.\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"In `common/Chart.js`, `Chart` class contains properties: `svg` (SVG element, id `config.id`, class `chart {config.type}`, viewBox `0 0 100 70`). \nIn `index.js`, For each `config` whose `type` is line, create a `LineChart` instance and append its `svg` to `.root`.\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"In `common/LineChart.js`:\n- append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them)\n- append a polyline (class `dataset dataset-${index}`) inside `.datasets` for each `config.data.datasets` item (AKA. `dataset`)\n- all lines have unique colors\n- The min and max axis-y values correspond to the min and max values of all `dataset.data`\n"} -{"id":"task-4","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.axes` is true or not defined:\n- append g element (class `axes axes-x`) inside `svg` and align it to the bottom\n- append g element (class `axes axes-y`) inside `svg` and align it to the left\n- append axis-x line (class `axis axis-x`, color gray) inside `.axes-x` and align it to the top\n- append axis-y line (class `axis axis-y`, color gray) inside `.axes-y` and align it to the right\n\nIn `common/LineChart.js`, when `options.axes` is true or not defined:\n- place `.datasets` to the right side of `.axis-y` and above `.axis-x`\n- reduce `.datasets` lines width and height, and make `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space\n"} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.axes` is true or not defined:\n- append axis-x labels (class `label label-{index}`, color black) inside `.axes-x` and align them to the bottom\n - axis-x labels, coming from `data.labels`, are evenly distributed from left to right, `.label-0` is aligned to the left of `.axes-x`\n- append axis-y labels (class `label label-{index}`, color black) inside `.axes-y` and align them to the left\n - The min and max axis-y values correspond to the min and max values of `dataset.data`\n - 6 axis-y labels, ranging from the min to the max, are evenly distributed across 5 sections from bottom to top, `.label-0` is aligned to the bottom of `.axes-y`\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.grids` is true or not defined:\n- append g element (class `grids`) in `svg`\n- append grid-x lines (each class `grid grid-x grid-x-{index}`, color gray) and grid-y lines (each class `grid grid-y grid-y-{index}`, color gray) in `.grids`\n- Ensure that `.grids` is placed under `.datasets`, and that its size matches `.datasets`\n- Each grid-x line is horizontally aligned with axis-x labels\n- Each grid-y line is vertically aligned with axis-y labels\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.legends` is true or not defined:\n- append g element (class `legends`) on the top of `svg`\n- append g element (class `legend legend-{index}`) in `.legends`\n- append circle (color is the same as `.dataset` line color) and text (content `dataset.label`) in each `.legend`\n\nIn `common/Chart.js` and `common/LineChart.js`, when `options.legends` is true or not defined:\n- reduce `.datasets` lines height\n- reduce `.axes-y` axis-y height, update axis-y labels position\n- and make `.legends`, `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space\n"} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"In `common/LineChart.js`, when `options.pointStyle` is `circle` or `rect`:\n- append g element (class `points points-{index}`) inside `svg` for each `dataset`\n- append points (each class `point point-{index}`, shape is `options.pointStyle`) inside `.points` for each item of `dataset.data`\n- each point covers the `.dataset` line, distributes from left to right\n- each point color is the same as `.dataset` line color\n"} -{"id":"task-9","date":"2025-05-12","level":"moderate","description":"In `common/LineChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each item of `dataset.data`\n- each dataLabel is above the `.dataset` line, distributes from left to right\n- each dataLabel color is the same as `.dataset` line color\n"} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"In `common/LineChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over `.datasets` area, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - in `.tooltips`, show all data from the `.dataset` that corresponds to the selected `.grid-x`\n- when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)\n"} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"In `common/LineChart.js`, when `options.lineSmooth` is true:\n- replace all polylines with smooth curved lines inside `.datasets`\n"} -{"id":"task-12","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when click legend:\n- show (remove class `hidden`) or hide (add class `hidden`) `.dataset` lines, dataLabels, points\n"} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"In `common/ScatterChart.js`, class `ScatterChart` inherits from `LineChart`, `ScatterChart`:\n- options.pointStyle is always circle\n- options.dataLabels is always true\n- all `.dataset` lines are hidden\n\nUpdate `index.js`, create `ScatterChart` instances when `config.type` is `scatter`.\n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"In `common/StepChart.js`, class `StepChart` inherits from `LineChart`, `StepChart`:\n- replace all polylines with step style polylines inside `.datasets`\n- in each step style polyline:\n - each `dataset.data` responds to a horizontal line segment whose width is the distance between two near grid-x\n - the first and the last line segment width is the half\n - connect all line segments to a step style polyline\n\nUpdate `index.js`, create `StepChart` instances when `config.type` is `step`.\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"In `common/AreaChart.js`, class `AreaChart` inherits from `LineChart`, `AreaChart`:\n- append g element (class `areas`) inside `svg`\n- append polygons (each class `area area-{index}`) inside `.areas` \n- each `.area` is below the `.dataset` line\n- each `.area` color is the same as `.dataset` line color, half transparent\n\nUpdate `index.js`, create `AreaChart` instances when `config.type` is `area`.\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"In `common/BarChart.js`, class `BarChart` inherits from `Chart`, `BarChart`:\n- there is 1 more grid-x line than LineChart, all the grid-x lines are evenly distributed in `.grids`\n- append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them)\n- append g element (class `dataset dataset-${index}`) inside `.datasets` for each `datasets` item\n- append bars (rect elements, class `bar bar-{index}`) with the same color inside `.dataset` for each `dataset.data` item\n - bars are distributed within each column enclosed by 2 adjacent grid-x lines \n - bars in different `.dataset` have unique colors\n - bars in the same column are evenly distributed\n\nUpdate `index.js`, create `BarChart` instances when `config.type` is `bar`.\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"In `common/BarChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- each dataLabel is above the `.dataset` bars, distributes from left to right\n- each dataLabel color is the same as `.dataset` bars color\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"In `common/BarChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over `.datasets` area, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - in `.tooltips`, show all data from the `.dataset` that corresponds to the area enclosed by the selected `.grid-x` and next adjacent `.grid-x`\n- when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)\n"} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"In `common/PieChart.js`, class `PieChart` inherits from `Chart`, `PieChart`:\n- append g element (class `datasets`) inside `svg` and make it fill the most area of `svg`\n- append g element (class `dataset dataset-0`) inside `.datasets` for the first `datasets` item\n- append sectors (path elements, each class `sector sector-{index}`) with the unique color inside `.dataset` for each `dataset.data` item\n- all the sectors form a large circle\n- the area of each sector is related to its proportion of the data\n\nUpdate `index.js`, create `PieChart` instances when `config.type` is `pie`.\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"In `common/PieChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-0`) inside `svg` for the first `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- append connect lines (each class `connect connect-{index}`) inside `.dataLabels` to connect each dataLabel and its corresponding sector\n- each dataLabel is positioned near its corresponding sector and distributed around the large circle\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"challenging","description":"In `index.js`, import `assets/data.js` object `configs`. Each item in `configs` is a `config` object.\nDo not generate `assets/data.js` which is existed in project.\n","project":"svg-chart"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"In `common/Chart.js`, `Chart` class contains properties: `svg` (SVG element, id `config.id`, class `chart {config.type}`, viewBox `0 0 100 70`). \nIn `index.js`, For each `config` whose `type` is line, create a `LineChart` instance and append its `svg` to `.root`.\n","project":"svg-chart"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"In `common/LineChart.js`:\n- append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them)\n- append a polyline (class `dataset dataset-${index}`) inside `.datasets` for each `config.data.datasets` item (AKA. `dataset`)\n- all lines have unique colors\n- The min and max axis-y values correspond to the min and max values of all `dataset.data`\n","project":"svg-chart"} +{"id":"task-4","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.axes` is true or not defined:\n- append g element (class `axes axes-x`) inside `svg` and align it to the bottom\n- append g element (class `axes axes-y`) inside `svg` and align it to the left\n- append axis-x line (class `axis axis-x`, color gray) inside `.axes-x` and align it to the top\n- append axis-y line (class `axis axis-y`, color gray) inside `.axes-y` and align it to the right\n\nIn `common/LineChart.js`, when `options.axes` is true or not defined:\n- place `.datasets` to the right side of `.axis-y` and above `.axis-x`\n- reduce `.datasets` lines width and height, and make `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space\n","project":"svg-chart"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.axes` is true or not defined:\n- append axis-x labels (class `label label-{index}`, color black) inside `.axes-x` and align them to the bottom\n - axis-x labels, coming from `data.labels`, are evenly distributed from left to right, `.label-0` is aligned to the left of `.axes-x`\n- append axis-y labels (class `label label-{index}`, color black) inside `.axes-y` and align them to the left\n - The min and max axis-y values correspond to the min and max values of `dataset.data`\n - 6 axis-y labels, ranging from the min to the max, are evenly distributed across 5 sections from bottom to top, `.label-0` is aligned to the bottom of `.axes-y`\n","project":"svg-chart"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.grids` is true or not defined:\n- append g element (class `grids`) in `svg`\n- append grid-x lines (each class `grid grid-x grid-x-{index}`, color gray) and grid-y lines (each class `grid grid-y grid-y-{index}`, color gray) in `.grids`\n- Ensure that `.grids` is placed under `.datasets`, and that its size matches `.datasets`\n- Each grid-x line is horizontally aligned with axis-x labels\n- Each grid-y line is vertically aligned with axis-y labels\n","project":"svg-chart"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when `options.legends` is true or not defined:\n- append g element (class `legends`) on the top of `svg`\n- append g element (class `legend legend-{index}`) in `.legends`\n- append circle (color is the same as `.dataset` line color) and text (content `dataset.label`) in each `.legend`\n\nIn `common/Chart.js` and `common/LineChart.js`, when `options.legends` is true or not defined:\n- reduce `.datasets` lines height\n- reduce `.axes-y` axis-y height, update axis-y labels position\n- and make `.legends`, `.datasets`, `.axes-x` and `.axes-y` fill the entire `svg` space\n","project":"svg-chart"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"In `common/LineChart.js`, when `options.pointStyle` is `circle` or `rect`:\n- append g element (class `points points-{index}`) inside `svg` for each `dataset`\n- append points (each class `point point-{index}`, shape is `options.pointStyle`) inside `.points` for each item of `dataset.data`\n- each point covers the `.dataset` line, distributes from left to right\n- each point color is the same as `.dataset` line color\n","project":"svg-chart"} +{"id":"task-9","date":"2025-05-12","level":"moderate","description":"In `common/LineChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each item of `dataset.data`\n- each dataLabel is above the `.dataset` line, distributes from left to right\n- each dataLabel color is the same as `.dataset` line color\n","project":"svg-chart"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"In `common/LineChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over `.datasets` area, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - in `.tooltips`, show all data from the `.dataset` that corresponds to the selected `.grid-x`\n- when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)\n","project":"svg-chart"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"In `common/LineChart.js`, when `options.lineSmooth` is true:\n- replace all polylines with smooth curved lines inside `.datasets`\n","project":"svg-chart"} +{"id":"task-12","date":"2025-05-12","level":"moderate","description":"In `common/Chart.js`, when click legend:\n- show (remove class `hidden`) or hide (add class `hidden`) `.dataset` lines, dataLabels, points\n","project":"svg-chart"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"In `common/ScatterChart.js`, class `ScatterChart` inherits from `LineChart`, `ScatterChart`:\n- options.pointStyle is always circle\n- options.dataLabels is always true\n- all `.dataset` lines are hidden\n\nUpdate `index.js`, create `ScatterChart` instances when `config.type` is `scatter`.\n","project":"svg-chart"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"In `common/StepChart.js`, class `StepChart` inherits from `LineChart`, `StepChart`:\n- replace all polylines with step style polylines inside `.datasets`\n- in each step style polyline:\n - each `dataset.data` responds to a horizontal line segment whose width is the distance between two near grid-x\n - the first and the last line segment width is the half\n - connect all line segments to a step style polyline\n\nUpdate `index.js`, create `StepChart` instances when `config.type` is `step`.\n","project":"svg-chart"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"In `common/AreaChart.js`, class `AreaChart` inherits from `LineChart`, `AreaChart`:\n- append g element (class `areas`) inside `svg`\n- append polygons (each class `area area-{index}`) inside `.areas` \n- each `.area` is below the `.dataset` line\n- each `.area` color is the same as `.dataset` line color, half transparent\n\nUpdate `index.js`, create `AreaChart` instances when `config.type` is `area`.\n","project":"svg-chart"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"In `common/BarChart.js`, class `BarChart` inherits from `Chart`, `BarChart`:\n- there is 1 more grid-x line than LineChart, all the grid-x lines are evenly distributed in `.grids`\n- append g element (class `datasets`) inside `svg` and make it fill the entire `svg` (no padding between them)\n- append g element (class `dataset dataset-${index}`) inside `.datasets` for each `datasets` item\n- append bars (rect elements, class `bar bar-{index}`) with the same color inside `.dataset` for each `dataset.data` item\n - bars are distributed within each column enclosed by 2 adjacent grid-x lines \n - bars in different `.dataset` have unique colors\n - bars in the same column are evenly distributed\n\nUpdate `index.js`, create `BarChart` instances when `config.type` is `bar`.\n","project":"svg-chart"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"In `common/BarChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-{index}`) inside `svg` for each `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- each dataLabel is above the `.dataset` bars, distributes from left to right\n- each dataLabel color is the same as `.dataset` bars color\n","project":"svg-chart"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"In `common/BarChart.js`:\n- append an initially hidden g element (class `tooltips hidden`) inside `svg`\n- when mouse hovers over `.datasets` area, display `.tooltips` near the mouse position\n - select the `.grid-x` (class `selected`) that is horizontally closest to the mouse \n - in `.tooltips`, show all data from the `.dataset` that corresponds to the area enclosed by the selected `.grid-x` and next adjacent `.grid-x`\n- when mouse not hovers over `.datasets` area, hide `.tooltips` (add class `hidden`)\n","project":"svg-chart"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"In `common/PieChart.js`, class `PieChart` inherits from `Chart`, `PieChart`:\n- append g element (class `datasets`) inside `svg` and make it fill the most area of `svg`\n- append g element (class `dataset dataset-0`) inside `.datasets` for the first `datasets` item\n- append sectors (path elements, each class `sector sector-{index}`) with the unique color inside `.dataset` for each `dataset.data` item\n- all the sectors form a large circle\n- the area of each sector is related to its proportion of the data\n\nUpdate `index.js`, create `PieChart` instances when `config.type` is `pie`.\n","project":"svg-chart"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"In `common/PieChart.js`, when `options.dataLabels` is true:\n- append g element (class `dataLabels dataLabels-0`) inside `svg` for the first `dataset`\n- append data labels (each class `dataLabel dataLabel-{index}`) inside `.dataLabels` for each `dataset.data` item\n- append connect lines (each class `connect connect-{index}`) inside `.dataLabels` to connect each dataLabel and its corresponding sector\n- each dataLabel is positioned near its corresponding sector and distributed around the large circle\n","project":"svg-chart"} \ No newline at end of file diff --git a/datasets/svg-solar.jsonl b/datasets/svg-solar.jsonl index c8ecd5031a18e90f550ba3d003da3d30d1f7e3ca..dd3f61c5724bdb36fb5dc85393aa4cac2134694a 100644 --- a/datasets/svg-solar.jsonl +++ b/datasets/svg-solar.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add svg element (class `system`, viewBox is (0 0 160 160)) in `.root`. `.system` fill the whole space of `.root`. Add defs element (id `systemDefs`) and g element (id `systemRoot`) in `.system`."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Import `assets/data.json` as an object `data`. Add a star (class is `data.name`, circle radius is `data.r`, fill is `data.color`) in systemRoot. Its center is system center."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Import `assets/data.json` as an object `data` whose `bodies` attribute contains all the planets data. Mark each bodies item as body. Add planet elliptical orbits (svg path, id `orbit_{body.name}`, class `orbit`, no fill, line color is white, line width is 0.1) to systemRoot. Each orbit's center is system center, rx is `body.rx`, ry is `body.ry`. Each orbit path's start point is the right point of the ellipse."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add planets (svg circle, class `planet {body.name}`, fill is `body.color`, radius is `body.r`) to the right point of each orbit."} -{"id":"task-5","date":"2025-05-12","level":"challenging","description":"Define gradient color format:`(linearGradient|radialGradient): offset stop-color stop-opacity[, offset stop-color stop-opacity]...`, `stop-opacity` is optional, default value is 1. When data color is gradient, append systemDefs with a gradient element whose color direction is downward linearGradient or default radialGradient, and children elements attributes come from parsed color values. Replace the fill of star or planet with `url(#gradient-{name})`."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Make all planets revolve around the star along the orbit path with an orbital period of `body.dur` seconds. When the mouse hovers over a planet, stop all planets' revolution; otherwise, restore the revolution."} -{"id":"task-7","date":"2025-05-12","level":"challenging","description":"We call the collection of star and planets as `star-planets` view. Click planet to clear systemRoot and systemDefs, and show planet at system center in systemRoot, all satellites(data from `body.bodies`) and its orbits just like `star-planets`. We call this new collection of planet and satellites as `planet-satellites` view. Make sure the minimal radius of planet is 8 in `planet-satellites`."} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Replace the fill of planet or satellites with `url(#gradient-{name})` when necessary. Gradient color format remains the same as before."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"Make all satellites revolve around the planet along the orbit path with an orbital period of `dur` seconds. When the mouse hovers over a satellite, stop all satellites' revolution; otherwise, restore the revolution."} -{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Press key 'Escape' in `planet-satellites` to jump to `star-planets`."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append a detail panel (foreignObject, id `detailPanel`) to the system. Display body type (star/planet/satellite), name and sub-bodies list in detailPanel. By default, show the details of the central body (star or planet). When hovering over a body, update the detailPanel to display its details."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"When hovering over the sub-bodies in detailPanel, highlight the body (planet/satellite) stroke and orbit fill in the system, add class `highlight` to the body and orbit."} -{"id":"task-13","date":"2025-05-12","level":"moderate","description":"When clicking the sub-bodies (only planet) in detailPanel, jump to the `planet-satellites` view."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add planet ring (`use` element, id `ring_{body.name}`) in `star-planets` view when `body.ring` is true. Store ring template in the `symbol` element (id `ring`) which is the direct child of `.system`."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Highlight the body's (planet/satellite) most recent orbital path (AKA tail, class `tail`), with this section accounting for less than 5% of the total orbital circumference."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Append a global config panel (foreignObject, id `configPanel`) to the system. Global `configPanel` is inited once after page loaded. Add a tail checkbox (id `tailEnabled`, default checked) in the config panel. Uncheck it to hide the orbit tail."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Add a orbit checkbox (id `orbitEnabled`, default checked) in the config panel. Uncheck it to hide the orbit."} -{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Add a speed number input (id `speed`, default 1, range is [0.1, 10]) in the config panel. The orbital speed of a body (planet/satellite) is a multiple of `speed` value."} -{"id":"task-19","date":"2025-05-12","level":"moderate","description":"Add a background checkbox (id `bgEnabled`, default unchecked) in the config panel. Check it to display svg image in system (id `bg`, source `assets/bg.png`)."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add a comet button (id `comet`) in the config panel. Keep it clickable only in `star-planets` view. Click it to request comet name by prompt dialog and generate a comet (class `comet`) that follows an elliptical orbit around the Sun, with its aphelion (farthest point) reaching near Neptune's orbit and its perihelion (closest point) near Mercury's orbit. Comet data format is `{type: 'comet', name: 'halley', r: 0.3, rx: 70, ry: 2, dur: 300, color: 'red', bodies: []}`, rx range is [60, 80], ry range is [2, 4], dur range is [200, 400]."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add svg element (class `system`, viewBox is (0 0 160 160)) in `.root`. `.system` fill the whole space of `.root`. Add defs element (id `systemDefs`) and g element (id `systemRoot`) in `.system`.","project":"svg-solar"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Import `assets/data.json` as an object `data`. Add a star (class is `data.name`, circle radius is `data.r`, fill is `data.color`) in systemRoot. Its center is system center.","project":"svg-solar"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Import `assets/data.json` as an object `data` whose `bodies` attribute contains all the planets data. Mark each bodies item as body. Add planet elliptical orbits (svg path, id `orbit_{body.name}`, class `orbit`, no fill, line color is white, line width is 0.1) to systemRoot. Each orbit's center is system center, rx is `body.rx`, ry is `body.ry`. Each orbit path's start point is the right point of the ellipse.","project":"svg-solar"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Add planets (svg circle, class `planet {body.name}`, fill is `body.color`, radius is `body.r`) to the right point of each orbit.","project":"svg-solar"} +{"id":"task-5","date":"2025-05-12","level":"challenging","description":"Define gradient color format:`(linearGradient|radialGradient): offset stop-color stop-opacity[, offset stop-color stop-opacity]...`, `stop-opacity` is optional, default value is 1. When data color is gradient, append systemDefs with a gradient element whose color direction is downward linearGradient or default radialGradient, and children elements attributes come from parsed color values. Replace the fill of star or planet with `url(#gradient-{name})`.","project":"svg-solar"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"Make all planets revolve around the star along the orbit path with an orbital period of `body.dur` seconds. When the mouse hovers over a planet, stop all planets' revolution; otherwise, restore the revolution.","project":"svg-solar"} +{"id":"task-7","date":"2025-05-12","level":"challenging","description":"We call the collection of star and planets as `star-planets` view. Click planet to clear systemRoot and systemDefs, and show planet at system center in systemRoot, all satellites(data from `body.bodies`) and its orbits just like `star-planets`. We call this new collection of planet and satellites as `planet-satellites` view. Make sure the minimal radius of planet is 8 in `planet-satellites`.","project":"svg-solar"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Replace the fill of planet or satellites with `url(#gradient-{name})` when necessary. Gradient color format remains the same as before.","project":"svg-solar"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"Make all satellites revolve around the planet along the orbit path with an orbital period of `dur` seconds. When the mouse hovers over a satellite, stop all satellites' revolution; otherwise, restore the revolution.","project":"svg-solar"} +{"id":"task-10","date":"2025-05-12","level":"moderate","description":"Press key 'Escape' in `planet-satellites` to jump to `star-planets`.","project":"svg-solar"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Append a detail panel (foreignObject, id `detailPanel`) to the system. Display body type (star/planet/satellite), name and sub-bodies list in detailPanel. By default, show the details of the central body (star or planet). When hovering over a body, update the detailPanel to display its details.","project":"svg-solar"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"When hovering over the sub-bodies in detailPanel, highlight the body (planet/satellite) stroke and orbit fill in the system, add class `highlight` to the body and orbit.","project":"svg-solar"} +{"id":"task-13","date":"2025-05-12","level":"moderate","description":"When clicking the sub-bodies (only planet) in detailPanel, jump to the `planet-satellites` view.","project":"svg-solar"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Add planet ring (`use` element, id `ring_{body.name}`) in `star-planets` view when `body.ring` is true. Store ring template in the `symbol` element (id `ring`) which is the direct child of `.system`.","project":"svg-solar"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Highlight the body's (planet/satellite) most recent orbital path (AKA tail, class `tail`), with this section accounting for less than 5% of the total orbital circumference.","project":"svg-solar"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Append a global config panel (foreignObject, id `configPanel`) to the system. Global `configPanel` is inited once after page loaded. Add a tail checkbox (id `tailEnabled`, default checked) in the config panel. Uncheck it to hide the orbit tail.","project":"svg-solar"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Add a orbit checkbox (id `orbitEnabled`, default checked) in the config panel. Uncheck it to hide the orbit.","project":"svg-solar"} +{"id":"task-18","date":"2025-05-12","level":"moderate","description":"Add a speed number input (id `speed`, default 1, range is [0.1, 10]) in the config panel. The orbital speed of a body (planet/satellite) is a multiple of `speed` value.","project":"svg-solar"} +{"id":"task-19","date":"2025-05-12","level":"moderate","description":"Add a background checkbox (id `bgEnabled`, default unchecked) in the config panel. Check it to display svg image in system (id `bg`, source `assets/bg.png`).","project":"svg-solar"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add a comet button (id `comet`) in the config panel. Keep it clickable only in `star-planets` view. Click it to request comet name by prompt dialog and generate a comet (class `comet`) that follows an elliptical orbit around the Sun, with its aphelion (farthest point) reaching near Neptune's orbit and its perihelion (closest point) near Mercury's orbit. Comet data format is `{type: 'comet', name: 'halley', r: 0.3, rx: 70, ry: 2, dur: 300, color: 'red', bodies: []}`, rx range is [60, 80], ry range is [2, 4], dur range is [200, 400].","project":"svg-solar"} \ No newline at end of file diff --git a/datasets/svg.jsonl b/datasets/svg.jsonl index b78446ccee1fd4c58e3858cb7fe7b1b67540b6c7..f30d7ddae3026c139800ecb718ef60cf4bff655b 100644 --- a/datasets/svg.jsonl +++ b/datasets/svg.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"When click label line, use mouse in canvas to draw a svg line (line width is '.line-width' value, line color is '.color' value). The line's start point is the point when mouse pressing down and end point is the point when mouse pressing up."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"When click label rect, use mouse in canvas to draw a svg rect (fill color is white, line width is '.line-width' value, line color is '.color' value). The rect's left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"When click label circle, use mouse in canvas to draw a svg circle (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The circle's center is the rect center, radius is the half rect width."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"When click label ellipse, use mouse in canvas to draw a svg ellipse (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The ellipse's center is the rect center, x radius is the half rect width, y radius is the half rect height."} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"After label delete clicked, click any shape (line/rect/ellipse/...) in the canvas to delete it."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"After label fill clicked, click any shape (line/rect/ellipse/...) in the canvas to set its fill color to '.color' value."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"After label copy clicked, click any shape (line/rect/ellipse/...) in the canvas to copy itself. The copied shape is placed 20 to the right and 20 below the original shape."} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"When the length of the line is less than line width, keep it to be the line width. When the width or height of the rect is less than line width, keep it to be line width."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"When the radius of the circle is less than half line width, keep it to be half line width. When the x or y radius of the ellipse is less than half line width, keep it to be half line width."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"When click label triangle, use mouse in canvas to draw a svg polygon triangle (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The triangle's left-bottom is the rect left-bottom, right-bottom is the rect right-bottom, and top is the center of rect top edge. Polygon points sequence is left-bottom, right-bottom, top."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"When click label trapezoid, use mouse in canvas to draw a svg polygon trapezoid (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The trapezoid's left-bottom is the rect left-bottom, right-bottom is the rect right-bottom, left-top and right-top points divide rect top edge to 3 equal parts. Polygon points sequence is left-bottom, right-bottom, top."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"When click label hexagon, use mouse in canvas to draw a svg polygon hexagon (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The hexagon's left point is rect left edge center, right point is rect right edge center, 2 top points divide rect top edge to 3 parts (width 1:2:1), 2 bottom points divide rect bottom edge to 3 parts (width 1:2:1). Polygon points sequence is left, bottom, right, top."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"When click label curve, use mouse in canvas to draw a svg path quadratic curve (no fill, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The curve's start point is rect left-bottom, end point is rect right-bottom, and control point is the center of rect top edge."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"When click label polyline, use mouse in canvas to draw a svg polyline (no fill, line width is '.line-width' value, line color is '.color' value). The line's start point is the point when mouse pressing down, end point is the point when mouse pressing up, and other points are from the points when mouse moving."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"When click label text, use mouse in canvas to draw a svg text (no stroke, fill is '.color' value, default content is 'Text'). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The text's content fills the rect. Double click the text to edit its content with prompt dialog."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"After label move clicked, drag and move any shape in the canvas."} -{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Set label move clicked after creating or copying a shape. Press and hold the blankspace to enable moving the shape. Release it to restore the selected label if needed."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"After label rotate clicked, drag and rotate any shape in the canvas around its center."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"After label zoom clicked, drag and zoom any shape in the canvas according the distance between mouse position and its center. Zoom the shape around its center."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Perform move, rotate, and zoom operations on a shape in any sequence, ensuring that each operation builds on the previous one."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"When click label line, use mouse in canvas to draw a svg line (line width is '.line-width' value, line color is '.color' value). The line's start point is the point when mouse pressing down and end point is the point when mouse pressing up.","project":"svg"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"When click label rect, use mouse in canvas to draw a svg rect (fill color is white, line width is '.line-width' value, line color is '.color' value). The rect's left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up.","project":"svg"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"When click label circle, use mouse in canvas to draw a svg circle (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The circle's center is the rect center, radius is the half rect width.","project":"svg"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"When click label ellipse, use mouse in canvas to draw a svg ellipse (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The ellipse's center is the rect center, x radius is the half rect width, y radius is the half rect height.","project":"svg"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"After label delete clicked, click any shape (line/rect/ellipse/...) in the canvas to delete it.","project":"svg"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"After label fill clicked, click any shape (line/rect/ellipse/...) in the canvas to set its fill color to '.color' value.","project":"svg"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"After label copy clicked, click any shape (line/rect/ellipse/...) in the canvas to copy itself. The copied shape is placed 20 to the right and 20 below the original shape.","project":"svg"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"When the length of the line is less than line width, keep it to be the line width. When the width or height of the rect is less than line width, keep it to be line width.","project":"svg"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"When the radius of the circle is less than half line width, keep it to be half line width. When the x or y radius of the ellipse is less than half line width, keep it to be half line width.","project":"svg"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"When click label triangle, use mouse in canvas to draw a svg polygon triangle (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The triangle's left-bottom is the rect left-bottom, right-bottom is the rect right-bottom, and top is the center of rect top edge. Polygon points sequence is left-bottom, right-bottom, top.","project":"svg"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"When click label trapezoid, use mouse in canvas to draw a svg polygon trapezoid (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The trapezoid's left-bottom is the rect left-bottom, right-bottom is the rect right-bottom, left-top and right-top points divide rect top edge to 3 equal parts. Polygon points sequence is left-bottom, right-bottom, top.","project":"svg"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"When click label hexagon, use mouse in canvas to draw a svg polygon hexagon (fill color is white, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The hexagon's left point is rect left edge center, right point is rect right edge center, 2 top points divide rect top edge to 3 parts (width 1:2:1), 2 bottom points divide rect bottom edge to 3 parts (width 1:2:1). Polygon points sequence is left, bottom, right, top.","project":"svg"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"When click label curve, use mouse in canvas to draw a svg path quadratic curve (no fill, line width is '.line-width' value, line color is '.color' value). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The curve's start point is rect left-bottom, end point is rect right-bottom, and control point is the center of rect top edge.","project":"svg"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"When click label polyline, use mouse in canvas to draw a svg polyline (no fill, line width is '.line-width' value, line color is '.color' value). The line's start point is the point when mouse pressing down, end point is the point when mouse pressing up, and other points are from the points when mouse moving.","project":"svg"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"When click label text, use mouse in canvas to draw a svg text (no stroke, fill is '.color' value, default content is 'Text'). There is a rect whose left-top is the point when mouse pressing down and right-bottom is the point when mouse pressing up. The text's content fills the rect. Double click the text to edit its content with prompt dialog.","project":"svg"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"After label move clicked, drag and move any shape in the canvas.","project":"svg"} +{"id":"task-17","date":"2025-05-12","level":"moderate","description":"Set label move clicked after creating or copying a shape. Press and hold the blankspace to enable moving the shape. Release it to restore the selected label if needed.","project":"svg"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"After label rotate clicked, drag and rotate any shape in the canvas around its center.","project":"svg"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"After label zoom clicked, drag and zoom any shape in the canvas according the distance between mouse position and its center. Zoom the shape around its center.","project":"svg"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Perform move, rotate, and zoom operations on a shape in any sequence, ensuring that each operation builds on the previous one.","project":"svg"} \ No newline at end of file diff --git a/datasets/table.jsonl b/datasets/table.jsonl index 4736ccf0d775d104ac46856c9f2341f9752a7783..5fcb7742ce9dc53340c1c3c6d3824164976c8021 100644 --- a/datasets/table.jsonl +++ b/datasets/table.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add a context menu (class menu, absolute position, min-width/height 100px) in the page. Display context menu when right-clicking on the table. Hide the menu when clicking anywhere else on the page, including the menu space. Save codes to es-module 'common/menu.js' imported by 'index.js'."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"When right clicking td cell in tbody row, add menu item 'Insert Row Above' (class menu-item-insert-row-above), 'Insert Row Below' (class menu-item-insert-row-below), 'Delete Row' (class menu-item-delete-row). Click these menu items to do the corresponding actions."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"When right clicking th cell in thead row, add menu item 'Insert Col Left' (class menu-item-insert-col-left), 'Insert Col Right' (class menu-item-insert-col-right), 'Delete Col' (class menu-item-delete-col). Insert th cell in thead row and td cell in tbody row."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"Click to select and highlight a cell which is added class 'selected'. Save codes to 'common/table.js' imported by 'index.js'."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"If no selected cell, press Arrow keys to the first cell (top-left one). Press Arrow keys to change the selected cell to the next possible one. Save codes to 'common/key.js' imported by 'index.js'."} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"If no selected cell, press Tab and 'Shift+Tab' key to the first cell. Press Tab key to change the selected cell to the next one. The rules are from left col to right col, change to the left of next row if no next cell in current row; change to the first cell of the table if no next row. The rules for 'Shift+Tab' is the opposite of the rules of Tab key."} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add menu item 'Select Row' (class menu-item-select-row) for body cell. Add menu item 'Select Col' (class menu-item-select-col) for header cell. Press 'Cmd+A'(windows 'Ctrl+A') to select all cells. Press Escape key to unselect the selected cells."} -{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Press 'Delete' or 'Backspace' key to clear all selected cells content."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"Click with Shift key to select a rectangle of cells. Press 'Shift+Arrow' key to extend the selected cells by one more/less row/col."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Move mouse while keeping pressed down left button to select a rectangle of cells. Save codes to 'common/mouse.js' imported by 'index.js'"} -{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Single click a selected cell, or double click any cell to edit the cell (contenteditable). An editable cell is also selected."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Press Enter key to edit a selected cell. Press Escape key to change the edited cell to the readonly and selected one."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Press Cmd/Ctrl+C to copy the content of the selected cell. Press Cmd/Ctrl+V to paste the copied content to the selected cell."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Copy and paste exactly the content of the selected cells. Extend the table rows or cols if the target cells area is not large enough."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Drag row bottom lines to adjust row height. Row's minimum height is 40px. Save codes to 'common/layout.js' imported by 'index.js'"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Drag thead cell right lines to adjust col width. Col's minimum width is 80px. Save codes to 'common/layout.js'."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Select a tbody row to drag and move the row in tbody. Insert after the target when dragging into the target's bottom half, and to insert before the target when dragging into the target's top half. Save codes to 'common/drag.js' imported by 'index.js'."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Select a col to drag and move the col. Insert after the target when dragging into the target's right half, and to insert before the target when dragging into the target's left half."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a menu item 'Filter'(class menu-item-filter) for thead cell to accept keywords from prompt dialog to filter the rows matching the keywords. If keywords are empty string, display all rows."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add a menu item 'Sort'(class menu-item-sort) for thead cell to sort the rows text content in either ascending (A-Z) or descending (Z-A) order. The first order for each col is descending."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Add a context menu (class menu, absolute position, min-width/height 100px) in the page. Display context menu when right-clicking on the table. Hide the menu when clicking anywhere else on the page, including the menu space. Save codes to es-module 'common/menu.js' imported by 'index.js'.","project":"table"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"When right clicking td cell in tbody row, add menu item 'Insert Row Above' (class menu-item-insert-row-above), 'Insert Row Below' (class menu-item-insert-row-below), 'Delete Row' (class menu-item-delete-row). Click these menu items to do the corresponding actions.","project":"table"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"When right clicking th cell in thead row, add menu item 'Insert Col Left' (class menu-item-insert-col-left), 'Insert Col Right' (class menu-item-insert-col-right), 'Delete Col' (class menu-item-delete-col). Insert th cell in thead row and td cell in tbody row.","project":"table"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"Click to select and highlight a cell which is added class 'selected'. Save codes to 'common/table.js' imported by 'index.js'.","project":"table"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"If no selected cell, press Arrow keys to the first cell (top-left one). Press Arrow keys to change the selected cell to the next possible one. Save codes to 'common/key.js' imported by 'index.js'.","project":"table"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"If no selected cell, press Tab and 'Shift+Tab' key to the first cell. Press Tab key to change the selected cell to the next one. The rules are from left col to right col, change to the left of next row if no next cell in current row; change to the first cell of the table if no next row. The rules for 'Shift+Tab' is the opposite of the rules of Tab key.","project":"table"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"Add menu item 'Select Row' (class menu-item-select-row) for body cell. Add menu item 'Select Col' (class menu-item-select-col) for header cell. Press 'Cmd+A'(windows 'Ctrl+A') to select all cells. Press Escape key to unselect the selected cells.","project":"table"} +{"id":"task-8","date":"2025-05-12","level":"moderate","description":"Press 'Delete' or 'Backspace' key to clear all selected cells content.","project":"table"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"Click with Shift key to select a rectangle of cells. Press 'Shift+Arrow' key to extend the selected cells by one more/less row/col.","project":"table"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Move mouse while keeping pressed down left button to select a rectangle of cells. Save codes to 'common/mouse.js' imported by 'index.js'","project":"table"} +{"id":"task-11","date":"2025-05-12","level":"moderate","description":"Single click a selected cell, or double click any cell to edit the cell (contenteditable). An editable cell is also selected.","project":"table"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Press Enter key to edit a selected cell. Press Escape key to change the edited cell to the readonly and selected one.","project":"table"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Press Cmd/Ctrl+C to copy the content of the selected cell. Press Cmd/Ctrl+V to paste the copied content to the selected cell.","project":"table"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Copy and paste exactly the content of the selected cells. Extend the table rows or cols if the target cells area is not large enough.","project":"table"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Drag row bottom lines to adjust row height. Row's minimum height is 40px. Save codes to 'common/layout.js' imported by 'index.js'","project":"table"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Drag thead cell right lines to adjust col width. Col's minimum width is 80px. Save codes to 'common/layout.js'.","project":"table"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Select a tbody row to drag and move the row in tbody. Insert after the target when dragging into the target's bottom half, and to insert before the target when dragging into the target's top half. Save codes to 'common/drag.js' imported by 'index.js'.","project":"table"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Select a col to drag and move the col. Insert after the target when dragging into the target's right half, and to insert before the target when dragging into the target's left half.","project":"table"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Add a menu item 'Filter'(class menu-item-filter) for thead cell to accept keywords from prompt dialog to filter the rows matching the keywords. If keywords are empty string, display all rows.","project":"table"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Add a menu item 'Sort'(class menu-item-sort) for thead cell to sort the rows text content in either ascending (A-Z) or descending (Z-A) order. The first order for each col is descending.","project":"table"} \ No newline at end of file diff --git a/datasets/tailwind.jsonl b/datasets/tailwind.jsonl index 9ca6529948de49df8b5a4072edeaf24fffb7395c..31b91c98f496ac4badef2087cefb4313ecdcc64c 100644 --- a/datasets/tailwind.jsonl +++ b/datasets/tailwind.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE tailwind grid only, NO flex, float and position, NO js."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. USE tailwind grid only."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. USE tailwind grid only too."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. USE tailwind grid only."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px. USE tailwind grid only."} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear. USE tailwind grid only."} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content. USE tailwind grid only."} -{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width. USE tailwind grid only."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE tailwind grid only."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE tailwind grid only."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE tailwind grid only."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css property to reverse the order of the last 2 cards."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE tailwind grid only, NO flex, float and position, NO js.","project":"tailwind"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. USE tailwind grid only.","project":"tailwind"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. USE tailwind grid only too.","project":"tailwind"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. USE tailwind grid only.","project":"tailwind"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px. USE tailwind grid only.","project":"tailwind"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear. USE tailwind grid only.","project":"tailwind"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content. USE tailwind grid only.","project":"tailwind"} +{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width. USE tailwind grid only.","project":"tailwind"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE tailwind grid only.","project":"tailwind"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE tailwind grid only.","project":"tailwind"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar.","project":"tailwind"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled.","project":"tailwind"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content.","project":"tailwind"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content.","project":"tailwind"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE tailwind grid only.","project":"tailwind"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css property to reverse the order of the last 2 cards.","project":"tailwind"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient.","project":"tailwind"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content.","project":"tailwind"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width.","project":"tailwind"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height.","project":"tailwind"} \ No newline at end of file diff --git a/datasets/threejs.jsonl b/datasets/threejs.jsonl index 5fd3ee78654c9b299ea2b3f83ba0f45ebf37d05b..8d02970f54442f326a36bd0ea64ebee158fde6a2 100644 --- a/datasets/threejs.jsonl +++ b/datasets/threejs.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Edit index.js 1: Generate a basic Scene named scene and assign to window.scene. 2: Generate a basic PerspectiveCamera named camera and assign to window.camera. Do not add any other code. 2: Generate a basic WebGLRenderer and assign to window.renderer with full window size, named renderer, and append render dom into #root. 3: Auto render the scene and camera with requestAnimationFrame."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Create floor.js imported by index.js 1: Generate a green 8x8 PlaneGeometry named floor. Set this floor.name to floor. 2: Set the floor along the X and Z axes, with the Y-axis coordinate set to 0. 3: Add floor to scene after scene is ready."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"Create light.js imported by index.js 1: Generate a white point light, and place at (-10, 15, -10). 2. Place the camera at (0, 15, 15) and orient it towards the position (0, 0, 0)."} -{"id":"task-4","date":"2025-05-12","level":"moderate","description":"Create snake.js imported by index.js 1: Create a group named snake, and set this group.name to snake. Place the group in the center of the floor. 2: Generate a gray cone geometry which radius is 0.5 and height is 1, named snakeHead, and add to the snake group. Then set snakeHead.name to snake_head. Place snakeHead to center of the group."} -{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Edit snake.js . 1: Create 3 snakeBody segments and add them behind the snakeHead, Ensure that the snakeBody is a straight line with the snake head at the top and the snake tail at the bottom. 2: Every snakeBody is a lightgray sphere which radius is 0.5 ."} -{"id":"task-6","date":"2025-05-12","level":"challenging","description":"Edit index.js 1: When the user presses the up, down, left, and right keys on the keyboard, the snakeHead is controlled to move to top, bottom, left, and right by one unit respectively. 2: The apex of snakeHead always points in the direction of recent movement. 3: Ensuring that when the user moves the snakeHead, all the snakeBody follows the way closely. 4: All the snake part can not over other self part."} -{"id":"task-7","date":"2025-05-12","level":"challenging","description":"Create fence.js imported by index.js 1: Create a group named fences, and set this group.name to fences. 2: Generate fence, and it is a 1 * 1 * 1 darkgreen cuboid, and then add these fences in fences group. Repeat the above steps to add fences around the floor. 3: The snake cannot be moved on the fences by the user, so collision detection is required"} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Create candy.js imported by index.js 1: Generate a pink spherical object with a radius of 0.3 and name it candy. 2: Place the candy in the center of the cell at the top-left corner of the map. If the current cell is occupied(eg: snake or other objects), move one cell to the right. If it encounters a fence, move to the leftmost cell of the next row. Continue this process until the candy is successfully placed. 3: When the candy eaten by snake, reposition the candy to a new cell according to the above rules."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: When the snakeHead eats a candy, the snakeBody will grow by one unit."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Create animation.js imported by index.js 1: Add a 3 seconds looping animation to the candy. The candy should move up and down along the y-axis within the range of 0.5 to 1.5, moving at a constant speed."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Create portal.js imported by index.js 1: Create a group named portals. 2: Generate a pair of portal units at the top-right and bottom-left corners of the map, and place them in the portal group. 3: When the snakeHead collides with a portal unit, it will be immediately transported to the coordinates of the other portal."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Edit portal.js & animation.js 1: Set the portal units to be standing, ring shapes smaller than one unit in length. Create a 3-second frame animation that makes the portal rotate along the y-axis and gradually change colors in the order of red, yellow, and blue."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: Ensure that the candy cannot be generated over the portal units."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Create control.js imported by index.js 1: When the left mouse button is pressed and dragging, The camera view can rotate around the camera position by the mouse movement. 2: When the mouse wheel is scrolled, the camera moves forward or backward in the direction it is facing. 3: When the right mouse button is pressed and dragging, the camera moves horizontally on the x and z axes. 4: The camera's horizontal movement should consider its current position and orientation, should be moving in the direction of the mouse orientation."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Edit control.js 1: When the 'h' button is preesed, the camera reset to the initial position and orientation"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Edit control.js & index.js 1: After user press the 'l' button, the snakeHead direction changed, the camera will be rotated to the new direction immediately. 2: User can press the 'l' button again to disable this feature."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Edit index.js 1: When the snake enters a dead-end, all of the snake's states need to be reset, and the candy should be placed back to its initial position."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Edit some files. 1. When the user presses 'a', the snake starts to automatically move in the current direction, moving one unit every half second. Pressing 'a' again disable this automatically movement."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: When the snake passes through the portal, set all snake's objects color to the current color of the portal."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: When the snake's length reaches 20 units, it is considered a game victory, and all objects in the scene should be removed."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"Edit index.js 1: Generate a basic Scene named scene and assign to window.scene. 2: Generate a basic PerspectiveCamera named camera and assign to window.camera. Do not add any other code. 2: Generate a basic WebGLRenderer and assign to window.renderer with full window size, named renderer, and append render dom into #root. 3: Auto render the scene and camera with requestAnimationFrame.","project":"threejs"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Create floor.js imported by index.js 1: Generate a green 8x8 PlaneGeometry named floor. Set this floor.name to floor. 2: Set the floor along the X and Z axes, with the Y-axis coordinate set to 0. 3: Add floor to scene after scene is ready.","project":"threejs"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"Create light.js imported by index.js 1: Generate a white point light, and place at (-10, 15, -10). 2. Place the camera at (0, 15, 15) and orient it towards the position (0, 0, 0).","project":"threejs"} +{"id":"task-4","date":"2025-05-12","level":"moderate","description":"Create snake.js imported by index.js 1: Create a group named snake, and set this group.name to snake. Place the group in the center of the floor. 2: Generate a gray cone geometry which radius is 0.5 and height is 1, named snakeHead, and add to the snake group. Then set snakeHead.name to snake_head. Place snakeHead to center of the group.","project":"threejs"} +{"id":"task-5","date":"2025-05-12","level":"moderate","description":"Edit snake.js . 1: Create 3 snakeBody segments and add them behind the snakeHead, Ensure that the snakeBody is a straight line with the snake head at the top and the snake tail at the bottom. 2: Every snakeBody is a lightgray sphere which radius is 0.5 .","project":"threejs"} +{"id":"task-6","date":"2025-05-12","level":"challenging","description":"Edit index.js 1: When the user presses the up, down, left, and right keys on the keyboard, the snakeHead is controlled to move to top, bottom, left, and right by one unit respectively. 2: The apex of snakeHead always points in the direction of recent movement. 3: Ensuring that when the user moves the snakeHead, all the snakeBody follows the way closely. 4: All the snake part can not over other self part.","project":"threejs"} +{"id":"task-7","date":"2025-05-12","level":"challenging","description":"Create fence.js imported by index.js 1: Create a group named fences, and set this group.name to fences. 2: Generate fence, and it is a 1 * 1 * 1 darkgreen cuboid, and then add these fences in fences group. Repeat the above steps to add fences around the floor. 3: The snake cannot be moved on the fences by the user, so collision detection is required","project":"threejs"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"Create candy.js imported by index.js 1: Generate a pink spherical object with a radius of 0.3 and name it candy. 2: Place the candy in the center of the cell at the top-left corner of the map. If the current cell is occupied(eg: snake or other objects), move one cell to the right. If it encounters a fence, move to the leftmost cell of the next row. Continue this process until the candy is successfully placed. 3: When the candy eaten by snake, reposition the candy to a new cell according to the above rules.","project":"threejs"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: When the snakeHead eats a candy, the snakeBody will grow by one unit.","project":"threejs"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"Create animation.js imported by index.js 1: Add a 3 seconds looping animation to the candy. The candy should move up and down along the y-axis within the range of 0.5 to 1.5, moving at a constant speed.","project":"threejs"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"Create portal.js imported by index.js 1: Create a group named portals. 2: Generate a pair of portal units at the top-right and bottom-left corners of the map, and place them in the portal group. 3: When the snakeHead collides with a portal unit, it will be immediately transported to the coordinates of the other portal.","project":"threejs"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"Edit portal.js & animation.js 1: Set the portal units to be standing, ring shapes smaller than one unit in length. Create a 3-second frame animation that makes the portal rotate along the y-axis and gradually change colors in the order of red, yellow, and blue.","project":"threejs"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: Ensure that the candy cannot be generated over the portal units.","project":"threejs"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"Create control.js imported by index.js 1: When the left mouse button is pressed and dragging, The camera view can rotate around the camera position by the mouse movement. 2: When the mouse wheel is scrolled, the camera moves forward or backward in the direction it is facing. 3: When the right mouse button is pressed and dragging, the camera moves horizontally on the x and z axes. 4: The camera's horizontal movement should consider its current position and orientation, should be moving in the direction of the mouse orientation.","project":"threejs"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"Edit control.js 1: When the 'h' button is preesed, the camera reset to the initial position and orientation","project":"threejs"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"Edit control.js & index.js 1: After user press the 'l' button, the snakeHead direction changed, the camera will be rotated to the new direction immediately. 2: User can press the 'l' button again to disable this feature.","project":"threejs"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Edit index.js 1: When the snake enters a dead-end, all of the snake's states need to be reset, and the candy should be placed back to its initial position.","project":"threejs"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Edit some files. 1. When the user presses 'a', the snake starts to automatically move in the current direction, moving one unit every half second. Pressing 'a' again disable this automatically movement.","project":"threejs"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: When the snake passes through the portal, set all snake's objects color to the current color of the portal.","project":"threejs"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"Edit some files. 1: When the snake's length reaches 20 units, it is considered a game victory, and all objects in the scene should be removed.","project":"threejs"} \ No newline at end of file diff --git a/datasets/typescript.jsonl b/datasets/typescript.jsonl index 6b2ff1c2ccd597877d8617637959659a2ed950f4..030eefc2c3838821e8da73d9763657073c82798f 100644 --- a/datasets/typescript.jsonl +++ b/datasets/typescript.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"InputSetter、NumberSetter、CheckboxSetter add optional type onChange. onChange is a function type, parameter is the value of the corresponding type and may be undefined, return type is void.\n"} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"Create a file at types/setter-check.ts that exports the function isInputSetter to check the Setter is InputSetter.\n"} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"1. Export interface `BaseSetter`, has `value` and `onChange`, onChange is a function type, parameter is the value of the corresponding type and may be undefined, return type is void.\n2. BaseSetter all types are required.\n3. Export type OptionalBaseSetter, has the same type of BaseSetter, but all types are optional.\n4. InputSetter、NumberSetter、CheckboxSetter extends OptionalBaseSetter.\n"} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"In types/setter.ts:\n 1. Export type `SetterValueType` that includes primitive string, number, boolean, array, object. Array and Object are strictly of type SetterValueType.\n 2. The BaseSetter's value is strictly of type SetterValueType.\n"} -{"id":"task-5","level":"easy","date":"2025-05-12","description":"In types/setter.ts create and export a type `ValueSetter`, Dynamically create supported Setter types according to the provided generic type.\n"} -{"id":"task-6","date":"2025-05-12","level":"moderate","description":"In types/setter.ts: create and export Setter `PasswordSetter` type 'password' and value type string.\n"} -{"id":"task-7","date":"2025-05-12","level":"moderate","description":"In types/setter.ts: create and export Setter `SelectSetter` type 'select' and value could be string or number.\n"} -{"id":"task-8","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export Setter `ArraySetter`:\n - type 'array'\n - item: dynamically create supported Setter types according to the value item.\n"} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export Setter `TupleSetter`:\n - type: 'tuple'\n - items: each item is a Setter with the corresponding type in the tuple.\n"} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export Setter `ObjectSetter`:\n - type 'object'\n - properties: dynamically create supported Setter types according to the value type\n"} -{"id":"task-11","date":"2025-05-12","level":"moderate","description":"In types/setter.ts, create and export Setter `CustomSetter`:\n - type 'custom' and customType string\n - value implements generic ValueType \nIn ValueSetter, CustomSetter supports any type of value.\n"} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"The Setter implements generic ValueType where:\n 1. ArraySetter, ObjectSetter and CustomSetter inherit the ValueType from their parent Setter\n 2. InputSetter maintains backward compatibility without ValueType constraints\n"} -{"id":"task-13","date":"2025-05-12","level":"moderate","description":"Create a file at types/schema.ts that exports interface `FormSchema`:\n fields: dynamically create supported Setter types according to the form value type.\n\nIn types/setter.ts, create and export interfaces:\n 1. ExpressionEvent with generic SetterValue and FormValue:\n - value: generic type SetterValue\n - formValue: generic type FormValue, FormValue's constraints align with FormSchema.\n\n 2. Expression with generic SetterValue, FormValue and ExpressionValue:\n - type: 'expression'\n - value: value is a function type, parameter is ExpressionEvent, return type is generic type ExpressionValue.\n 3. SetterMaybeExpression: Expression or generic type ExpressionValue\n \n"} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"In BaseSetter, add optional prop `visible`\n - a SetterMaybeExpression with ExpressionValue constrained to boolean and FormValue depends on BaseSetter's FormValue.\nFormSchema needs to pass FormValue to the Setter to populate the visible property of BaseSetter, and omitting the Setter will not cause errors.\n"} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export `CustomSetterRender`, has prop `render` which is a FC from React, props contain:\n - all props in generic type Props\n - value\n - onChange, onChange's param newValue could be empty and type depends on `value`\nAdd a new prop customSetterRenderDefinitions to FormSchema:\n Type: A generic type CustomSetterRenderDef, which is an object type where keys are strings and values are of type CustomSetterRender.\n Requirement: The customSetterRenderDefinitions prop must include all CustomSetterRender definitions specified by the generic CustomSetterRenderDef.\n"} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"CustomSetter needs to constrain the type of customType. In the fields of FormSchema, the customType must be included in the key of CustomSetterRenderDef.\n"} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add a new optional prop `props` to CustomSetter:\n The type of `props` is determined by the parameters of CustomSetterRender corresponding to customType in CustomSetterRenderDef, and these parameters must omit the `value` and `onChange`.\n"} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Add a prop `ctxValue` to ExpressionEvent:\n - type CtxValue.\n - Only the item within an ArraySetter creates a ctxValue, whose type matches the array item's type. \n - If not inside an ArraySetter, ctxValue defaults to the FormValue type.\n"} -{"id":"task-19","date":"2025-05-12","level":"moderate","description":"Edit CustomSetter customType:\n customType can't be string with hyphen.\n"} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"In types/schema.ts, create and export interface `EditorRef`:\n - setSetterValueByPath: \n param1: path, an array of nested property keys on FormValue (type-restricted to valid nested paths of FormValue).\n param2: value, the value to set, whose type must match the nested property type inferred from path.\n return: void\n"} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"InputSetter、NumberSetter、CheckboxSetter add optional type onChange. onChange is a function type, parameter is the value of the corresponding type and may be undefined, return type is void.\n","project":"typescript"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"Create a file at types/setter-check.ts that exports the function isInputSetter to check the Setter is InputSetter.\n","project":"typescript"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"1. Export interface `BaseSetter`, has `value` and `onChange`, onChange is a function type, parameter is the value of the corresponding type and may be undefined, return type is void.\n2. BaseSetter all types are required.\n3. Export type OptionalBaseSetter, has the same type of BaseSetter, but all types are optional.\n4. InputSetter、NumberSetter、CheckboxSetter extends OptionalBaseSetter.\n","project":"typescript"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"In types/setter.ts:\n 1. Export type `SetterValueType` that includes primitive string, number, boolean, array, object. Array and Object are strictly of type SetterValueType.\n 2. The BaseSetter's value is strictly of type SetterValueType.\n","project":"typescript"} +{"id":"task-5","level":"easy","date":"2025-05-12","description":"In types/setter.ts create and export a type `ValueSetter`, Dynamically create supported Setter types according to the provided generic type.\n","project":"typescript"} +{"id":"task-6","date":"2025-05-12","level":"moderate","description":"In types/setter.ts: create and export Setter `PasswordSetter` type 'password' and value type string.\n","project":"typescript"} +{"id":"task-7","date":"2025-05-12","level":"moderate","description":"In types/setter.ts: create and export Setter `SelectSetter` type 'select' and value could be string or number.\n","project":"typescript"} +{"id":"task-8","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export Setter `ArraySetter`:\n - type 'array'\n - item: dynamically create supported Setter types according to the value item.\n","project":"typescript"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export Setter `TupleSetter`:\n - type: 'tuple'\n - items: each item is a Setter with the corresponding type in the tuple.\n","project":"typescript"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export Setter `ObjectSetter`:\n - type 'object'\n - properties: dynamically create supported Setter types according to the value type\n","project":"typescript"} +{"id":"task-11","date":"2025-05-12","level":"moderate","description":"In types/setter.ts, create and export Setter `CustomSetter`:\n - type 'custom' and customType string\n - value implements generic ValueType \nIn ValueSetter, CustomSetter supports any type of value.\n","project":"typescript"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"The Setter implements generic ValueType where:\n 1. ArraySetter, ObjectSetter and CustomSetter inherit the ValueType from their parent Setter\n 2. InputSetter maintains backward compatibility without ValueType constraints\n","project":"typescript"} +{"id":"task-13","date":"2025-05-12","level":"moderate","description":"Create a file at types/schema.ts that exports interface `FormSchema`:\n fields: dynamically create supported Setter types according to the form value type.\n\nIn types/setter.ts, create and export interfaces:\n 1. ExpressionEvent with generic SetterValue and FormValue:\n - value: generic type SetterValue\n - formValue: generic type FormValue, FormValue's constraints align with FormSchema.\n\n 2. Expression with generic SetterValue, FormValue and ExpressionValue:\n - type: 'expression'\n - value: value is a function type, parameter is ExpressionEvent, return type is generic type ExpressionValue.\n 3. SetterMaybeExpression: Expression or generic type ExpressionValue\n \n","project":"typescript"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"In BaseSetter, add optional prop `visible`\n - a SetterMaybeExpression with ExpressionValue constrained to boolean and FormValue depends on BaseSetter's FormValue.\nFormSchema needs to pass FormValue to the Setter to populate the visible property of BaseSetter, and omitting the Setter will not cause errors.\n","project":"typescript"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"In types/setter.ts, create and export `CustomSetterRender`, has prop `render` which is a FC from React, props contain:\n - all props in generic type Props\n - value\n - onChange, onChange's param newValue could be empty and type depends on `value`\nAdd a new prop customSetterRenderDefinitions to FormSchema:\n Type: A generic type CustomSetterRenderDef, which is an object type where keys are strings and values are of type CustomSetterRender.\n Requirement: The customSetterRenderDefinitions prop must include all CustomSetterRender definitions specified by the generic CustomSetterRenderDef.\n","project":"typescript"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"CustomSetter needs to constrain the type of customType. In the fields of FormSchema, the customType must be included in the key of CustomSetterRenderDef.\n","project":"typescript"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"Add a new optional prop `props` to CustomSetter:\n The type of `props` is determined by the parameters of CustomSetterRender corresponding to customType in CustomSetterRenderDef, and these parameters must omit the `value` and `onChange`.\n","project":"typescript"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"Add a prop `ctxValue` to ExpressionEvent:\n - type CtxValue.\n - Only the item within an ArraySetter creates a ctxValue, whose type matches the array item's type. \n - If not inside an ArraySetter, ctxValue defaults to the FormValue type.\n","project":"typescript"} +{"id":"task-19","date":"2025-05-12","level":"moderate","description":"Edit CustomSetter customType:\n customType can't be string with hyphen.\n","project":"typescript"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"In types/schema.ts, create and export interface `EditorRef`:\n - setSetterValueByPath: \n param1: path, an array of nested property keys on FormValue (type-restricted to valid nested paths of FormValue).\n param2: value, the value to set, whose type must match the nested property type inferred from path.\n return: void\n","project":"typescript"} \ No newline at end of file diff --git a/datasets/unocss.jsonl b/datasets/unocss.jsonl index d3b783381cae4d76a0ff855b6cd10fd3febdb98d..bfdc1348d18786defdfe5a07a78fb5762caeeea3 100644 --- a/datasets/unocss.jsonl +++ b/datasets/unocss.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE unocss tailwind 4 syntax, grid only, NO flex, float and position, NO js."} -{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. USE tailwind grid only."} -{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. USE tailwind grid only too."} -{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. USE tailwind grid only."} -{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px. USE tailwind grid only."} -{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear. USE tailwind grid only."} -{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content. USE tailwind grid only."} -{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width. USE tailwind grid only."} -{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE tailwind grid only."} -{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE tailwind grid only."} -{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar."} -{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled."} -{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content."} -{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content."} -{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE tailwind grid only."} -{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css property to reverse the order of the last 2 cards."} -{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient."} -{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content."} -{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width."} -{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height."} \ No newline at end of file +{"id":"task-1","date":"2025-05-12","level":"easy","description":"add divs(class 'header', 'footer', 'content') with arbitrary text in '.root' element. '.root' occupies total viewport and children elements together occupy total '.root' space. header (border-box) is always fixed at the top of '.root'; footer (border-box) is always fixed at the bottom of '.root'; content (border-box) occupies the remaining '.root' space. USE unocss tailwind 4 syntax, grid only, NO flex, float and position, NO js.","project":"unocss"} +{"id":"task-2","date":"2025-05-12","level":"easy","description":"add divs(class 'leftbar', 'rightbar') with arbitrary text in '.root' element. leftbar (border-box) is fixed at the left of '.root'; rightbar (border-box) is fixed at the right of '.root'; content occupies the remaining '.root' space. USE tailwind grid only.","project":"unocss"} +{"id":"task-3","date":"2025-05-12","level":"easy","description":"clear header content. add menu(class 'menu') with 3 items(arbitrary text) at the right side of header. USE tailwind grid only too.","project":"unocss"} +{"id":"task-4","date":"2025-05-12","level":"easy","description":"add logo(class 'logo') with arbitrary background color at the left side of header. USE tailwind grid only.","project":"unocss"} +{"id":"task-5","date":"2025-05-12","level":"easy","description":"leftbar width is the smaller of 200px and 20vw. rightbar width is the bigger of 200px and 20vw. leftbar should disappear when page width is equal to or less than 799px. USE tailwind grid only.","project":"unocss"} +{"id":"task-6","date":"2025-05-12","level":"easy","description":"when page width is equal to or less than 399px, menu items should have evenly spaced distribution in the whole header space and logo should disappear. USE tailwind grid only.","project":"unocss"} +{"id":"task-7","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, content and rightbar should occupy full page width and rightbar should be at the bottom of content. USE tailwind grid only.","project":"unocss"} +{"id":"task-8","date":"2025-05-12","level":"easy","description":"when page width is less than 400px, each menu item should occupy full page width. USE tailwind grid only.","project":"unocss"} +{"id":"task-9","date":"2025-05-12","level":"challenging","description":"separate leftbar whole space into 20 rows and 2 columns. fill each cell with text 'this is a very long text sample to test word wrap'. USE tailwind grid only.","project":"unocss"} +{"id":"task-10","date":"2025-05-12","level":"challenging","description":"separate rightbar whole space into 10 rows and 2 columns; fill 40 items in the rightbar whole space. fill each item with text 'this-is-a-very-long-text-sample-to-test-overflow'. USE tailwind grid only.","project":"unocss"} +{"id":"task-11","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, display the first 3 rows in rightbar.","project":"unocss"} +{"id":"task-12","date":"2025-05-12","level":"challenging","description":"show 12 cards (class 'card') in content with 3 per row, 100px minimum height each and vertical scrolling enabled.","project":"unocss"} +{"id":"task-13","date":"2025-05-12","level":"challenging","description":"when page width is less than 1000px, display 2 cards per row in content.","project":"unocss"} +{"id":"task-14","date":"2025-05-12","level":"challenging","description":"when page width is less than 600px, display 1 card per row in content.","project":"unocss"} +{"id":"task-15","date":"2025-05-12","level":"challenging","description":"each card has a image(class 'card-image'), title and price; title's minimum height is 1.5rem and no wrap, text is 'Long Product Title That Goes Here'; price's minimum height is 1rem; image uses the remaining space. USE tailwind grid only.","project":"unocss"} +{"id":"task-16","date":"2025-05-12","level":"challenging","description":"only change card css property to reverse the order of the last 2 cards.","project":"unocss"} +{"id":"task-17","date":"2025-05-12","level":"challenging","description":"add a logo(class 'footer-logo') and info (class 'footer-info') in the footer. footer-info should never wrap and should show ellipsis when space is insufficient.","project":"unocss"} +{"id":"task-18","date":"2025-05-12","level":"challenging","description":"add left-drag and right-drag with absolute positions at the left and right sides of the content; left-drag and right-drag are not visible by default and become visible when mouse hovers over content.","project":"unocss"} +{"id":"task-19","date":"2025-05-12","level":"challenging","description":"gen js, drag right-drag and left-drag to adjust content width.","project":"unocss"} +{"id":"task-20","date":"2025-05-12","level":"challenging","description":"when page width is less than 400px, move right-drag to the bottom of content and drag right-drag to adjust content height.","project":"unocss"} \ No newline at end of file diff --git a/datasets/vite.jsonl b/datasets/vite.jsonl index 4678dc17e5dd869f641a877311e694400b3bd17d..ff46c433e93075fba76e40be0d4f239336c37baf 100644 --- a/datasets/vite.jsonl +++ b/datasets/vite.jsonl @@ -1,20 +1,20 @@ -{"id":"task-1","date":"2025-05-12","level":"easy","description":"Setup project with vite. Here are the requirements:\n- Add dev and build to npm scripts.\n- Set dev server port to environment variable `process.env.PROJECT_PORT`.\n- Generate sourceMap after bundling.\n- Set output directory to `dist`.\n- Update public path to \"./\". After bundling, the `src` attribute of