Skip to content

fix(dashboard): simplify business context editing and retries - #811

Merged
izadoesdev merged 3 commits into
stagingfrom
codex/business-context-settings-cleanup
Sep 16, 2026
Merged

izadoesdev merged 3 commits into
stagingfrom
codex/business-context-settings-cleanup

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 16, 2026

Copy link
Copy Markdown
Member

An empty business brief now opens directly in Edit, and refreshing after a failed generation restores the submitted website and research URLs so retrying targets the same inputs. Team edits are compared field by field, fixing a case where moving text into the success field incorrectly left Save disabled.

Consolidates repeated query updates using TanStack mutation callbacks, derives generation access types from the RPC contract, reuses generation validation, and removes redundant empty-state/source copy. Existing draft recovery, revision checks, explicit AI acceptance, and durable error dismissal stay covered. No new dependencies; production code is 23 lines smaller.

Validation: repository lint, all 33 type-check tasks, and repository tests pass. Three browser regressions reproduced the issues before the fixes. All 32 business-context and measurement-plan browser regressions pass with zero retries, covering desktop/mobile layout, streaming, draft recovery, conflicts, and credit-gated states. Independent code review found no actionable issues.

Scope: business context cleanup only, based on current staging after #810; no unmerged dependencies or known active overlap.

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
dashboard Ready Ready Preview Sep 16, 2026 11:56am UTC
databuddy-status Ready Ready Preview Sep 16, 2026 11:56am UTC
1 Skipped Deployment
Project Deployment Actions Updated
documentation Skipped Skipped Sep 16, 2026 11:56am UTC

@vercel
vercel Bot temporarily deployed to Preview – documentation September 16, 2026 11:44 Inactive
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: b6b2f694-8e1f-41f3-a26e-e029fb440e44

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@unkey-deploy

unkey-deploy Bot commented Sep 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Sep 16, 2026 11:55am

@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR streamlines business-context editing and generation retries while consolidating mutation-driven query-cache updates.

  • Opens an empty editable business brief directly in Edit mode.
  • Restores the website and source URLs from a failed generation so retries use the original inputs.
  • Compares team-context fields independently to detect meaningful edits.
  • Centralizes successful mutation cache updates and failed edit invalidation.
  • Adds browser regressions for empty editing, team-field saves, and generation retry recovery.

Confidence Score: 5/5

The PR appears safe to merge with no outstanding correctness, security, or repository-rule issues identified.

The mutation callbacks preserve canonical query state, retry inputs are restored from persisted generation data, team edits are compared field by field, and both previous rule findings are resolved in the current code.

Important Files Changed

Filename Overview
apps/dashboard/app/(main)/organizations/components/business-context-content.tsx Reuses one parsed source URL and omits unavailable read-time copy without changing source-link behavior.
apps/dashboard/app/(main)/organizations/components/business-context-editor.tsx Initializes empty briefs and failed-generation inputs appropriately, simplifies generation validation, and compares team fields independently.
apps/dashboard/app/(main)/organizations/components/business-context-settings.tsx Consolidates mutation cache synchronization and retains invalidation after failed save or restore operations.
apps/dashboard/test/e2e/specs/regressions/business-context.spec.ts Adds focused regression coverage and replaces the previously reported non-null assertions with guarded access.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Load business context] --> B{Saved brief exists?}
    B -->|No and editable| C[Open Edit mode]
    B -->|Yes| D[Open Preview mode]
    A --> E{Failed generation exists?}
    E -->|Yes| F[Restore website and source URLs]
    F --> G[Retry generation]
    G --> H[Mutation succeeds]
    H --> I[Update canonical query cache]
    G --> J[Mutation fails]
    J --> K[Preserve retry inputs]
Loading

Reviews (3): Last reviewed commit: "test(dashboard): guard business context ..." | Re-trigger Greptile

Comment thread apps/dashboard/app/(main)/organizations/components/business-context-settings.tsx Outdated
@izadoesdev
izadoesdev marked this pull request as draft September 16, 2026 11:49
Comment thread apps/dashboard/test/e2e/specs/regressions/business-context.spec.ts Outdated
@izadoesdev
izadoesdev marked this pull request as draft September 16, 2026 11:54
@izadoesdev
izadoesdev marked this pull request as ready for review September 16, 2026 11:55
@vercel
vercel Bot temporarily deployed to Preview – documentation September 16, 2026 11:55 Inactive
@izadoesdev
izadoesdev merged commit dac8b3f into staging Sep 16, 2026
16 checks passed
@izadoesdev
izadoesdev deleted the codex/business-context-settings-cleanup branch September 16, 2026 12:01
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