From 05ee36b5931ba426ebd44af3a636472861bf9b1c Mon Sep 17 00:00:00 2001 From: divyap Date: Tue, 31 Mar 2026 00:15:23 +0530 Subject: [PATCH] docs: update task-4 comparison report --- Week-1/Task-4/report.md | 99 +++++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 39 deletions(-) diff --git a/Week-1/Task-4/report.md b/Week-1/Task-4/report.md index a017c0d..263f6a8 100644 --- a/Week-1/Task-4/report.md +++ b/Week-1/Task-4/report.md @@ -1,60 +1,81 @@ -# Task: [Feature Name] +# Task 4 Report: [Click To Toggle Visual State] ## Objective -What is the feature trying to do? +Click an object and persistently toggle between two visual states (e.g., color lime/blue). -## Vanilla three.js --Possible: Yes / Partial / No --Notes: --Key concepts: --Complexity: Easy / Medium / Hard +## Vanilla Three.js +- Possible: **Yes** +- Notes: Requires setting up a `Raycaster` + `mousedown` event, manually tracking a boolean state variable, and updating the material color on every click hit. +- Key concepts: `Persistent State Variable`, `if/else logic`, `Mutation Loop`. +- Complexity: **Medium**. ## R3F --Possible: Yes / Partial / No --Notes: --What R3F abstracted: --Complexity: Easy / Medium / Hard +- Possible: **Yes** +- Notes: Inherently simple. React's `useState` hook naturally handles the persistent toggle, and the `mesh` declarative `onClick` prop makes wiring it trivial. +- What R3F abstracted: `Raycaster computation`, `State-to-Visual binding`. +- Complexity: **Easy** (Very concise). ## Thob Page Builder --Possible: Yes / Partial / No --Notes: --Builder steps: --Complexity: Easy / Medium / Hard +- Possible: **No (based on current testing)** +- Notes: + - The `onClick` trigger is visible in the UI, but did not result in observable state changes during testing + - No clear mechanism for defining or managing persistent state (e.g., toggle variable) + - Unable to switch between two visual states using interaction +- Builder steps: `N/A` +- Complexity: **Limited** (interaction + state system not clearly supported) ## Comparison Summary --Possible in all 3? Yes / Partial / No --Main differences: --Where Thob is better: --Where Thob is weaker: --What feels awkward or unclear: +- Possible in all 3? **No** (toggle interaction not achieved in builder) + +- Main differences: + - **Vanilla**: Powerful but requires manual state management and more code + - **R3F**: Clean and efficient for state-driven interactions + - **Thob**: Interaction system present but lacks clear state handling and reliable execution + +- Where Thob is better: + - Static visual configuration + +- Where Thob is weaker: + - Lack of state management system + - Unclear event-to-property binding + - Interaction execution is not reliable during testing + +- What feels awkward or unclear: + - No visible way to define or store state (e.g., toggle) + - Interaction triggers exist but do not clearly connect to visual updates ## Limitation Type (if any) --[ ] Editor UX limitation --[ ] Runtime limitation --[ ] Schema / data model limitation --[ ] Component limitation --[ ] Event system limitation --[ ] Asset pipeline limitation --[ ] Unknown / needs investigation +- [ ] Editor UX limitation +- [x] Runtime limitation (event execution unclear) +- [ ] Schema / data model limitation +- [ ] Component limitation +- [x] Event system limitation +- [x] Property binding limitation (no state system) +- [ ] Asset pipeline limitation +- [ ] Unknown / needs investigation ## Workaround --Is there a workaround? --If yes, what is it? +- No reliable workaround found for toggle interaction +- May require additional configuration or future feature support ## Suggested Improvement --What should improve in Thob? --Is it: - -editor - -runtime - -component - -UX - -schema/data +- Improve reliability of `onClick` event execution +- Introduce a simple **state management system** (e.g., boolean variables) +- Allow **property binding** between state and visual properties (e.g., color) +- Provide clearer feedback when interaction actions fail + +- Is it: + - editor (Yes) + - runtime (Yes) + - component (No) + - UX (Yes) + - schema/data (Yes) ## Difficulty Estimate --Easy / Medium / Hard +- **Medium** ## Business Value --Low / Medium / High +- **Critical** (Toggle interactions are essential for product configurators and interactive experiences) ## Recommendation -Should Thob support this better? Why? +To support real-world interactive use cases, the builder should improve its event system and introduce a clear state management mechanism, enabling reliable toggle-based interactions. \ No newline at end of file