Skip to content

Input image bug#1702

Merged
simo6529 merged 4 commits intomainfrom
input-image-bug
Jan 6, 2026
Merged

Input image bug#1702
simo6529 merged 4 commits intomainfrom
input-image-bug

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Jan 6, 2026

Summary by CodeRabbit

  • Bug Fixes

    • File input now reliably resets after selection so the same file can be re-selected.
    • Error message now reflects the configured maximum upload limit when too many files are added.
  • Style

    • Updated layout, spacing, button and icon styling for more consistent sizing and visual alignment.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

Two UI components had Tailwind class/token reordering and styling tweaks; both now clear the file input value after handling selections or errors. Component public signatures are unchanged.

Changes

Cohort / File(s) Summary
CreateDropActions UI & input reset
components/waves/CreateDropActions.tsx
Reordered and consolidated Tailwind utility classes across wrappers, buttons, tooltips, and icons; replaced explicit SVG size classes with compact tokens (e.g., tw-size-4, tw-size-5); added e.target.value = "" to clear file input after handling selection; minor JSX formatting adjustments.
CreateDropActionsRow styling & input semantics
components/drops/create/utils/CreateDropActionsRow.tsx
Reorganized wrapper/flex class ordering; swapped fixed-size/spacing tokens for new size tokens; removed explicit TypeScript annotation on onChange event, ensured input reset (e.target.value = "") on all code paths; adjusted action button/icon class composition and error message to use MAX_DROP_UPLOAD_FILES.

Sequence Diagram(s)

(omitted — changes are styling and small UI input semantics without multi-component control-flow requiring visualization)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • App ui/ux fixes #1582: Modifies the same CreateDropActions component with file-input reset and class/icon token adjustments.

Suggested reviewers

  • prxt6529

Poem

🐰 I hopped through classes, neat and spry,

Cleared the inputs so files can fly,
Tiny tokens, icons dressed fine,
A twitch, a hop — the UI's in line,
Thump-thump, I celebrate with a carrot rind. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Input image bug' is vague and does not clearly convey the specific changes made. While the PR does modify input handling in image upload components, the title lacks descriptive detail about what bug is being fixed or what the actual changes accomplish. Consider revising the title to be more specific, such as 'Fix file input reset in drop upload components' or 'Allow re-selection of same file in drop actions', which better describes the primary functional fix being implemented.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8081df2 and d7da46e.

📒 Files selected for processing (1)
  • components/drops/create/utils/CreateDropActionsRow.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/drops/create/utils/CreateDropActionsRow.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @components/drops/create/utils/CreateDropActionsRow.tsx:
- Around line 52-55: The toast message in CreateDropActionsRow uses a hardcoded
"up to 4 files" text that is inconsistent with the actual MAX_DROP_UPLOAD_FILES
value; update the message to reference MAX_DROP_UPLOAD_FILES (e.g., interpolate
or format the constant into the string) so the error text accurately reflects
the configured limit where setToast is called.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89ccf66 and 8081df2.

📒 Files selected for processing (2)
  • components/drops/create/utils/CreateDropActionsRow.tsx
  • components/waves/CreateDropActions.tsx
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx,js,jsx}: Do not include any comments in the code; it should be self-explanatory
Write correct, up-to-date, bug-free, fully componentized, secure, and efficient code
Include all required imports and ensure proper naming of key components
Use NextJS features that match the current version

**/*.{ts,tsx,js,jsx}: Remove unnecessary Effects. If the Effect's only job is to derive or sync internal state, calculate during render or use useMemo instead.
Use useEffectEvent for non-reactive logic inside Effects to read the latest props/state without turning them into dependencies or causing unnecessary re-runs.
Use explicit caching with "use cache" directive at the top of Server Components, routes, or functions. Configure cacheComponents: true in next.config.ts as needed.

**/*.{ts,tsx,js,jsx}: Remove unnecessary Effects; if the Effect only derives state, compute during render instead
Use useEffectEvent when listening to external events but needing the latest props/state without re-running the Effect
Move data fetching from client Effects to Server Components; mutations go through Server Actions ('use server')

Files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{tsx,jsx}: Use FontAwesome for icons in React components
Use TailwindCSS for styling in React components
Use react-query for data fetching
Always add readonly before props in React components

**/*.{tsx,jsx}: Use internal links via <Link> component from Next.js instead of <a> tags
Replace <img> elements with <Image /> from next/image

Files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
**/*.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Run npm run lint to ensure code satisfies ESLint (Next's Core Web Vitals + React Hooks). Code must pass linting before completing any task.

**/*.{js,ts,jsx,tsx}: Code must satisfy ESLint with Next's Core Web Vitals and React Hooks rules by running npm run lint
Do not add eslint-disable comments unless explicitly instructed; prefer refactors aligned with React 19.2, React Compiler, and Next.js 16 conventions

Files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

**/*.{jsx,tsx}: Replace <img> elements with <Image /> from next/image to comply with Next.js ESLint rule @next/next/no-img-element.
Use <Link href="/path"> from Next.js for internal navigation instead of raw <a> tags to comply with @next/next/no-html-link-for-pages.

Files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (GEMINI.md)

Use TypeScript with React functional components and hooks. Follow existing code style and naming conventions.

Files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
**/*.{tsx,ts}

📄 CodeRabbit inference engine (AGENTS.md)

Use TypeScript with React functional components and hooks

Files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
**/*.{tsx,ts,jsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

Prefer direct named imports from React (useMemo, useRef, FC) over React. namespace usage

Files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{tsx,jsx} : Use TailwindCSS for styling in React components
📚 Learning: 2025-11-25T08:35:58.729Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.729Z
Learning: Applies to **/*.{tsx,jsx} : Use FontAwesome for icons in React components

Applied to files:

  • components/waves/CreateDropActions.tsx
  • components/drops/create/utils/CreateDropActionsRow.tsx
📚 Learning: 2025-12-30T14:31:53.006Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: GEMINI.md:0-0
Timestamp: 2025-12-30T14:31:53.006Z
Learning: Fix issues with modernization aligned to React 19.2, React Compiler, and Next.js 16 conventions. Do not add `// eslint-disable` comments unless explicitly instructed.

Applied to files:

  • components/drops/create/utils/CreateDropActionsRow.tsx
🧬 Code graph analysis (1)
components/drops/create/utils/CreateDropActionsRow.tsx (2)
scripts/eslint-rule-summary.cjs (1)
  • files (22-22)
helpers/Helpers.ts (1)
  • MAX_DROP_UPLOAD_FILES (29-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
components/waves/CreateDropActions.tsx (2)

48-54: Input reset fixes re-selection bug.

Resetting e.target.value after processing allows users to select the same file again, which browsers otherwise block. This correctly addresses the input bug mentioned in the PR title.


83-264: Styling updates use modern Tailwind tokens supported by the project.

The className adjustments and SVG sizing token updates (e.g., tw-size-4, tw-size-5) are fully compatible with the repository's Tailwind CSS v3.4.4. These utilities were introduced in Tailwind v3.4 and apply the styling correctly.

components/drops/create/utils/CreateDropActionsRow.tsx (1)

48-62: Input reset logic correctly handles both success and error cases.

Resetting the file input on both the error path (line 56) and after processing (line 61) ensures users can re-select files in all scenarios. This matches the fix in CreateDropActions.tsx and resolves the input bug.

Comment thread components/drops/create/utils/CreateDropActionsRow.tsx
Signed-off-by: Simo <simo@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jan 6, 2026

@simo6529 simo6529 merged commit 6eca140 into main Jan 6, 2026
8 checks passed
@simo6529 simo6529 deleted the input-image-bug branch January 6, 2026 13:22
@coderabbitai coderabbitai Bot mentioned this pull request Feb 3, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Mar 17, 2026
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