Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Decision Lab: Making tradeoffs visible with Sanity

说明与用途

Decision Lab 允许用户使用加权标准比较选项,并在不编辑内容的情况下实时调整优先级。

问题

Decisions with no obvious winner need a way to compare options based on multiple criteria and adjust priorities without editing content.

结果

The Decision Lab app allows users to compare options based on weighted criteria, see how rankings change with priority adjustments, and edit decisions in Sanity without rebuilding the frontend.

工作流

  • Create a Sanity project and define a decision schema with criteria and options.
  • Add a React frontend that queries the public dataset with GROQ.
  • Implement scoring formula: fit = sum(score * criterion weight) / (5 * sum(criterion weight)) * 100.
  • Normalize missing score arrays in the query layer.
  • Add Studio validation to enforce score presence.
  • Fix CSS specificity for table headers.
  • Deploy the app to Netlify and test with real content.
  • Use temporary sliders to adjust weights without changing published data.

证据

The app calculates: fit = sum(score * criterion weight) / (5 * sum(criterion weight)) * 100

来源

The first real publish revealed a useful failure: the document had options but no scores yet. The API returned null for the score arrays.

来源

We also caught a small CSS specificity issue during visual review. The initial letters in the comparison table's colored option marks were pushed away from the center by a generic table-header rule.

来源

  • 记录日期: 2026-10-04T17:10:47.120Z