Skip to content

Soley UI improvements#64

Merged
LinusWestling merged 3 commits into
mainfrom
issue/59
Apr 21, 2026
Merged

Soley UI improvements#64
LinusWestling merged 3 commits into
mainfrom
issue/59

Conversation

@LinusWestling

@LinusWestling LinusWestling commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

Closes #56
Closes #59

Summary by CodeRabbit

Release Notes

  • New Features

    • Case status updates now visible to patients in case list (new Status column) and case detail view with notification panel
  • UI/UX Improvements

    • Redesigned login and registration pages with improved layout and messaging
    • Enhanced global styling with new color variables, typography refinements, and smooth transitions
    • Updated home page descriptions and footer content

@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@LinusWestling has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 14 minutes and 52 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 14 minutes and 52 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2963337a-33f1-4549-bb5f-31ac833ffe8d

📥 Commits

Reviewing files that changed from the base of the PR and between e5145b4 and 8f988bb.

📒 Files selected for processing (1)
  • src/main/resources/templates/login/register.html
📝 Walkthrough

Walkthrough

This PR implements UI improvements and adds patient case status notifications. Changes include: a new "Case updated" notice in case details, status column in case list with conditional rendering, updated login/register layouts with semantic HTML structure, comprehensive CSS styling enhancements with new variables and responsive design, navigation structure adjustment, and descriptive text updates across multiple templates.

Changes

Cohort / File(s) Summary
Java Controller
src/main/java/org/example/projektarendehantering/presentation/rest/PatientController.java
Added a single comment line above the @RestController annotation with no method or logic changes.
Case Management UI
src/main/resources/templates/cases/detail.html, src/main/resources/templates/cases/list.html
Added a conditional "Case updated" notice panel in detail view and a "Status" column in list view, both rendering only when currentActor is a PATIENT and case status is not CREATED.
Authentication Pages
src/main/resources/templates/login/login.html, src/main/resources/templates/login/register.html
Replaced Bootstrap-based layouts with semantic HTML structure using main, section.panel, and .auth-grid; updated messaging, kickers, and conditional success/logout panels while preserving form logic.
Core Styling
src/main/resources/templates/fragments/head.html
Introduced new CSS variables (--accent-strong, --success, --radius, --transition-fast) and extensively updated typography, layout, spacing, card styling, form controls, responsive breakpoints, and added new utility classes (.notice-badge, .auth-* classes).
Navigation Structure
src/main/resources/templates/fragments/header.html
Relocated closing </nav> tag to properly wrap the "Manage Users" link within the navigation container.
Content Updates
src/main/resources/templates/fragments/footer.html, src/main/resources/templates/index.html
Updated footer text to Swedish/English descriptions and rewrote home page intro and case card descriptions from technical API references to user-focused case management language.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • mattknatt

Poem

🐰 A patient case now wears a badge so bright,
Status updates sparkle in the patient's sight,
New layouts dance with semantic grace,
CSS variables style every place,
The form looks sharp—what a delight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Soley UI improvements' is vague and generic, using non-descriptive language that doesn't convey the specific nature of the changes. Consider a more specific title such as 'Add case update notifications and improve UI styling' or 'Enhance patient notifications and refactor login/dashboard layouts'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses both linked issues: #56 (login page and UI improvements via styling/layout changes) and #59 (patient notification for case updates via detail.html and list.html panels).
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issues. The footer.html text update and PatientController.java comment are minor in-scope refinements.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue/59

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.

Actionable comments posted: 5

🧹 Nitpick comments (1)
src/main/resources/templates/login/login.html (1)

31-40: Use email and password-manager semantics for patient login.

The username field is labeled as Email but uses type="text". Use type="email" and add autocomplete hints for a smoother login flow.

💡 Proposed form-field refinement
-                    <input type="text" id="username" name="username" class="input" required autofocus>
+                    <input type="email" id="username" name="username" class="input" autocomplete="username" required autofocus>
...
-                    <input type="password" id="password" name="password" class="input" required>
+                    <input type="password" id="password" name="password" class="input" autocomplete="current-password" required>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/templates/login/login.html` around lines 31 - 40, Update
the login form inputs to use proper email and password-manager semantics: change
the username input (id="username", name="username") from type="text" to
type="email" and add autocomplete="email"; keep the password input
(id="password", name="password") as type="password" and add
autocomplete="current-password" so browsers and password managers can autofill
correctly; ensure the form's th:action and submit behavior remain unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/org/example/projektarendehantering/presentation/rest/PatientController.java`:
- Line 17: Remove the unprofessional inline comment found in the
PatientController class header (the remark about "Adding more wierd stuff...
rabbit rate limits"); open the PatientController class (symbol:
PatientController) and delete that comment, then optionally replace it with a
short, relevant Javadoc or remove entirely so only meaningful documentation
remains and ensure no other stray meta-comments exist in the class.

In `@src/main/resources/templates/cases/detail.html`:
- Around line 17-20: The template currently prints raw enum values via
case.status which shows internal codes; update the rendering to use
patient-facing labels by mapping the enum to display strings before the template
renders. Add a presenter/DTO field or model attribute (e.g.
CaseView.getStatusLabel() or model attribute "statusLabel") that converts
case.status enum values (COMMUNICATION, ASSIGNED, UPDATED, CLOSED, etc.) to
human-friendly labels ("Communication", "Assigned", "Updated", "Closed"), and
then change the template to use that label (replace th:text="${case.status}"
with th:text="${caseView.statusLabel}" or the model attribute name you add).
Alternatively, populate a localized message key for the enum in the controller
and reference that key in the template instead of case.status.

In `@src/main/resources/templates/cases/list.html`:
- Around line 29-40: The patient-facing badge currently prints the raw enum name
via "Updated: " + ${c.status}; locate the two spans that reference currentActor
and c.status in the template (the patient badge span and its fallback) and
change them to use the same display-label mapping used by the case detail notice
instead of rendering the enum's raw name (i.e., replace ${c.status} / "Updated:
" + ${c.status} with the display-label accessor or helper used elsewhere for
case status so patients see the human-friendly label).

In `@src/main/resources/templates/fragments/head.html`:
- Around line 266-271: The footer's two text spans crowd on small screens
because .footer-row prevents wrapping; inside the existing mobile media query
add rules for .footer-row to stack the items vertically (e.g., set
flex-direction: column and adjust spacing/alignment or use flex-wrap with gap),
so the footer content stacks and gains breathing room on narrow screens; update
the CSS selector .footer-row within the `@media` (max-width: 700px) block and
adjust properties like flex-direction, gap (or margin-bottom), and align-items
to ensure proper mobile layout.

In `@src/main/resources/templates/login/register.html`:
- Around line 7-10: The page’s primary heading is incorrectly an <h4> inside the
semantic <main> (the element with class "container page"), so replace the
<h4>Create a Patient Account</h4> with an <h1> to restore proper document
semantics and screen-reader navigation; keep or adjust the existing CSS
classes/styles (on the main or heading) to preserve visual appearance and ensure
there is only one <h1> on the page.

---

Nitpick comments:
In `@src/main/resources/templates/login/login.html`:
- Around line 31-40: Update the login form inputs to use proper email and
password-manager semantics: change the username input (id="username",
name="username") from type="text" to type="email" and add autocomplete="email";
keep the password input (id="password", name="password") as type="password" and
add autocomplete="current-password" so browsers and password managers can
autofill correctly; ensure the form's th:action and submit behavior remain
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fb290b43-4988-4ec5-9b2c-65af47ae0a90

📥 Commits

Reviewing files that changed from the base of the PR and between db08130 and e5145b4.

📒 Files selected for processing (9)
  • src/main/java/org/example/projektarendehantering/presentation/rest/PatientController.java
  • src/main/resources/templates/cases/detail.html
  • src/main/resources/templates/cases/list.html
  • src/main/resources/templates/fragments/footer.html
  • src/main/resources/templates/fragments/head.html
  • src/main/resources/templates/fragments/header.html
  • src/main/resources/templates/index.html
  • src/main/resources/templates/login/login.html
  • src/main/resources/templates/login/register.html

import java.util.List;
import java.util.UUID;

// Adding more wierd stuff in the code base to commit things again cuz the rabbit rate limits suck :)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Remove this inappropriate comment.

This comment is unprofessional and serves no functional or documentation purpose. It explicitly states it's adding "weird stuff" to work around rate limits, which is not an acceptable development practice. Comments in production code should document functionality, explain complex logic, or provide necessary context—not contain meta-commentary about the review process.

Additionally, this backend REST controller has no relation to the PR's stated objectives of UI improvements and patient notifications.

🧹 Proposed fix
-// Adding more wierd stuff in the code base to commit things again cuz the rabbit rate limits suck :)
 `@RestController`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Adding more wierd stuff in the code base to commit things again cuz the rabbit rate limits suck :)
`@RestController`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/org/example/projektarendehantering/presentation/rest/PatientController.java`
at line 17, Remove the unprofessional inline comment found in the
PatientController class header (the remark about "Adding more wierd stuff...
rabbit rate limits"); open the PatientController class (symbol:
PatientController) and delete that comment, then optionally replace it with a
short, relevant Javadoc or remove entirely so only meaningful documentation
remains and ensure no other stray meta-comments exist in the class.

Comment on lines +17 to +20
<strong>Case updated</strong>
<p style="margin-top: 8px; margin-bottom: 0;">
There has been a new update to this case.
Current status: <span th:text="${case.status}">UPDATED</span>.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use patient-facing labels for status text.

case.status renders raw enum values like COMMUNICATION, which reads like an internal code in this new patient notice. Please map statuses to display labels before rendering the notification, e.g. “Communication”, “Assigned”, “Updated”, “Closed”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/templates/cases/detail.html` around lines 17 - 20, The
template currently prints raw enum values via case.status which shows internal
codes; update the rendering to use patient-facing labels by mapping the enum to
display strings before the template renders. Add a presenter/DTO field or model
attribute (e.g. CaseView.getStatusLabel() or model attribute "statusLabel") that
converts case.status enum values (COMMUNICATION, ASSIGNED, UPDATED, CLOSED,
etc.) to human-friendly labels ("Communication", "Assigned", "Updated",
"Closed"), and then change the template to use that label (replace
th:text="${case.status}" with th:text="${caseView.statusLabel}" or the model
attribute name you add). Alternatively, populate a localized message key for the
enum in the controller and reference that key in the template instead of
case.status.

Comment on lines +29 to +40
<td>
<span
th:if="${currentActor != null && currentActor.role() != null && currentActor.role().toString() == 'PATIENT' && c.status != null && c.status.toString() != 'CREATED'}"
class="notice-badge"
th:text="'Updated: ' + ${c.status}">
Updated
</span>
<span
th:unless="${currentActor != null && currentActor.role() != null && currentActor.role().toString() == 'PATIENT' && c.status != null && c.status.toString() != 'CREATED'}"
th:text="${c.status}">
CREATED
</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid raw enum text in the patient badge.

Updated: ${c.status} will display values like Updated: COMMUNICATION. Since this is patient-facing UI, use the same display-label mapping as the detail notice instead of rendering enum names directly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/templates/cases/list.html` around lines 29 - 40, The
patient-facing badge currently prints the raw enum name via "Updated: " +
${c.status}; locate the two spans that reference currentActor and c.status in
the template (the patient badge span and its fallback) and change them to use
the same display-label mapping used by the case detail notice instead of
rendering the enum's raw name (i.e., replace ${c.status} / "Updated: " +
${c.status} with the display-label accessor or helper used elsewhere for case
status so patients see the human-friendly label).

Comment on lines +266 to +271
@media (max-width: 700px) {
.container { width: min(1140px, calc(100% - 24px)); }
.page { padding-top: 24px; }
.page-title { align-items: flex-start; flex-direction: column; }
.auth-label { margin-right: 0; display: block; margin-bottom: 8px; }
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Stack the footer content on narrow screens.

The footer now has two text spans; with the current non-wrapping .footer-row, they can crowd or overflow on mobile widths. Add a mobile rule in this breakpoint.

📱 Proposed responsive footer fix
 `@media` (max-width: 700px) {
   .container { width: min(1140px, calc(100% - 24px)); }
   .page { padding-top: 24px; }
   .page-title { align-items: flex-start; flex-direction: column; }
   .auth-label { margin-right: 0; display: block; margin-bottom: 8px; }
+  .footer-row { align-items: flex-start; flex-direction: column; gap: 6px; }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@media (max-width: 700px) {
.container { width: min(1140px, calc(100% - 24px)); }
.page { padding-top: 24px; }
.page-title { align-items: flex-start; flex-direction: column; }
.auth-label { margin-right: 0; display: block; margin-bottom: 8px; }
}
`@media` (max-width: 700px) {
.container { width: min(1140px, calc(100% - 24px)); }
.page { padding-top: 24px; }
.page-title { align-items: flex-start; flex-direction: column; }
.auth-label { margin-right: 0; display: block; margin-bottom: 8px; }
.footer-row { align-items: flex-start; flex-direction: column; gap: 6px; }
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/templates/fragments/head.html` around lines 266 - 271, The
footer's two text spans crowd on small screens because .footer-row prevents
wrapping; inside the existing mobile media query add rules for .footer-row to
stack the items vertically (e.g., set flex-direction: column and adjust
spacing/alignment or use flex-wrap with gap), so the footer content stacks and
gains breathing room on narrow screens; update the CSS selector .footer-row
within the `@media` (max-width: 700px) block and adjust properties like
flex-direction, gap (or margin-bottom), and align-items to ensure proper mobile
layout.

Comment on lines +7 to +10
<main class="container page" style="max-width: 680px;">
<section class="panel">
<h4>Create a Patient Account</h4>
<p class="muted">Use your email to create an account and follow your case updates.</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use an h1 for the page’s primary heading.

This page now has a semantic <main>, but its top heading is still h4, which weakens screen-reader/document navigation.

♿ Proposed heading fix
-        <h4>Create a Patient Account</h4>
+        <h1>Create a Patient Account</h1>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<main class="container page" style="max-width: 680px;">
<section class="panel">
<h4>Create a Patient Account</h4>
<p class="muted">Use your email to create an account and follow your case updates.</p>
<main class="container page" style="max-width: 680px;">
<section class="panel">
<h1>Create a Patient Account</h1>
<p class="muted">Use your email to create an account and follow your case updates.</p>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/resources/templates/login/register.html` around lines 7 - 10, The
page’s primary heading is incorrectly an <h4> inside the semantic <main> (the
element with class "container page"), so replace the <h4>Create a Patient
Account</h4> with an <h1> to restore proper document semantics and screen-reader
navigation; keep or adjust the existing CSS classes/styles (on the main or
heading) to preserve visual appearance and ensure there is only one <h1> on the
page.

@LinusWestling
LinusWestling merged commit 80dc0a1 into main Apr 21, 2026
2 checks passed
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.

Add notification to patient UI that notifies when case gets an update General UI improvements

1 participant