Skip to content

feat(actions): add acknowledgement field to decision dialogs#153

Open
isasmendiagus wants to merge 4 commits intomainfrom
feat/SP-4172/add-acknowledgement-input
Open

feat(actions): add acknowledgement field to decision dialogs#153
isasmendiagus wants to merge 4 commits intomainfrom
feat/SP-4172/add-acknowledgement-input

Conversation

@isasmendiagus
Copy link
Collaborator

@isasmendiagus isasmendiagus commented Mar 23, 2026

Summary by CodeRabbit

  • New Features

    • Added an optional "Acknowledgement" field to component decision dialogs; it can be entered in the modal and is persisted with include/remove/replace actions.
    • Decisions now record an automatic UTC timestamp (ISO 8601) when saved.
    • UI: added Acknowledgement textarea and help tooltips for Comment and Acknowledgement.
  • Documentation

    • Changelog updated to reflect these changes.

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fb9e7865-b8af-4a06-ab3b-9eb19cc2a731

📥 Commits

Reviewing files that changed from the base of the PR and between e803e80 and 6136b26.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • backend/entities/component.go
  • backend/entities/scanoss_settings.go
  • backend/service/component_service_impl.go
  • frontend/wailsjs/go/models.ts
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • backend/service/component_service_impl.go
  • backend/entities/component.go
  • frontend/wailsjs/go/models.ts

📝 Walkthrough

Walkthrough

Added an optional "acknowledgement" field and an automatic UTC RFC3339 "timestamp" to component filter types; propagated these through backend entities and service logic, frontend modal and store, generated TypeScript models, and recorded changes in the changelog.

Changes

Cohort / File(s) Summary
Backend Entities
backend/entities/component.go, backend/entities/scanoss_settings.go
Added optional Acknowledgement and Timestamp fields to ComponentFilterDTO and ComponentFilter (JSON tags acknowledgement,omitempty, timestamp,omitempty).
Backend Service Logic
backend/service/component_service_impl.go
Populate Acknowledgement, set Timestamp to current UTC RFC3339 when applying filters, and pass both into scanossSettingsRepo.AddBomEntry / RemoveBomEntry.
Frontend UI
frontend/src/components/FilterActionModal.tsx
Added acknowledgement form state, tooltip + textarea, reset on open, and include acknowledgement in onConfirm payload.
Frontend Store / Flow
frontend/src/modules/components/stores/useComponentFilterStore.ts
Extended OnFilterComponentArgs with optional acknowledgement and include it when constructing entities.ComponentFilterDTO for folder and selection flows.
Generated Models
frontend/wailsjs/go/models.ts
Made ComponentFilter.purl optional; added optional acknowledgement and timestamp to ComponentFilter and ComponentFilterDTO; added Bom.exclude?: ComponentFilter[]; added new FileSnippetSettings model and ScanossSettingsSchema.file_snippet?: FileSnippetSettings.
Changelog
CHANGELOG.md
Documented Acknowledgement UI field, tooltips for Comment/Acknowledgement, and automatic UTC timestamp saved with each BOM decision under Unreleased.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(200,200,255,0.5)
  participant User
  end
  rect rgba(200,255,200,0.5)
  participant Frontend as Frontend UI
  participant Store as Component Store
  end
  rect rgba(255,200,200,0.5)
  participant Backend as Backend Service
  participant Repo as ScanOSS Repo
  end

  User->>Frontend: Open FilterActionModal, enter comment + acknowledgement
  Frontend->>Store: onConfirm(payload includes acknowledgement)
  Store->>Backend: send ComponentFilterDTO (includes acknowledgement, optional fields)
  Backend->>Backend: set Timestamp = now().UTC().Format(RFC3339)
  Backend->>Repo: AddBomEntry / RemoveBomEntry with ComponentFilter (acknowledgement, timestamp)
  Repo-->>Backend: persist result
  Backend-->>Store: response
  Store-->>Frontend: update UI / close modal
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 A tiny note I tuck inside,

A whisper carried far and wide.
From modal burrow to settings nest,
I hop along to mark each quest.
🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the primary change: adding an acknowledgement field to decision dialogs, which is reflected across the frontend modal UI, backend entities, and filter logic throughout the changeset.

✏️ 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 feat/SP-4172/add-acknowledgement-input

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.3)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

@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.

🧹 Nitpick comments (2)
frontend/src/components/FilterActionModal.tsx (1)

241-251: Add explicit label-to-textarea association for accessibility.

The new Acknowledgement label and textarea are siblings, so assistive tech may not reliably link them. Consider adding id/htmlFor.

♿ Suggested a11y tweak
+ const acknowledgementId = 'filter-acknowledgement';
...
- <Label>
+ <Label htmlFor={acknowledgementId}>
    Acknowledgement <span className="text-xs font-normal text-muted-foreground">(optional)</span>
  </Label>
  <Textarea
+   id={acknowledgementId}
    value={acknowledgement}
    onChange={(e) => setAcknowledgement(e.target.value)}
    placeholder="Add an acknowledgement..."
  />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/FilterActionModal.tsx` around lines 241 - 251, The
Label and Textarea for the Acknowledgement field are not explicitly associated
which harms accessibility; update the Textarea and Label usage in the
FilterActionModal component by giving the Textarea a unique id (e.g.,
"acknowledgement") and set the Label's htmlFor to that id so assistive tech can
link the label to the input; ensure you keep using the existing state variables
acknowledgement and setAcknowledgement and preserve the placeholder/onChange
behavior.
frontend/src/modules/components/stores/useComponentFilterStore.ts (1)

89-117: Consider extracting a shared DTO builder to reduce drift risk.

Both branches now replicate the same common fields (action/comment/acknowledgement/license). A small helper would make future schema updates safer.

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

In `@frontend/src/modules/components/stores/useComponentFilterStore.ts` around
lines 89 - 117, Extract a shared DTO builder function (e.g.,
buildComponentFilterDTO or makeComponentFilterDTO) that accepts the common
values (action, comment, acknowledgement, license) and returns a base object
typed as entities.ComponentFilterDTO; then use that builder in both branches
when constructing dto arrays and merge branch-specific fields (purl, path,
replace_with) into the base before calling FilterComponents. Replace the inline
object literals in the folder branch and the selectedResults.map branch with
calls to the new builder so future schema changes affect a single location.
🤖 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/components/FilterActionModal.tsx`:
- Around line 241-251: The Label and Textarea for the Acknowledgement field are
not explicitly associated which harms accessibility; update the Textarea and
Label usage in the FilterActionModal component by giving the Textarea a unique
id (e.g., "acknowledgement") and set the Label's htmlFor to that id so assistive
tech can link the label to the input; ensure you keep using the existing state
variables acknowledgement and setAcknowledgement and preserve the
placeholder/onChange behavior.

In `@frontend/src/modules/components/stores/useComponentFilterStore.ts`:
- Around line 89-117: Extract a shared DTO builder function (e.g.,
buildComponentFilterDTO or makeComponentFilterDTO) that accepts the common
values (action, comment, acknowledgement, license) and returns a base object
typed as entities.ComponentFilterDTO; then use that builder in both branches
when constructing dto arrays and merge branch-specific fields (purl, path,
replace_with) into the base before calling FilterComponents. Replace the inline
object literals in the folder branch and the selectedResults.map branch with
calls to the new builder so future schema changes affect a single location.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f8b18a40-59db-42ac-840d-d9408a10d991

📥 Commits

Reviewing files that changed from the base of the PR and between c25837e and 749120a.

📒 Files selected for processing (6)
  • backend/entities/component.go
  • backend/entities/scanoss_settings.go
  • backend/service/component_service_impl.go
  • frontend/src/components/FilterActionModal.tsx
  • frontend/src/modules/components/stores/useComponentFilterStore.ts
  • frontend/wailsjs/go/models.ts

@isasmendiagus isasmendiagus force-pushed the feat/SP-4172/add-acknowledgement-input branch from 3091d08 to b9f0245 Compare March 23, 2026 15:29
@github-actions
Copy link

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 190
  • Detected files undeclared: 0
  • Detected files declared: 190
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

@github-actions
Copy link

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 190
  • Detected files undeclared: 0
  • Detected files declared: 190
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

Copy link

@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

🧹 Nitpick comments (2)
backend/service/component_service_impl.go (1)

70-103: Refactor repeated DTO mapping in setInitialFilters to a shared converter.

The include/remove/replace mapping blocks are mostly identical; a helper would reduce duplication and prevent future field drift.

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

In `@backend/service/component_service_impl.go` around lines 70 - 103, Refactor
the repeated mapping in setInitialFilters by extracting a helper function (e.g.,
mapToComponentFilterDTO) that accepts a source filter and an action
(entities.Include/Remove/Replace) and returns entities.ComponentFilterDTO;
ensure the helper maps Path, Purl, Usage (string()), Comment, Acknowledgement,
License and conditionally sets ReplaceWith when action == entities.Replace, then
replace the three for-loops over initialFilters.Include/Remove/Replace with
calls that pass each item and the appropriate action into this helper and append
the returned DTO to s.initialFilters.
frontend/src/components/FilterActionModal.tsx (1)

233-245: Consider extracting the repeated “label + tooltip” block into a small helper component.

This duplication is small now, but extracting it will reduce drift when styles/text behavior evolve.

Also applies to: 256-268

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

In `@frontend/src/components/FilterActionModal.tsx` around lines 233 - 245, The
repeated "label + tooltip" JSX block in FilterActionModal (the fragment using
Label, Tooltip, TooltipTrigger, TooltipContent and HelpCircle) should be
extracted into a small presentational component (e.g., ActionLabelWithTooltip or
LabelTooltip) and reused in both places (current block and the one at lines
~256-268). Create the new component accepting props for label text, optional
subtext (the "(optional)" span), tooltip content and any className overrides;
replace the duplicated JSX in FilterActionModal with <ActionLabelWithTooltip ...
/> to keep markup and tooltip behavior consistent and reduce drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/components/FilterActionModal.tsx`:
- Around line 238-240: The HelpCircle SVG used as the child of TooltipTrigger is
not focusable or announced to screen readers; update the TooltipTrigger usage in
FilterActionModal so its child is a native focusable control (a <button
type="button">) with an appropriate aria-label (e.g., aria-label="Help for
[context]"). Move the existing className and hover styles to that button (keep
TooltipTrigger asChild) and ensure the button contains the HelpCircle icon;
apply the same change for the second occurrence around the HelpCircle at the
other location referenced (lines ~261-263). This will make TooltipTrigger
keyboard-accessible and screen-reader friendly.

---

Nitpick comments:
In `@backend/service/component_service_impl.go`:
- Around line 70-103: Refactor the repeated mapping in setInitialFilters by
extracting a helper function (e.g., mapToComponentFilterDTO) that accepts a
source filter and an action (entities.Include/Remove/Replace) and returns
entities.ComponentFilterDTO; ensure the helper maps Path, Purl, Usage
(string()), Comment, Acknowledgement, License and conditionally sets ReplaceWith
when action == entities.Replace, then replace the three for-loops over
initialFilters.Include/Remove/Replace with calls that pass each item and the
appropriate action into this helper and append the returned DTO to
s.initialFilters.

In `@frontend/src/components/FilterActionModal.tsx`:
- Around line 233-245: The repeated "label + tooltip" JSX block in
FilterActionModal (the fragment using Label, Tooltip, TooltipTrigger,
TooltipContent and HelpCircle) should be extracted into a small presentational
component (e.g., ActionLabelWithTooltip or LabelTooltip) and reused in both
places (current block and the one at lines ~256-268). Create the new component
accepting props for label text, optional subtext (the "(optional)" span),
tooltip content and any className overrides; replace the duplicated JSX in
FilterActionModal with <ActionLabelWithTooltip ... /> to keep markup and tooltip
behavior consistent and reduce drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e1b8dce-14a7-45f6-b8d6-50352897ed3e

📥 Commits

Reviewing files that changed from the base of the PR and between 3091d08 and e803e80.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • backend/entities/component.go
  • backend/entities/scanoss_settings.go
  • backend/service/component_service_impl.go
  • frontend/src/components/FilterActionModal.tsx
  • frontend/src/modules/components/stores/useComponentFilterStore.ts
  • frontend/wailsjs/go/models.ts
✅ Files skipped from review due to trivial changes (3)
  • CHANGELOG.md
  • frontend/wailsjs/go/models.ts
  • backend/entities/component.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • backend/entities/scanoss_settings.go
  • frontend/src/modules/components/stores/useComponentFilterStore.ts

@github-actions
Copy link

SCANOSS SCAN Completed 🚀

  • Detected components: 3
  • Undeclared components: 0
  • Declared components: 3
  • Detected files: 190
  • Detected files undeclared: 0
  • Detected files declared: 190
  • Licenses detected: 2
  • Licenses detected with copyleft: 1
  • Policies: ✅ 1 pass (1 total)

View more details on SCANOSS Action Summary

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.

1 participant