Skip to content

ui: hide forgot password link until backend support is ready(#235)#251

Merged
johanbriger merged 1 commit into
mainfrom
235-ta-bort-glomt-lösenord-lank-funktionen-ej-implementerad-labels-bug-frontend
Apr 23, 2026

Hidden character warning

The head ref may contain hidden characters: "235-ta-bort-glomt-l\u00f6senord-lank-funktionen-ej-implementerad-labels-bug-frontend"
Merged

ui: hide forgot password link until backend support is ready(#235)#251
johanbriger merged 1 commit into
mainfrom
235-ta-bort-glomt-lösenord-lank-funktionen-ej-implementerad-labels-bug-frontend

Conversation

@johanbriger

@johanbriger johanbriger commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

The feature is currently not functional in the backend.
Keeping the code structure but hiding the entry point from users.

closes #235

Summary by CodeRabbit

  • Chores
    • Updated internal code documentation and developer notes to reflect future implementation plans. No changes to user-facing functionality.

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This change clarifies the status of an unimplemented "Forgot password" feature in the login form by updating developer documentation. The button remains hidden in a block comment with an updated note ("KNAPP DOLD TILLS VIDARE") indicating future implementation, with no functional behavior changes.

Changes

Cohort / File(s) Summary
Login Form Button Comment Update
frontend/src/pages/Login.jsx
Updated developer comment above the "Glömt lösenord?" (Forgot password) button from previous wording to "KNAPP DOLD TILLS VIDARE" (button hidden for now). Button remains disabled/commented out; no functional changes to component behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A button sleeps beneath the code,
With note so clear: "Not yet bestowed!"
The comment whispers soft and true,
"Soon you'll wake—we'll bring you through!"
For now, dear password, rest with care,
Your day will come, we'll fix it there. 🔐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: hiding the forgot password link pending backend support, and references the related issue #235.
Linked Issues check ✅ Passed The code changes directly address issue #235 by hiding the 'Glömt lösenord' button in the login form until the backend functionality is implemented.
Out of Scope Changes check ✅ Passed The changes are limited to updating comments and hiding the forgot password button in Login.jsx, staying entirely within scope of issue #235.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 235-ta-bort-glomt-lösenord-lank-funktionen-ej-implementerad-labels-bug-frontend

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/src/pages/Login.jsx (1)

11-14: Consider removing the unused function or using a feature flag.

The handleForgotPassword function is defined but never called since the button is commented out. Dead code increases maintenance burden and can cause confusion.

Options:

  1. Remove the function entirely — Git history preserves it for when you implement the feature.
  2. Use a feature flag — Control visibility with an environment variable or config flag instead of comments.
♻️ Option 1: Remove the function
-    // Behålls för framtida tillägg
-    const handleForgotPassword = () => {
-        alert("Funktionen för lösenordsåterställning kommer snart. Kontakta din administratör så länge.");
-    };
-
♻️ Option 2: Feature flag approach

If you prefer to keep the structure ready:

+    const ENABLE_FORGOT_PASSWORD = false; // Set to true when backend is ready
+
-    // Behålls för framtida tillägg
     const handleForgotPassword = () => {
         alert("Funktionen för lösenordsåterställning kommer snart. Kontakta din administratör så länge.");
     };

Then in the JSX (lines 119-127):

-                            {/* KNAPP DOLD TILLS VIDARE:
-                            <button
+                            {ENABLE_FORGOT_PASSWORD && (
+                                <button
                                 type="button"
                                 onClick={handleForgotPassword}
                                 className="text-xs font-bold text-[`#0ea5e9`] hover:underline bg-transparent border-none p-0 cursor-pointer"
                             >
                                 Glömt lösenord?
                             </button>
-                            */}
+                            )}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/pages/Login.jsx` around lines 11 - 14, The handleForgotPassword
function is dead code (defined but never used because the forgot-password button
is commented out); either delete the handleForgotPassword declaration to remove
unused code, or guard its presence and the button render behind a feature flag
(e.g., CHECK_FORGOT_PASSWORD_FEATURE env/config) so the function and JSX only
exist when the flag is true—update places referencing handleForgotPassword in
the Login component accordingly and remove the commented-out button if you
choose deletion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/src/pages/Login.jsx`:
- Around line 11-14: The handleForgotPassword function is dead code (defined but
never used because the forgot-password button is commented out); either delete
the handleForgotPassword declaration to remove unused code, or guard its
presence and the button render behind a feature flag (e.g.,
CHECK_FORGOT_PASSWORD_FEATURE env/config) so the function and JSX only exist
when the flag is true—update places referencing handleForgotPassword in the
Login component accordingly and remove the commented-out button if you choose
deletion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d7ab7e11-1b89-4d6e-a06f-34a65a62d0cd

📥 Commits

Reviewing files that changed from the base of the PR and between 0f8a5cf and e3ad148.

📒 Files selected for processing (1)
  • frontend/src/pages/Login.jsx

@johanbriger
johanbriger merged commit 447901e into main Apr 23, 2026
2 checks passed
@johanbriger
johanbriger deleted the 235-ta-bort-glomt-lösenord-lank-funktionen-ej-implementerad-labels-bug-frontend branch April 23, 2026 08:52
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.

Ta bort "Glömt lösenord"-länk — funktionen ej implementerad Labels: bug frontend

1 participant