Skip to content

feat: agreement filters#208

Merged
hmbanan666 merged 2 commits into
mainfrom
agreement-filters
Oct 8, 2025
Merged

feat: agreement filters#208
hmbanan666 merged 2 commits into
mainfrom
agreement-filters

Conversation

@hmbanan666
Copy link
Copy Markdown
Collaborator

@hmbanan666 hmbanan666 commented Oct 8, 2025

Summary by CodeRabbit

  • New Features

    • Agreement page: consolidated header with active badge, contract title, key dates, royalty & patent info, and formatted comments.
    • Agreements list: added sorting (start/end asc/desc) and filtering (all/active/will end soon).
  • Style

    • Badges updated to labeled, subtle variants with adjusted sizes and widths across lists and comment views.
    • Comment item spacing/layout refined (avatar and container adjustments).
    • Compact agreement card no longer shows royalty/patent details; active icon style updated.

@hmbanan666 hmbanan666 self-assigned this Oct 8, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Reworks agreement pages and flow comment UI: Agreement detail replaces PartnerAgreementCard with a Section showing active badge, dates (date-fns ru) and patent status via getPatentStatus; agreement list adds sort/filter USelects and composable sorting/filtering; ItemComment and flow page adjust spacing and badge rendering; minor navigation styling tweaks.

Changes

Cohort / File(s) Summary of Changes
Agreement card & detail
apps/atrium-telegram/app/components/PartnerAgreementCard.vue, apps/atrium-telegram/app/pages/agreement/[agreementId]/index.vue
PartnerAgreementCard.vue: changed active icon (i-lucide-book-check → i-lucide-bookmark-check); removed royalty & patent display blocks and removed getPatentStatus import. Detail page: removed PartnerAgreementCard usage; added Section layout, active indicator, legal entity, formatted dates (date-fns + ru), royalty display when present, getPatentStatus(agreement.patentStatus) usage, and comment block.
Agreement list (sorting/filtering)
apps/atrium-telegram/app/pages/agreement/index.vue
Replaced numeric badge with labeled/subtle badge; added two USelect controls for sort and filter; introduced sortedBy/filteredBy refs, comparator and filter functions, chooseSortFunction/chooseFilterFunction, and builds filteredAgreements via toSorted(...).filter(...).
Flow comments UI
apps/atrium-telegram/app/components/flow/ItemComment.vue, apps/atrium-telegram/app/pages/flow/[itemId]/index.vue
ItemComment.vue: adjusted avatar spacing (mt-2.5 → mt-3) and simplified container structure. Flow page: changed comment count badge to self-closing UBadge with :label="item.comments.length", size sm→md, variant soft→subtle, class min-w-6→min-w-8.
Navigation styling
apps/atrium-telegram/app/pages/navigation.vue
Adjusted spacing (gap 2→2.5), button color neutral→secondary, variant ghost→soft, and cleaned base classes; no behavioral changes.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant ListPage as Agreement List Page
  participant UI as USelect / UBadge
  participant SortFilter as Sort/Filter Logic

  User->>ListPage: Open agreements list
  ListPage->>UI: Render USelect (sort/filter) and labeled badge
  User->>UI: Change sort or filter
  UI->>SortFilter: chooseSortFunction(), chooseFilterFunction()
  SortFilter-->>ListPage: toSorted(...).filter(...)
  ListPage-->>User: Render filteredAgreements
Loading
sequenceDiagram
  actor User
  participant DetailPage as Agreement Detail Page
  participant Helpers as date-fns / getPatentStatus

  User->>DetailPage: Open agreement #[id]
  DetailPage->>Helpers: format(concludedAt/willEndAt, ru)
  DetailPage->>Helpers: getPatentStatus(patentStatus)
  Helpers-->>DetailPage: formatted dates / patent status
  DetailPage-->>User: Render Section with active badge, dates, royalty (if any), patent status, comment
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

I nibble lines and swap a badge,
Dates dance rus, the sections staged.
Badges hum with gentler cheer,
Comments snug and spacing clear.
A hop, a tweak — the UI's bright,
Carrots clapped for tidy sight. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly indicates the addition of agreement filters, which aligns with the key UI enhancements in the pull request where filtering controls were introduced for agreements; it remains clear and concise without extraneous detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2841c3e and a2a0f80.

📒 Files selected for processing (2)
  • apps/atrium-telegram/app/pages/agreement/[agreementId]/index.vue (1 hunks)
  • apps/atrium-telegram/app/pages/agreement/index.vue (2 hunks)

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: 2

🧹 Nitpick comments (2)
apps/atrium-telegram/app/pages/agreement/index.vue (2)

99-106: Use a more precise six-month calculation.

The current calculation 6 * 30 * 24 * 60 * 60 * 1000 assumes all months have exactly 30 days, which is imprecise. Consider using date-fns (already a dependency) for accurate date arithmetic.

Apply this diff to use date-fns for accurate six-month calculation:

+import { subMonths } from 'date-fns'
+
 function filterByWillEndSoon(agreement: PartnerAgreementWithAllData) {
-  const SIX_MONTHS = 6 * 30 * 24 * 60 * 60 * 1000
+  const sixMonthsFromNow = subMonths(new Date(), -6)
   return (
     agreement.isActive
     && agreement.willEndAt
-    && new Date(agreement.willEndAt).getTime() - new Date().getTime() < SIX_MONTHS
+    && new Date(agreement.willEndAt) <= sixMonthsFromNow
   )
 }

91-93: Add parameter to filterByAll for signature consistency.

While filterByAll doesn't need the agreement parameter, adding it maintains consistency with the other filter functions and makes the signature uniform.

Apply this diff:

-function filterByAll() {
+function filterByAll(_agreement: PartnerAgreementWithAllData) {
   return true
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38c9d5e and 2841c3e.

📒 Files selected for processing (6)
  • apps/atrium-telegram/app/components/PartnerAgreementCard.vue (1 hunks)
  • apps/atrium-telegram/app/components/flow/ItemComment.vue (2 hunks)
  • apps/atrium-telegram/app/pages/agreement/[agreementId]/index.vue (1 hunks)
  • apps/atrium-telegram/app/pages/agreement/index.vue (2 hunks)
  • apps/atrium-telegram/app/pages/flow/[itemId]/index.vue (1 hunks)
  • apps/atrium-telegram/app/pages/navigation.vue (1 hunks)
⏰ 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: build

Comment thread apps/atrium-telegram/app/pages/agreement/[agreementId]/index.vue Outdated
Comment thread apps/atrium-telegram/app/pages/agreement/index.vue
@hmbanan666 hmbanan666 merged commit 85dc8bd into main Oct 8, 2025
5 of 6 checks passed
@hmbanan666 hmbanan666 deleted the agreement-filters branch October 8, 2025 11:44
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 8, 2025

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