一键导入
harden
Improve Puree UI (YAML/SCSS/Python) resilience through text overflow handling, error states, and edge case management.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Improve Puree UI (YAML/SCSS/Python) resilience through text overflow handling, error states, and edge case management.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create distinctive, production-grade Puree UI interfaces with high design quality. Use this skill when the user asks to build UI panels, dashboards, toolbars, or Blender addon interfaces. Generates creative, polished YAML/SCSS/Python code that avoids generic AI aesthetics.
Review Puree UI code (YAML/SCSS/Python) for correctness, common mistakes, and best practices. Use when checking code quality, debugging render issues, or validating before shipping.
Improve Puree typography by fixing font choices, hierarchy, sizing, weight consistency, and readability in YAML/SCSS. Makes text feel intentional and polished.
Create distinctive, production-grade Puree UI interfaces with high design quality. Use this skill when the user asks to build UI panels, dashboards, toolbars, or Blender addon interfaces. Generates creative, polished YAML/SCSS/Python code that avoids generic AI aesthetics.
Review Puree UI code (YAML/SCSS/Python) for correctness, common mistakes, and best practices. Use when checking code quality, debugging render issues, or validating before shipping.
Improve Puree typography by fixing font choices, hierarchy, sizing, weight consistency, and readability in YAML/SCSS. Makes text feel intentional and polished.
| name | harden |
| description | Improve Puree UI (YAML/SCSS/Python) resilience through text overflow handling, error states, and edge case management. |
| user-invocable | true |
| argument-hint | Describe the component or panel to harden (e.g. "text input fields", "file list panel") |
Strengthen Puree interfaces against edge cases, errors, missing resources, and real-world usage scenarios that break idealized designs.
Identify weaknesses and edge cases:
Test with extreme inputs:
Test error scenarios:
Test resource scenarios:
assets/ directoryfonts/ directoryCRITICAL: Designs that only work with perfect data aren't production-ready. Harden against reality.
Systematically improve resilience:
Long text handling in Puree:
// Single line with ellipsis — works in Puree
.truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Puree supports text-overflow: ellipsis and white-space: nowrap. Use these on any container that displays dynamic text.
Flex/Grid overflow:
// Prevent flex items from overflowing
.flex_item {
min-width: 0;
overflow: hidden;
}
// Prevent grid items from overflowing
.grid_item {
min-width: 0;
min-height: 0;
}
Text sizing considerations:
@media breakpoints to adjust font-size for different panel widthsExample — safe text container:
.dynamic_label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
min-width: 0;
}
Wrap Blender data access in try/except:
def main(self, app):
def on_click(container):
try:
obj = bpy.context.active_object
if obj is None:
status_label = app.find("status_label")
status_label.text = "No active object selected"
status_label.mark_dirty()
return
name_label = app.find("object_name")
name_label.text = obj.name
name_label.mark_dirty()
except Exception as e:
error_label = app.find("error_text")
error_label.text = f"Error: {str(e)}"
error_label.mark_dirty()
app.find("refresh_button").click.append(on_click)
return app
Guard against missing containers:
def safe_find(app, name):
"""Find a container, return None if not found."""
try:
return app.find(name)
except:
return None
def on_click(container):
label = safe_find(app, "status_label")
if label:
label.text = "Updated"
label.mark_dirty()
Handle Blender state changes:
NoneAlways call mark_dirty() after property changes:
# ❌ Bad: text changes but UI doesn't update
container.text = "New value"
# ✅ Good: UI updates to reflect new text
container.text = "New value"
container.mark_dirty()
Batch property changes before marking dirty:
# ✅ Good: one mark_dirty() for multiple changes
container.text = "Updated"
container.set_property('background-color', 'rgba(255,0,0,0.2)')
container.mark_dirty()
Missing images:
assets/ before referencing thembackground-color that looks intentional even without an imageMissing fonts:
default_font — ensure it's always availablefonts/ directory and reference them correctlyExample — fallback styling:
// Looks acceptable even without background image
.card_with_image {
background-color: #2a2d35;
border-radius: 8px;
padding: 16px;
}
Empty states:
Example — empty state in YAML:
object_list:
style: object_list
empty_message:
style: empty_state
text: 'No objects found. Select objects in the viewport.'
font: NeueMontreal-Regular
.empty_state {
color: rgba(180, 180, 180, 0.6);
font-size: 13px;
text-align: center;
--text-align-v: center;
padding: 20px;
}
Loading states:
Large datasets:
display: none to hide off-screen itemsConcurrent operations:
is_processing = False
def on_click(container):
global is_processing
if is_processing:
return
is_processing = True
try:
# ... do work ...
pass
finally:
is_processing = False
Validate data in Python before displaying:
def safe_display_name(name, max_length=30):
"""Truncate long names for display."""
if len(name) > max_length:
return name[:max_length - 3] + "..."
return name
Always constrain containers:
// ❌ Bad: content can overflow
.label {
font-size: 14px;
}
// ✅ Good: overflow handled gracefully
.label {
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
Use percentage widths with constraints:
.panel_content {
width: 100%;
max-width: 600px;
min-width: 150px;
}
Handle visibility for conditional content:
.error_message {
display: none;
color: #e74c3c;
font-size: 12px;
}
Then show/hide via Python:
def show_error(app, message):
error = app.find("error_message")
error.text = message
error.set_property('display', 'flex')
error.mark_dirty()
def hide_error(app):
error = app.find("error_message")
error.set_property('display', 'none')
error.mark_dirty()
Manual testing:
Edge case checklist:
IMPORTANT: Hardening is about expecting the unexpected. Real Blender users will do things you never imagined.
NEVER:
mark_dirty() after property changes (silent failure)Test thoroughly with edge cases:
Remember: You're hardening for production reality, not demo perfection. Expect users to have unexpected Blender configurations, missing files, and edge-case data. Build resilience into every container and every Python handler.