Coffee journaling on ATProto (alpha) alpha.arabica.social
coffee
17
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: show method-specific details on bean card, restyle pours on feed card

authored by

Patrick Dewey and committed by tangled.org c66d3b01 a8fcb524

+66 -8
+66 -8
internal/web/components/record_brew.templ
··· 52 52 <span class="text-label">Grind:</span> { brew.GrindSize } 53 53 </div> 54 54 } 55 - if len(brew.Pours) > 0 { 56 - <div class="col-span-2"> 57 - <span class="text-label">Pours:</span> 58 - for _, pour := range brew.Pours { 59 - <div class="pl-2 text-brown-600">• { fmt.Sprintf("%dg @ %s", pour.WaterAmount, bff.FormatTime(pour.TimeSeconds)) }</div> 60 - } 61 - </div> 62 - } else if brew.WaterAmount > 0 { 55 + if brew.WaterAmount > 0 { 63 56 <div> 64 57 <span class="text-label">Water:</span> { fmt.Sprintf("%dg", brew.WaterAmount) } 65 58 </div> ··· 74 67 <span class="text-label">Time:</span> { bff.FormatTime(brew.TimeSeconds) } 75 68 </div> 76 69 } 70 + <!-- Espresso-specific details --> 71 + if brew.EspressoParams != nil { 72 + if brew.EspressoParams.YieldWeight > 0 { 73 + <div> 74 + <span class="text-label">Yield:</span> { fmt.Sprintf("%.1fg", brew.EspressoParams.YieldWeight) } 75 + </div> 76 + } 77 + if brew.EspressoParams.Pressure > 0 { 78 + <div> 79 + <span class="text-label">Pressure:</span> { fmt.Sprintf("%.1f bar", brew.EspressoParams.Pressure) } 80 + </div> 81 + } 82 + if brew.EspressoParams.PreInfusionSeconds > 0 { 83 + <div> 84 + <span class="text-label">Pre-infusion:</span> { fmt.Sprintf("%ds", brew.EspressoParams.PreInfusionSeconds) } 85 + </div> 86 + } 87 + } 88 + <!-- Pourover-specific details --> 89 + if brew.PouroverParams != nil { 90 + if brew.PouroverParams.BloomWater > 0 || brew.PouroverParams.BloomSeconds > 0 { 91 + <div> 92 + <span class="text-label">Bloom:</span> { brewFormatBloom(brew.PouroverParams) } 93 + </div> 94 + } 95 + if brew.PouroverParams.DrawdownSeconds > 0 { 96 + <div> 97 + <span class="text-label">Drawdown:</span> { fmt.Sprintf("%ds", brew.PouroverParams.DrawdownSeconds) } 98 + </div> 99 + } 100 + if brew.PouroverParams.BypassWater > 0 { 101 + <div> 102 + <span class="text-label">Bypass:</span> { fmt.Sprintf("%dg", brew.PouroverParams.BypassWater) } 103 + </div> 104 + } 105 + } 77 106 </div> 107 + <!-- Pours as inline pills --> 108 + if len(brew.Pours) > 0 { 109 + <div class="mt-2 flex flex-wrap items-center gap-1.5"> 110 + <span class="text-xs text-label">Pours:</span> 111 + for i, pour := range brew.Pours { 112 + <span class="inline-flex items-center gap-1.5 bg-brown-50 rounded-md px-2 py-1 border border-brown-200 text-xs"> 113 + <span class="font-medium text-brown-700">{ fmt.Sprintf("%d", i+1) }</span> 114 + <span class="text-brown-900">{ fmt.Sprintf("%dg", pour.WaterAmount) }</span> 115 + if pour.TimeSeconds > 0 { 116 + <span class="text-brown-400">&middot;</span> 117 + <span class="text-brown-500">{ bff.FormatTime(pour.TimeSeconds) }</span> 118 + } 119 + </span> 120 + } 121 + </div> 122 + } 78 123 if brew.TastingNotes != "" { 79 124 <div class="mt-3 text-sm text-brown-800 italic border-t border-brown-200 pt-2"> 80 125 "{ brew.TastingNotes }" ··· 82 127 } 83 128 </div> 84 129 } 130 + 131 + func brewFormatBloom(pp *models.PouroverParams) string { 132 + if pp.BloomWater > 0 && pp.BloomSeconds > 0 { 133 + return fmt.Sprintf("%dg for %ds", pp.BloomWater, pp.BloomSeconds) 134 + } 135 + if pp.BloomWater > 0 { 136 + return fmt.Sprintf("%dg", pp.BloomWater) 137 + } 138 + if pp.BloomSeconds > 0 { 139 + return fmt.Sprintf("%ds", pp.BloomSeconds) 140 + } 141 + return "" 142 + }