Compare commits
No commits in common. "05ee36b5931ba426ebd44af3a636472861bf9b1c" and "cb1004584e0cfaf90a25fe4901ffc6fdcdc0cd1d" have entirely different histories.
05ee36b593
...
cb1004584e
@ -1,81 +1,60 @@
|
|||||||
# Task 4 Report: [Click To Toggle Visual State]
|
# Task: [Feature Name]
|
||||||
|
|
||||||
## Objective
|
## Objective
|
||||||
Click an object and persistently toggle between two visual states (e.g., color lime/blue).
|
What is the feature trying to do?
|
||||||
|
|
||||||
## Vanilla Three.js
|
## Vanilla three.js
|
||||||
- Possible: **Yes**
|
-Possible: Yes / Partial / No
|
||||||
- Notes: Requires setting up a `Raycaster` + `mousedown` event, manually tracking a boolean state variable, and updating the material color on every click hit.
|
-Notes:
|
||||||
- Key concepts: `Persistent State Variable`, `if/else logic`, `Mutation Loop`.
|
-Key concepts:
|
||||||
- Complexity: **Medium**.
|
-Complexity: Easy / Medium / Hard
|
||||||
|
|
||||||
## R3F
|
## R3F
|
||||||
- Possible: **Yes**
|
-Possible: Yes / Partial / No
|
||||||
- Notes: Inherently simple. React's `useState` hook naturally handles the persistent toggle, and the `mesh` declarative `onClick` prop makes wiring it trivial.
|
-Notes:
|
||||||
- What R3F abstracted: `Raycaster computation`, `State-to-Visual binding`.
|
-What R3F abstracted:
|
||||||
- Complexity: **Easy** (Very concise).
|
-Complexity: Easy / Medium / Hard
|
||||||
|
|
||||||
## Thob Page Builder
|
## Thob Page Builder
|
||||||
- Possible: **No (based on current testing)**
|
-Possible: Yes / Partial / No
|
||||||
-Notes:
|
-Notes:
|
||||||
- The `onClick` trigger is visible in the UI, but did not result in observable state changes during testing
|
-Builder steps:
|
||||||
- No clear mechanism for defining or managing persistent state (e.g., toggle variable)
|
-Complexity: Easy / Medium / Hard
|
||||||
- Unable to switch between two visual states using interaction
|
|
||||||
- Builder steps: `N/A`
|
|
||||||
- Complexity: **Limited** (interaction + state system not clearly supported)
|
|
||||||
|
|
||||||
## Comparison Summary
|
## Comparison Summary
|
||||||
- Possible in all 3? **No** (toggle interaction not achieved in builder)
|
-Possible in all 3? Yes / Partial / No
|
||||||
|
|
||||||
-Main differences:
|
-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:
|
-Where Thob is better:
|
||||||
- Static visual configuration
|
|
||||||
|
|
||||||
-Where Thob is weaker:
|
-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:
|
-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)
|
## Limitation Type (if any)
|
||||||
-[ ] Editor UX limitation
|
-[ ] Editor UX limitation
|
||||||
- [x] Runtime limitation (event execution unclear)
|
-[ ] Runtime limitation
|
||||||
-[ ] Schema / data model limitation
|
-[ ] Schema / data model limitation
|
||||||
-[ ] Component limitation
|
-[ ] Component limitation
|
||||||
- [x] Event system limitation
|
-[ ] Event system limitation
|
||||||
- [x] Property binding limitation (no state system)
|
|
||||||
-[ ] Asset pipeline limitation
|
-[ ] Asset pipeline limitation
|
||||||
-[ ] Unknown / needs investigation
|
-[ ] Unknown / needs investigation
|
||||||
|
|
||||||
## Workaround
|
## Workaround
|
||||||
- No reliable workaround found for toggle interaction
|
-Is there a workaround?
|
||||||
- May require additional configuration or future feature support
|
-If yes, what is it?
|
||||||
|
|
||||||
## Suggested Improvement
|
## Suggested Improvement
|
||||||
- Improve reliability of `onClick` event execution
|
-What should improve in Thob?
|
||||||
- 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:
|
-Is it:
|
||||||
- editor (Yes)
|
-editor
|
||||||
- runtime (Yes)
|
-runtime
|
||||||
- component (No)
|
-component
|
||||||
- UX (Yes)
|
-UX
|
||||||
- schema/data (Yes)
|
-schema/data
|
||||||
|
|
||||||
## Difficulty Estimate
|
## Difficulty Estimate
|
||||||
- **Medium**
|
-Easy / Medium / Hard
|
||||||
|
|
||||||
## Business Value
|
## Business Value
|
||||||
- **Critical** (Toggle interactions are essential for product configurators and interactive experiences)
|
-Low / Medium / High
|
||||||
|
|
||||||
## Recommendation
|
## Recommendation
|
||||||
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.
|
Should Thob support this better? Why?
|
||||||
|
|||||||
@ -1,71 +0,0 @@
|
|||||||
# Builder Exploration Notes — Task 4: Click To Toggle Visual State
|
|
||||||
|
|
||||||
## Capability Gap Identified
|
|
||||||
|
|
||||||
- **Click Interaction Behavior**:
|
|
||||||
- `onClick` trigger is available in the UI, but did not produce visible state changes during testing
|
|
||||||
- Interaction execution appears inconsistent or unclear
|
|
||||||
|
|
||||||
- **State Management**:
|
|
||||||
- No visible support for defining or managing state variables (e.g., boolean toggle)
|
|
||||||
- No clear mechanism to store or switch between visual states
|
|
||||||
|
|
||||||
- **Visual State Transition**:
|
|
||||||
- Unable to toggle between two visual states (e.g., color change)
|
|
||||||
- Object remains in default appearance despite interaction attempts
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Observations
|
|
||||||
|
|
||||||
- Interaction system UI is present but lacks clear connection between events and property updates
|
|
||||||
- No built-in concept of "state" for managing toggles
|
|
||||||
- Event-to-property binding is not intuitive or not functioning as expected
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Comparison vs Code
|
|
||||||
|
|
||||||
- **Vanilla**:
|
|
||||||
- Requires raycasting + manual state handling
|
|
||||||
- Fully flexible but verbose
|
|
||||||
|
|
||||||
- **R3F**:
|
|
||||||
- Simple toggle using `onClick` + `useState`
|
|
||||||
- Very clean and reliable
|
|
||||||
|
|
||||||
- **Thob**:
|
|
||||||
- Click interaction present in UI
|
|
||||||
- Toggle behavior could not be achieved during testing
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Key Insight
|
|
||||||
|
|
||||||
The builder currently lacks a clear state management system and reliable event-to-property binding, making it difficult to implement toggle-based interactions.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Product Perspective
|
|
||||||
|
|
||||||
Toggle interactions are essential for use cases like product configurators (e.g., switching colors, enabling features). Without reliable state handling, these use cases are difficult to implement.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Improvement Recommendations
|
|
||||||
|
|
||||||
1. **State Management UI**
|
|
||||||
- Introduce simple state variables (e.g., `isActive`, `isSelected`)
|
|
||||||
|
|
||||||
2. **Property Binding System**
|
|
||||||
- Allow material properties (color, visibility, etc.) to be linked to state variables
|
|
||||||
|
|
||||||
3. **Reliable Event Execution**
|
|
||||||
- Ensure `onClick` triggers consistently update state and reflect changes in the UI
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Verdict
|
|
||||||
|
|
||||||
Strong for **static visual configuration**
|
|
||||||
Limited for **state-driven interactions (toggle, dynamic behavior)**
|
|
||||||
Loading…
x
Reference in New Issue
Block a user