Conversation
Deploying modl-panel with
|
| Latest commit: |
654042b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f5392655.staging-panel.pages.dev |
| Branch Preview URL: | https://dev.staging-panel.pages.dev |
| <SelectValue /> | ||
| </SelectTrigger> | ||
| <SelectContent> | ||
| <SelectItem value={PRETTY_DATE_FORMAT}>{formatPrettyDateTime(new Date(2026, 0, 15, 12, 0))}</SelectItem> |
There was a problem hiding this comment.
Pretty date format is rejected
When a user selects the new pretty-date option, profile autosave submits MMM D, YYYY, but the backend allowlist accepts only the three legacy formats, so the displayed selection is not persisted and reverts after the profile is refreshed.
Context Used: Ensure all code meets SOLID, DRY, and KISS softwar... (source)
Artifacts
Repro: executable focused client-to-backend persistence contract harness
- Evidence file captured while the check ran.
Repro: before-change legacy selection PATCH and profile reload responses
- The full command output behind this check.
Repro: after-change pretty selection PATCH and reverted profile reload responses
- The full command output behind this check.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: client/src/components/settings/AccountSettings.tsx
Line: 422
Comment:
**Pretty date format is rejected**
When a user selects the new pretty-date option, profile autosave submits `MMM D, YYYY`, but the backend allowlist accepts only the three legacy formats, so the displayed selection is not persisted and reverts after the profile is refreshed.
**Context Used:** Ensure all code meets SOLID, DRY, and KISS softwar... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const validateDomain = (domain: string): boolean => { | ||
| const domainRegex = /^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9](?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])*$/; | ||
| return domainRegex.test(domain) && domain.length <= 253; | ||
| const normalized = domain.trim(); | ||
| if (normalized.length === 0 || normalized.length > 253) { | ||
| return false; | ||
| } | ||
| if (!normalized.includes('.')) { | ||
| return false; | ||
| } | ||
| return !/\s/.test(normalized); | ||
| }; |
There was a problem hiding this comment.
Domain validation accepts malformed hosts
The new validation accepts any dotted, whitespace-free string, including invalid hostnames such as a..b, a_.example.com, and -panel.example.com, so these values produce unnecessary configuration requests and defer basic validation to the API or DNS provider.
Rule Used: This is a React frontend project on React 19 with ... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: client/src/components/settings/DomainSettings.tsx
Line: 84-93
Comment:
**Domain validation accepts malformed hosts**
The new validation accepts any dotted, whitespace-free string, including invalid hostnames such as `a..b`, `a_.example.com`, and `-panel.example.com`, so these values produce unnecessary configuration requests and defer basic validation to the API or DNS provider.
**Rule Used:** This is a React frontend project on React 19 with ... ([source](https://app.greptile.com/modl-gg/-/custom-context?memory=b7532101-0c9e-4ab6-b168-353a105ba593))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Confidence Score: 3/5
The PR should not merge until the new date-format value is accepted end-to-end, because users currently cannot persist the newly offered preference.
The panel submits
MMM D, YYYYas a profile preference while the backend storage path only accepts three legacy values; custom-domain validation also now permits clearly malformed hostnames and sends avoidable API requests.Files Needing Attention: client/src/components/settings/AccountSettings.tsx, client/src/pages/settings.tsx, client/src/utils/date-utils.ts, client/src/components/settings/DomainSettings.tsx
What T-Rex did
Important Files Changed
Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "Merge branch 'main' into dev" | Re-trigger Greptile