Decision Tree: Frontend Changes in Rock
Is the block a Core Rock block?
- Yes → Avoid editing directly
- No → Proceed to next step
Is your change purely UI/CSS/UX tweak (color, outline, icon, animation)?
- Yes → Use JS/CSS injection (via Page Settings > HTML/CSS or Lava block)
- No → Proceed
Does the change involve logic (saving, validation, data fetch) or new UI elements?
- Yes → Check if Obsidian React block
- Yes → Create Custom React block extension or Custom SPA block (in Obsidian)
- No → If legacy WebForms block, consider Custom ASP.NET block clone
- No → Consider just CSS tweaks or client JS
- Yes → Check if Obsidian React block
Is the change shared or generic enough for contribution?
- Yes → Propose PR to Rock (Spark) Core repo
- No → Keep as local/custom extension or page script
Will rapid UI feedback outpace server state sync?
- Yes → Accept minor desync OR build UI sync logic with REST or event hooks
- No → Simple UI toggle sufficient
Tradeoff Summary:
Approach | Pros | Cons | Use When |
---|---|---|---|
JS/CSS Injection | Fast, no core touch | Potential UI/Server desync | UI tweaks, quick fixes |
Custom React SPA Block | Full UI control, SPA | Higher dev time, learning curve | New UI features, complex logic |
Custom WebForms Block | Familiar legacy approach | Hard to maintain long-term | Legacy heavy customization |
Contribute Core PR | Benefits all Rock users | Requires approval & process | Broad, reusable improvements |