Skip to content

Commit 05b902e

Browse files
committed
fix: lower feedback minimum content length to 1 character
1 parent 41b3d94 commit 05b902e

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ scripts/
9393
- Detectors record deposit signature (devnet_tx/mainnet_tx) even on failure, enabling auto-refund
9494
- Low balance alerts log errors when treasury SOL < 10 or payout USDC < 10
9595
- Structured logging via pino (set `LOG_LEVEL` env var to control verbosity)
96-
- Feedback system: 3 posts/hour per IP, 10 votes/hour per IP, IP-hash dedup (SHA-256 truncated to 16 hex), content 10-500 chars
96+
- Feedback system: 3 posts/hour per IP, 10 votes/hour per IP, IP-hash dedup (SHA-256 truncated to 16 hex), content 1-500 chars
9797
- Frontend feedback shows optional wallet identity via `useWallet()` hook
9898

9999
## Environment Variables

frontend/src/components/FeedbackSection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export function FeedbackSection() {
1616

1717
async function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
1818
e.preventDefault();
19-
if (content.trim().length < 10) {
20-
setError('Feedback must be at least 10 characters');
19+
if (content.trim().length < 1) {
20+
setError('Feedback cannot be empty');
2121
return;
2222
}
2323
setSubmitting(true);
@@ -73,7 +73,7 @@ export function FeedbackSection() {
7373
/>
7474
<button
7575
type="submit"
76-
disabled={submitting || content.trim().length < 10}
76+
disabled={submitting || content.trim().length < 1}
7777
className="px-4 py-2 bg-primary text-white text-sm font-medium rounded-sm hover:opacity-90 disabled:opacity-40 transition-opacity self-end"
7878
>
7979
{submitting ? '...' : 'Post'}

src/routes/feedback.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ describe('Feedback routes', () => {
4848
const res = await app.request('/feedback', {
4949
method: 'POST',
5050
headers: { 'Content-Type': 'application/json' },
51-
body: JSON.stringify({ content: 'short' }),
51+
body: JSON.stringify({ content: '' }),
5252
});
5353
expect(res.status).toBe(400);
5454
const body = await res.json();
55-
expect(body.error).toMatch(/10-500 characters/);
55+
expect(body.error).toMatch(/1-500 characters/);
5656
});
5757

5858
it('POST /feedback validates content length (too long)', async () => {

src/routes/feedback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createLogger } from '../logger.js';
55

66
const log = createLogger('feedback');
77

8-
const MIN_CONTENT = 10;
8+
const MIN_CONTENT = 1;
99
const MAX_CONTENT = 500;
1010
const MAX_POSTS_PER_HOUR = 3;
1111
const MAX_VOTES_PER_HOUR = 10;

0 commit comments

Comments
 (0)