a a vibe-coded abomination experiment of a fragrance review platform built on the atmosphere. drydown.social

Phase 4: Settings#

Status: 🔴 Planned

Features: F2 (Customizable Rating Weights)

Components#

WeightCustomizer.tsx#

<div>
  {Object.entries(weights).map(([criterion, weight]) => (
    <div key={criterion}>
      <label>{criterion}</label>
      <input
        type="range"
        min="0"
        max="10"
        step="0.1"
        value={weight}
        onChange={(e) => updateWeight(criterion, parseFloat(e.target.value))}
      />
      <span>{weight.toFixed(1)}</span>
    </div>
  ))}
</div>

Recalculation on Weight Change#

When user saves settings:

  1. Store settings to AT Protocol
  2. Fetch all completed reviews
  3. Recalculate each review's calculatedRating
  4. Update review records with new ratings
  5. Re-sort completed reviews list
  6. Update UI
async function recalculateAllReviews(newWeights: RatingWeights) {
  for (const review of completedReviews) {
    const newRating = calculateFinalRating(review, newWeights)
    review.calculatedRating = newRating

    await agent.com.atproto.repo.putRecord({
      repo: agent.session.did,
      collection: 'social.drydown.review',
      rkey: extractRkeyFromUri(review.uri),
      record: { ...review, calculatedRating: newRating }
    })
  }
}

Implementation complete!