Skip to content

Dev#688

Merged
ashwin31 merged 5 commits into
masterfrom
dev
May 16, 2026
Merged

Dev#688
ashwin31 merged 5 commits into
masterfrom
dev

Conversation

@ashwin31

@ashwin31 ashwin31 commented May 16, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Release Notes

  • New Features

    • Added user name editing in profile settings
    • Enhanced multi-select filtering across accounts, leads, opportunities, cases, and tasks
    • Expanded detail views with attachments, comments, and custom fields support
    • Mobile app profile management with team and assignee controls
  • Improvements

    • Better filter UI with quick-filter chips and persistent filter preferences
    • Richer deal and task browsing with improved aging status and stage indicators

Review Change Stack

ashwin31 added 5 commits May 15, 2026 06:05
… status, and implement deal filtering/sorting logic
… indicators, and assignee avatars, while adding resolution SLA tracking and backend filtering support.
Copilot AI review requested due to automatic review settings May 16, 2026 20:56
return fail(400, {
errors,
data: { phone }
data: { name, phone }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Too many errors. (71% scanned).

const org = locals.org;
const formData = await request.formData();
const phone = formData.get('phone')?.toString();
const name = formData.get('name')?.toString() ?? '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
Expected ':' and instead saw 'toString'.
Expected an assignment or function call and instead saw an expression.
Expected an identifier and instead saw '.'.
Expected an operator and instead saw '?'.
Missing semicolon.

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51f99324-0115-4fbc-bb75-4da7be5eaf70

📥 Commits

Reviewing files that changed from the base of the PR and between d98cfb1 and eaab997.

⛔ Files ignored due to path filters (1)
  • mobile/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (70)
  • backend/accounts/tests/test_accounts_api.py
  • backend/accounts/views.py
  • backend/cases/views.py
  • backend/cases/watcher_views.py
  • backend/common/manager.py
  • backend/common/migrations/0026_add_user_name.py
  • backend/common/models.py
  • backend/common/serializer.py
  • backend/common/tests/test_auth.py
  • backend/common/tests/test_organizations.py
  • backend/common/tests/test_user_name_fallback.py
  • backend/common/views/auth_views.py
  • backend/common/views/organization_views.py
  • backend/leads/tests/test_leads_api.py
  • backend/leads/views/lead_views.py
  • backend/opportunity/tests/test_opportunities_api.py
  • backend/opportunity/views/opportunity_views.py
  • backend/tasks/serializer.py
  • backend/tasks/views/task_views.py
  • frontend/src/routes/(app)/profile/+page.server.js
  • frontend/src/routes/(app)/profile/+page.svelte
  • mobile/android/app/build.gradle.kts
  • mobile/android/build.gradle.kts
  • mobile/lib/config/api_config.dart
  • mobile/lib/data/models/attachment.dart
  • mobile/lib/data/models/dashboard_data.dart
  • mobile/lib/data/models/deal.dart
  • mobile/lib/data/models/lead.dart
  • mobile/lib/data/models/lookup_models.dart
  • mobile/lib/data/models/models.dart
  • mobile/lib/data/models/profile.dart
  • mobile/lib/data/models/task.dart
  • mobile/lib/data/models/ticket.dart
  • mobile/lib/driver_main.dart
  • mobile/lib/firebase_options.dart
  • mobile/lib/main.dart
  • mobile/lib/providers/auth_provider.dart
  • mobile/lib/providers/deals_provider.dart
  • mobile/lib/providers/leads_provider.dart
  • mobile/lib/providers/lookup_provider.dart
  • mobile/lib/providers/profile_provider.dart
  • mobile/lib/providers/tasks_provider.dart
  • mobile/lib/providers/tickets_provider.dart
  • mobile/lib/routes/app_router.dart
  • mobile/lib/screens/auth/login_screen.dart
  • mobile/lib/screens/dashboard/dashboard_screen.dart
  • mobile/lib/screens/deals/deal_detail_screen.dart
  • mobile/lib/screens/deals/deal_form_screen.dart
  • mobile/lib/screens/deals/deals_list_screen.dart
  • mobile/lib/screens/leads/lead_detail_screen.dart
  • mobile/lib/screens/leads/lead_form_screen.dart
  • mobile/lib/screens/leads/leads_list_screen.dart
  • mobile/lib/screens/settings/more_screen.dart
  • mobile/lib/screens/settings/profile_screen.dart
  • mobile/lib/screens/tasks/task_detail_screen.dart
  • mobile/lib/screens/tasks/task_form_screen.dart
  • mobile/lib/screens/tasks/tasks_list_screen.dart
  • mobile/lib/screens/tickets/tickets_list_screen.dart
  • mobile/lib/services/api_service.dart
  • mobile/lib/services/auth_service.dart
  • mobile/lib/services/crash_reporting.dart
  • mobile/lib/widgets/cards/deal_card.dart
  • mobile/lib/widgets/cards/lead_card.dart
  • mobile/lib/widgets/cards/task_row.dart
  • mobile/lib/widgets/cards/ticket_card.dart
  • mobile/lib/widgets/common/app_shell.dart
  • mobile/lib/widgets/misc/kanban_column.dart
  • mobile/lib/widgets/misc/stage_stepper.dart
  • mobile/pubspec.yaml
  • mobile/test/screens/deals/deals_list_screen_test.dart

📝 Walkthrough

Walkthrough

Backend adds shared list filtering, fixes tag filters, simplifies comment creation, and introduces a persisted user name. Frontend profile editing now updates name. Mobile integrates token refresh and Crashlytics, expands core models, and refactors deals, leads, tasks, tickets, and common UI with new providers, screens, and interactions.

Changes

Backend: list filters, comments path, and user name field

Layer / File(s) Summary
Accounts/Leads/Opportunities: multi-value tags filters + tests
backend/accounts/views.py, backend/accounts/tests/test_accounts_api.py, backend/leads/views/lead_views.py, backend/leads/tests/test_leads_api.py, backend/opportunity/views/opportunity_views.py, backend/opportunity/tests/test_opportunities_api.py
Switch list views to params.getlist with tags__id__in and add/adjust tests accordingly.
Cases: shared list filters + watcher integration
backend/cases/views.py, backend/cases/watcher_views.py
Introduce apply_case_list_filters and use it in CaseListView and WatchingListView.
Opportunity/Tasks: comment POST via ORM (no serializer)
backend/opportunity/views/opportunity_views.py, backend/tasks/views/task_views.py
Replace serializer-based creation with direct Comment.objects.create and adjust response shaping.
User.name field + auth/views/serializer/tests
backend/common/*
Add name field/migration, default from email (manager/model), include in serializers, allow profile PATCH of name, capture Google name on auth, include refresh_token, add tests.

Frontend (web): Profile name edit wiring

Layer / File(s) Summary
Profile form/action supports 'name'
frontend/src/routes/(app)/profile/+page.server.js, frontend/src/routes/(app)/profile/+page.svelte
Server action reads/sends name; Svelte form includes editable Full Name input and resets.

Mobile platform: Crashlytics + token refresh/auth integration

Layer / File(s) Summary
Gradle plugins and Firebase options
mobile/android/*, mobile/lib/firebase_options.dart, mobile/lib/driver_main.dart
Add Crashlytics plugin/classpath and firebase_options.dart; include driver_main.
pubspec: Firebase and driver deps
mobile/pubspec.yaml
Add firebase_core, firebase_crashlytics, and flutter_driver.
ApiService refresh+retry and AuthService integration
mobile/lib/services/api_service.dart, mobile/lib/services/auth_service.dart
Add refresh callback/coalescing, retry-on-401, store/rotate refresh_token, preemptive refresh, CrashReporting hooks.
App main and CrashReporting wrapper
mobile/lib/services/crash_reporting.dart
Initialize Crashlytics and set/clear user context.

Mobile shared models and lookups

Layer / File(s) Summary
Attachment, Profile, barrel export, teams lookup/provider
mobile/lib/data/models/*, mobile/lib/providers/lookup_provider.dart
Add Attachment/Profile, export models, and teams lookups/providers.
DashboardTask name parsing and Ticket SLA getter
mobile/lib/data/models/dashboard_data.dart, mobile/lib/data/models/ticket.dart
Parse display names defensively; add isResolutionSlaBreached.
Deal model: unspecified type, detail fields, aging, JSON
mobile/lib/data/models/deal.dart
Expand enums, fields, parsing, JSON, computed aging flags.
Lead model: attachments, custom fields, assignee getters
mobile/lib/data/models/lead.dart
Add attachments/custom fields and improved getters.
Task model: IDs, teams, custom fields, creator
mobile/lib/data/models/task.dart
Add IDs/teams/custom fields/creator fields and parsing.

Mobile deals: providers, screens, widgets, tests

Layer / File(s) Summary
Deals provider: filters, detail, pipeline summary
mobile/lib/providers/deals_provider.dart
Add filters, detail parsing, mutations, and pipeline summary providers.
Deals list: kanban/list UX, filters, bulk ops
mobile/lib/screens/deals/deals_list_screen.dart
Persist view/sort; quick filters; grouping; selection; pagination.
Deal detail: tabbed view, activity/notes/files
mobile/lib/screens/deals/deal_detail_screen.dart
Tabbed detail with timeline, note CRUD, files, stage changes.
Deal form: accountId prefill, teams/CFs, validation
mobile/lib/screens/deals/deal_form_screen.dart
Add teams/tags/CFs, validations, save & add another.
DealCard, KanbanColumn, StageStepper updates
mobile/lib/widgets/*
Provider-driven assignees, aging pill, dominant-currency headers, lost banner.
DealsListScreen widget tests
mobile/test/screens/deals/deals_list_screen_test.dart
Verify closed-lost rendering, DnD stage change, infinite scroll.

Mobile leads: provider, list/detail, card

Layer / File(s) Summary
Leads provider: filters, detail, comment update
mobile/lib/providers/leads_provider.dart
Add filters, detail bundle, updateComment.
Leads list: debounce, filters, paging
mobile/lib/screens/leads/leads_list_screen.dart
Provider-driven filters, sheets, results/empty states, paging.
Lead detail: 4 tabs, notes/files, actions
mobile/lib/screens/leads/lead_detail_screen.dart
Files tab, note edit/delete, assign/tags/follow-up/share/convert.
LeadCard: tappable tags and footer actions
mobile/lib/widgets/cards/lead_card.dart
Tag pills tappable; footer actions for call/email/value.

Mobile tasks: provider, list/detail/form, row widget

Layer / File(s) Summary
Tasks provider: filters and detail + mutations
mobile/lib/providers/tasks_provider.dart
Add TaskFilters, detail loading, helpers, PATCH updates.
Tasks list: search/filters, calendar window, paging
mobile/lib/screens/tasks/tasks_list_screen.dart
Debounced search, chips, month window, infinite scroll.
Task detail: full detail loading and interactions
mobile/lib/screens/tasks/task_detail_screen.dart
Load comments/attachments/CFs, related resolution, interactions.
Task form: assignees, linked record, custom fields
mobile/lib/screens/tasks/task_form_screen.dart
Assign users, link single parent, edit custom fields.
TaskRow/TaskGroup: onComplete and meta row
mobile/lib/widgets/cards/task_row.dart
Add onComplete and tag/status meta row; swipe logic.

Mobile tickets: provider and list UI

Layer / File(s) Summary
Tickets provider: unified fetch and filters
mobile/lib/providers/tickets_provider.dart
Server-side filters (incl. multi), unified path, count/offset.
Tickets list: persist filters, quick chips, new chips
mobile/lib/screens/tickets/tickets_list_screen.dart
Persist/restore filters, quick status, Type and SLA chips.

Mobile common UI/routing and settings/profile

Layer / File(s) Summary
Routes and profile providers/screens
mobile/lib/routes/app_router.dart, mobile/lib/screens/settings/profile_screen.dart, mobile/lib/providers/profile_provider.dart, mobile/lib/providers/auth_provider.dart
Add profile route/screen; profile provider; updateUserName.
Login screen and dashboard updates
mobile/lib/screens/auth/login_screen.dart, mobile/lib/screens/dashboard/dashboard_screen.dart
New login layout/links; greeting and layout tweaks.
AppShell with branch mapping and More sheet
mobile/lib/widgets/common/app_shell.dart
Branch-driven bottom nav; More sheet with actions/sign-out.
TicketCard: tags/relationship row, footer/assignees/SLA label
mobile/lib/widgets/cards/ticket_card.dart
Add pills row, footer info, assignees, SLA label update.
More screen: real auth user and navigation
mobile/lib/screens/settings/more_screen.dart
Use real auth state; navigate to Profile/Tasks.
ApiConfig helpers for profileUpdate and opportunityComment
mobile/lib/config/api_config.dart
Add profileUpdate getter and opportunityComment URL.

Sequence Diagram(s)

sequenceDiagram
  participant Mobile UI
  participant ApiService
  participant AuthService
  participant Backend
  Mobile UI->>ApiService: GET (requiresAuth)
  ApiService->>Backend: Request with access token
  Backend-->>ApiService: 401 Unauthorized
  ApiService->>AuthService: refreshAccessToken()
  AuthService-->>ApiService: true (refreshed)
  ApiService->>Backend: Retry original request
  Backend-->>ApiService: 200 OK (data)
  ApiService-->>Mobile UI: Response
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~180 minutes

Poem

A rabbit taps its tiny keys, delighted by the log,
Tags now filter cleanly—no more UUID slog.
A name pops in from emails, neat as meadow rain,
Deals and leads hop tabs with joy, less pain.
Tasks and tickets scamper swift—Crashlytics keeps the log.
Thump-thump! Ship it—through the fog. 🐇✨

✨ 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 dev

@ashwin31 ashwin31 merged commit 571d242 into master May 16, 2026
5 of 7 checks passed
@ashwin31 ashwin31 deleted the dev branch May 16, 2026 20:57

Copilot AI 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.

Pull request overview

A grab-bag "Dev" PR that adds Firebase Crashlytics dependencies, refactors the kanban column (per-currency totals, multi-select hooks, theming via DealStage.color), adds a closed-lost banner and broader stage-tap behavior to StageStepper, introduces a widget test suite for DealsListScreen, and modifies app_shell.dart (the diff for which was truncated and could not be fully reviewed).

Changes:

  • Add firebase_core / firebase_crashlytics (Android-only intent) and flutter_driver dev dependency.
  • Refactor KanbanColumn to derive stage color from DealStage.color, expose selection / long-press hooks, and replace the single currencySymbol total with a per-currency "dominant bucket + mixed" header.
  • Add closed-lost banner and make all non-current cells tappable in StageStepper; add widget tests covering list view, drag-to-stage, and pagination.

Reviewed changes

Copilot reviewed 65 out of 71 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
mobile/pubspec.yaml Adds Firebase Crashlytics + flutter_driver dependencies.
mobile/pubspec.lock Resolved versions for the new dependencies and their transitives.
mobile/lib/widgets/misc/stage_stepper.dart Adds closed-lost banner and broadens which stage cells are tappable.
mobile/lib/widgets/misc/kanban_column.dart Per-currency header total, selection state, long-press hooks, theme-driven stage color.
mobile/lib/widgets/common/app_shell.dart Diff truncated — not fully reviewed.
mobile/test/screens/deals/deals_list_screen_test.dart New widget tests for list view, drag-to-stage, and pagination behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +113 to +115
onDragStarted: selected
? null
: () => onDealLongPress?.call(deal),
Comment on lines +32 to 47
({Currency currency, double total, bool mixed}) _dominantBucket() {
if (deals.isEmpty) {
return (currency: Currency.usd, total: 0, mixed: false);
}
final Map<Currency, double> totals = {};
for (final deal in deals) {
totals[deal.currency] = (totals[deal.currency] ?? 0) + deal.value;
}
final entries = totals.entries.toList()
..sort((a, b) => b.value.compareTo(a.value));
return (
currency: entries.first.key,
total: entries.first.value,
mixed: entries.length > 1,
);
}
Comment on lines +89 to +92
Future<void> _switchToListView(WidgetTester tester) async {
await tester.tap(find.byType(IconButton).at(1));
await tester.pumpAndSettle();
}
Comment thread mobile/pubspec.yaml
Comment on lines +22 to +24
# Firebase / Crashlytics (Android only — no iOS GoogleService-Info.plist yet)
firebase_core: ^3.10.0
firebase_crashlytics: ^4.2.0
Comment on lines +94 to +111
Future<void> _dragDealToStage(
WidgetTester tester,
String dealTitle,
DealStage targetStage,
) async {
final dealCenter = tester.getCenter(find.text(dealTitle));
final targetRect = tester.getRect(
find.byType(DragTarget<Deal>).at(targetStage.stageIndex),
);
final targetPoint = Offset(targetRect.left + 48, targetRect.top + 120);

final gesture = await tester.startGesture(dealCenter);
await tester.pump(kLongPressTimeout + const Duration(milliseconds: 100));
await gesture.moveTo(targetPoint);
await tester.pump();
await gesture.up();
await tester.pumpAndSettle();
}
Comment on lines +160 to +166
// Any non-current cell is tappable when onStageChange is wired up.
// Backward moves correct mistakes; forward moves advance the deal;
// any tap on a lost deal reopens it into the chosen stage.
final isTappable = !isCurrent && onStageChange != null;

return GestureDetector(
onTap: isFuture && onStageChange != null
? () => onStageChange!(stage.stage)
: null,
onTap: isTappable ? () => onStageChange!(stage.stage) : null,
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