Skip to content

Conversation

@monsieurswag
Copy link
Contributor

@monsieurswag monsieurswag commented Jan 23, 2026

[1] Fix error 404 by requesting unexisting backend URL /api/risk-assessments/risk_tolerance/ endpoint.
[2] Fix 301 redirect caused by bad URL formatting /api/ebios-rm/studies (not having ending slash).
[3] Fix some UI flaws includes:

  • Text aligment flaws
  • Matrix legend placement

[4] Improve ebios-rm report UX by using links instead of raw text for some object names for:

  • Assets in feared events
  • Feared events in RO/TO couples
  • Threats in operation scenarios

For the 4th thing, the reviewer shall decide if we generalize this pattern for the whole ebios report or not OR remove this pattern completly.

Summary by CodeRabbit

  • New Features

    • Risk matrix legend now displays in current risk assessment view.
  • Bug Fixes

    • Assets, feared events, and threats on reports now render as clickable links for easier navigation.
    • Badge content text wrapping improved on operational scenario pages.
  • Style

    • Enhanced spacing and alignment across risk assessment and stakeholder pages for improved visual consistency.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

The pull request encompasses UI styling refinements, component rendering updates using Anchor links, a data model field removal for risk assessments, and minor URL formatting adjustments across multiple frontend pages and utilities.

Changes

Cohort / File(s) Summary
UI Styling Updates
frontend/src/lib/components/RiskMatrix/Legend.svelte, frontend/src/routes/(app)/(internal)/operational-scenarios/[id=uuid]/+page.svelte, frontend/src/routes/(app)/(internal)/ro-to/[id=uuid]/+page.svelte
Legend title padding changed from p-2 to pl-6 for increased left indentation; table header cell alignment centered. Badges updated with whitespace-normal and break-all classes for wrapping support. Spacing added around "/" separator with px-2 and icon alignment adjusted with self-center.
Data Model Changes
frontend/src/lib/utils/crud.ts
risk-assessments model's selectFields simplified by removing risk_tolerance field; now only selects status field, reducing fetched data for list views.
URL & Endpoint Formatting
frontend/src/routes/(app)/(internal)/[model=urlmodel]/+page.server.ts, frontend/src/routes/(app)/(internal)/ebios-rm/+server.ts
Trailing slash inserted before query string in endpoint URL construction. Empty line added for spacing.
Component Rendering Enhancements
frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/report/+page.svelte, frontend/src/routes/(app)/(internal)/risk-assessments/[id=uuid]/+page.svelte
Assets, feared events, and threats rendered as per-item Anchor components with appropriate hrefs instead of comma-separated strings. RiskMatrix showLegend prop added to current matrix invocation; removed from residual matrix invocation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A hopping rabbit tidied the UI,
Styled badges bright and links that fly,
Anchors now bind assets near and far,
While data fields shrink like a star,
Prettier pages, no need to sigh! 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The PR title accurately summarizes the two main changes: fixing bad URLs in requests and improving EBIOS UI/UX, matching the file-level changes across multiple components.

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

✨ Finishing touches
  • 📝 Generate docstrings

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
Contributor

@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 `@frontend/src/routes/`(app)/(internal)/ebios-rm/+server.ts:
- Around line 6-10: The endpoint string construction in the GET handler always
appends a "?" because url.searchParams is always truthy; change the condition to
check url.searchParams.toString() (or its length) and only append
"?"+url.searchParams.toString() when that string is non-empty so the endpoint
variable (constructed with BASE_API_URL, model.endpointUrl, and
url.searchParams) does not get an extraneous trailing question mark.
🧹 Nitpick comments (1)
frontend/src/routes/(app)/(internal)/ebios-rm/[id=uuid]/report/+page.svelte (1)

452-454: Consider renaming the filter callback parameter for clarity.

The parameter id is misleading since it's actually a feared event object, not an ID value. The comparison id.id === fe.id reads awkwardly.

♻️ Suggested improvement
 {`@const` fearedEvents = reportData.feared_events.filter((fe) =>
-    roto.feared_events.some((id) => id.id === fe.id)
+    roto.feared_events.some((rotoFe) => rotoFe.id === fe.id)
 )}

Comment on lines 6 to 10
export const GET: RequestHandler = async ({ fetch, params, url }) => {
const model = getModelInfo('ebios-rm');
const endpoint = `${BASE_API_URL}/${model.endpointUrl}${
const endpoint = `${BASE_API_URL}/${model.endpointUrl}/${
url.searchParams ? '?' + url.searchParams.toString() : ''
}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid appending an empty ? when there are no query params.

url.searchParams is always truthy, so this always adds ? even when the query is empty. Consider guarding on toString() to keep canonical URLs.

🛠️ Suggested fix
-	const endpoint = `${BASE_API_URL}/${model.endpointUrl}/${
-		url.searchParams ? '?' + url.searchParams.toString() : ''
-	}`;
+	const query = url.searchParams.toString();
+	const endpoint = `${BASE_API_URL}/${model.endpointUrl}/${query ? `?${query}` : ''}`;
📝 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
export const GET: RequestHandler = async ({ fetch, params, url }) => {
const model = getModelInfo('ebios-rm');
const endpoint = `${BASE_API_URL}/${model.endpointUrl}${
const endpoint = `${BASE_API_URL}/${model.endpointUrl}/${
url.searchParams ? '?' + url.searchParams.toString() : ''
}`;
export const GET: RequestHandler = async ({ fetch, params, url }) => {
const model = getModelInfo('ebios-rm');
const query = url.searchParams.toString();
const endpoint = `${BASE_API_URL}/${model.endpointUrl}/${query ? `?${query}` : ''}`;
🤖 Prompt for AI Agents
In `@frontend/src/routes/`(app)/(internal)/ebios-rm/+server.ts around lines 6 -
10, The endpoint string construction in the GET handler always appends a "?"
because url.searchParams is always truthy; change the condition to check
url.searchParams.toString() (or its length) and only append
"?"+url.searchParams.toString() when that string is non-empty so the endpoint
variable (constructed with BASE_API_URL, model.endpointUrl, and
url.searchParams) does not get an extraneous trailing question mark.

@ab-smith ab-smith marked this pull request as draft January 23, 2026 20:37
@nas-tabchiche nas-tabchiche changed the title fix: Bad URLs in request + some ebios UI/UX improvements fix: bad URLs in request + some ebios UI/UX improvements Jan 26, 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