Skip to content

Commit f3e225d

Browse files
committed
Keep the feedback draft resettable and let the seam audit run without a config
A controlled textarea survives a native form reset, which the feedback dialog's contract and its browser spec rely on; read the value from the submitted form.
1 parent a8da574 commit f3e225d

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

‎apps/sim/platform/app/(shell)/_components/chat/message/response-actions.tsx‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export function ResponseActions({ turn }: ResponseActionsProps) {
2727
const { rate, fork } = useChatHandlers()
2828
const [feedback, setFeedback] = useState<Rating | null>(null)
2929
const [rating, setRating] = useState<Rating | null>(null)
30-
const [details, setDetails] = useState('')
3130
return (
3231
<>
3332
<div className={styles.responseActions} data-type='T060'>
@@ -56,16 +55,13 @@ export function ResponseActions({ turn }: ResponseActionsProps) {
5655
variant='feedback'
5756
open={feedback !== null}
5857
onOpenChange={(open) => {
59-
if (!open) {
60-
setFeedback(null)
61-
setDetails('')
62-
}
58+
if (!open) setFeedback(null)
6359
}}
6460
title='Share feedback'
6561
description='What could Sim have done better?'
6662
confirmLabel='Send feedback'
67-
onConfirm={async () => {
68-
const written = details.trim()
63+
onConfirm={async (values) => {
64+
const written = String(values.get('details') ?? '').trim()
6965
// An empty details field sends nothing, as the rating alone means little to read.
7066
if (rate && written && turn.userQuery && feedback) {
7167
await rate({
@@ -77,7 +73,6 @@ export function ResponseActions({ turn }: ResponseActionsProps) {
7773
}
7874
setRating(feedback)
7975
setFeedback(null)
80-
setDetails('')
8176
}}
8277
>
8378
{feedback && (
@@ -100,8 +95,7 @@ export function ResponseActions({ turn }: ResponseActionsProps) {
10095
label='Details'
10196
placeholder='Tell us what was missing or how the response could improve.'
10297
density='expanded'
103-
value={details}
104-
onChange={setDetails}
98+
name='details'
10599
/>
106100
</FieldFrame>
107101
{turn.requestId && <CopyField label='Request ID' value={turn.requestId} />}

‎scripts/check-platform-design.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,10 +777,13 @@ function resolveSource(file: string, specifier: string): string | null {
777777
* modules at build time, so the walk stops at them the same way.
778778
*/
779779
function checkSeamClosure() {
780+
const config = 'platform/next.config.ts'
780781
const replaced = new Set(
781-
[...read('platform/next.config.ts').matchAll(/\['(@\/[^']+)', 'lib\/data\/shims\//g)].map(
782-
([, request]) => request
783-
)
782+
existsSync(path.join(app, config))
783+
? [...read(config).matchAll(/\['(@\/[^']+)', 'lib\/data\/shims\//g)].map(
784+
([, request]) => request
785+
)
786+
: []
784787
)
785788
const visited = new Set<string>()
786789
const queue: string[] = []

0 commit comments

Comments
 (0)