Skip to content

Convert getDescriptionsForTemperature to createMemo for reactive updates#367

Merged
jalezi merged 2 commits intocodex/ali-je-vroce-opisi-pod-30from
copilot/sub-pr-366
Feb 21, 2026
Merged

Convert getDescriptionsForTemperature to createMemo for reactive updates#367
jalezi merged 2 commits intocodex/ali-je-vroce-opisi-pod-30from
copilot/sub-pr-366

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 21, 2026

getDescriptionsForTemperature was a plain function called once at render time, meaning SolidJS never tracked tempAvg() as a dependency — description sets wouldn't update when the signal changed.

Changes

  • vroce.tsx: Wrap getDescriptionsForTemperature in createMemo so SolidJS tracks tempAvg() and recomputes the correct description set reactively
// Before: called once, no reactive tracking
const getDescriptionsForTemperature = () => {
  const avg = tempAvg();
  if (avg != null && Number.isFinite(+avg) && +avg < 30) return opisi_pod_30;
  return opisi;
};

// After: recomputes whenever tempAvg() changes
const getDescriptionsForTemperature = createMemo(() => {
  const avg = tempAvg();
  if (avg != null && Number.isFinite(+avg) && +avg < 30) return opisi_pod_30;
  return opisi;
});

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…o for reactive tracking

Co-authored-by: jalezi <44704999+jalezi@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on contextual percentile descriptions Convert getDescriptionsForTemperature to createMemo for reactive updates Feb 21, 2026
Copilot AI requested a review from jalezi February 21, 2026 14:01
@jalezi jalezi marked this pull request as ready for review February 21, 2026 14:02
Copilot AI review requested due to automatic review settings February 21, 2026 14:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a reactivity bug in the temperature description display by converting a plain function to use SolidJS's createMemo. Previously, getDescriptionsForTemperature was called once at component render time, preventing it from tracking changes to the tempAvg() signal. Now it properly recomputes when the temperature changes.

Changes:

  • Wrapped getDescriptionsForTemperature in createMemo to enable reactive tracking of tempAvg()
  • Added createMemo import from "solid-js"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@jalezi jalezi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good 😄

@jalezi jalezi merged commit ebc894c into codex/ali-je-vroce-opisi-pod-30 Feb 21, 2026
5 checks passed
@jalezi jalezi deleted the copilot/sub-pr-366 branch February 21, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants