Skip to content

fix: render team preferences in console#2987

Merged
HarshMN2345 merged 2 commits intomainfrom
fix-team-preferences-console
Apr 21, 2026
Merged

fix: render team preferences in console#2987
HarshMN2345 merged 2 commits intomainfrom
fix-team-preferences-console

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

@HarshMN2345 HarshMN2345 commented Apr 21, 2026

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

image

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@HarshMN2345 HarshMN2345 requested a review from Meldiron April 21, 2026 08:13
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR fixes rendering of team and user preferences in the console by properly serializing complex values (objects, arrays, numbers, booleans) via stringifyPrefValue, and restoring original types on save via parsePrefValue. The onMount initialization is replaced with a reactive block so the UI stays in sync when the underlying store updates externally.

Confidence Score: 5/5

Safe to merge; the one remaining finding is a minor UX edge case that doesn't affect the primary path.

All changes are well-scoped and the core fix works correctly. The only open finding is a P2 UX quirk where invalid JSON edits are silently discarded — it doesn't corrupt data and doesn't block the PR.

src/lib/helpers/prefs.ts — specifically the parsePrefValue JSON-parse error fallback at line 74.

Important Files Changed

Filename Overview
src/lib/helpers/prefs.ts Adds stringifyPrefValue, createPrefRows, and parsePrefValue helpers; parsePrefValue's JSON-parse error fallback silently discards user edits when original is a complex type.
src/routes/(console)/project-[region]-[project]/auth/teams/team-[team]/updatePrefs.svelte Replaces onMount initialization with a reactive block that re-syncs prefs from the store when unchanged; correctly tracks unsaved changes and restores original types on save.
src/routes/(console)/project-[region]-[project]/auth/user-[user]/updatePrefs.svelte Mirrors team updatePrefs.svelte changes — same reactive initialization pattern and parsePrefValue integration; no additional concerns.

Reviews (2): Last reviewed commit: "address one comment" | Re-trigger Greptile

Comment thread src/lib/helpers/prefs.ts
@HarshMN2345 HarshMN2345 merged commit 3fcf1d8 into main Apr 21, 2026
3 of 4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-team-preferences-console branch April 21, 2026 09:30
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.

2 participants