Skip to content

feat(dashboard): improve business context reading and generation - #809

Merged
izadoesdev merged 14 commits into
stagingfrom
codex/business-context-experience
Sep 16, 2026
Merged

izadoesdev merged 14 commits into
stagingfrom
codex/business-context-experience

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Sep 16, 2026

Copy link
Copy Markdown
Member

Business context opened as raw text, exposed generation eligibility only after failure, and made generated replacements difficult to review. The page now provides Markdown previews, explicit draft review, clear generation access, and recoverable manual edits in a compact layout.

  • Reuse Streamdown for saved Markdown and partial generation output. AI drafts require review and acceptance before saving; desktop compares versions side by side and mobile switches between them.
  • Share page and card geometry across organization, brief, and credit loading. Keep queued progress at the top of a shorter document pane, use one research action per state, and preserve edits while generation runs. Manual editing remains available without credits. Persistent field descriptions replace input placeholders.
  • Check generation eligibility before queueing and recheck on the server. Accept up to six public source pages on the selected site or its subdomains; read fresh sources and follow another discovery step within the existing seven-page limit. Partial output remains separate from the approved brief.
  • Correct the inherited billing E2E syntax error and absent-actor integration assertion. Deferred browser requests use portable Promise constructors compatible with CI's Node runtime.

Validation: root lint and all 33 workspace typecheck tasks; all 27 pre-push tasks; 25 business-context/measurement browser regressions covering desktop/mobile loading, credits, queued/reading/streaming output, editing, saving, conflicts, history, and recovery. A regression reproduces stale AI draft acceptance and verifies revision protection survives reload until explicit conflict review. Dark-mode screenshots inspected. Brief/document geometry stays fixed through tested transitions; research access changes remain under 1px. Earlier backend validation includes 24 RPC tests, 52 generator/shared-schema tests, and 25 isolated PostgreSQL storage tests. All fixtures are synthetic and paid providers are mocked.

Based on current staging, including session-only mutations and metadata-read fixes. Related context work: #751; no dependency on an unmerged branch. No new dependencies, tables, or migrations. AI-assisted implementation and review.

@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 9:43am UTC
databuddy-status Ready Ready Preview Sep 16, 2026 9:43am UTC
1 Skipped Deployment
Project Deployment Actions Updated
documentation Skipped Skipped Sep 16, 2026 9:43am UTC

@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: f6a9c59f-cc9d-4472-bfc7-991305fd53ea

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 9:42am

@blacksmith-sh

This comment has been minimized.

@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR improves the organization business-context workflow across the dashboard, RPC, service, shared schema, and Insights worker.

  • Adds Markdown previews, explicit AI-draft comparison and acceptance, responsive loading states, and persistent editing guidance.
  • Adds generation-access preflight checks while retaining server-side enforcement and unrestricted manual editing.
  • Supports bounded, same-site source URLs, fresh page reads, streamed generation progress, and an additional discovery pass.
  • Preserves revision conflicts when accepting AI drafts and adds regression coverage for stale drafts, loading transitions, billing states, and draft recovery.
  • Updates supporting integration and E2E tests for portable deferred requests and corrected assertions.

Confidence Score: 5/5

The PR appears safe to merge; the two previous findings are resolved and no new actionable defects were identified.

The stale AI-draft path now preserves the older base revision until the user explicitly reviews the conflict, and prohibited placeholders were replaced with persistent descriptions. Both previous threads were manually resolved without explanatory replies.

Important Files Changed

Filename Overview
apps/dashboard/app/(main)/organizations/components/business-context-editor.tsx Adds preview, editing, generation, comparison, and conflict-review states while preserving stale-revision protection.
apps/dashboard/app/(main)/organizations/components/business-context-settings.tsx Connects generation-access state and source URLs to the business-context editor.
apps/insights/src/organization-business-context.ts Adds fresh same-site source reading, bounded follow-up discovery, and separately persisted streaming progress.
packages/rpc/src/lib/business-context-access.ts Introduces read-only billing and provider-configuration preflight checks for AI generation.
packages/rpc/src/routers/business-context.ts Exposes generation access and rechecks eligibility before queueing generation.
packages/services/src/organization-business-context.ts Persists validated source selections and transient generation progress without promoting partial output to the saved profile.
packages/shared/src/organization-business-context.ts Defines bounded public source URL, provenance timestamp, and generation-progress contracts.
apps/dashboard/test/e2e/specs/regressions/business-context.spec.ts Adds broad regression coverage for responsive loading, access states, generation review, stale revisions, and recovery.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Organization member] --> B[Business context dashboard]
    B --> C[Manual editing]
    B --> D[Generation access preflight]
    D -->|Allowed| E[Queue generation]
    D -->|Unavailable or no credits| C
    E --> F[Read bounded same-site sources]
    F --> G[Stream partial draft]
    G --> H[Review current and proposed versions]
    H --> I[Accept into local draft]
    I --> J{Revision still current?}
    C --> J
    J -->|Yes| K[Save canonical profile]
    J -->|No| L[Conflict review]
    L --> K
Loading

Reviews (2): Last reviewed commit: "fix(dashboard): preserve stale AI draft ..." | Re-trigger Greptile

Comment thread apps/dashboard/app/(main)/organizations/components/business-context-editor.tsx Outdated
Comment thread apps/dashboard/app/(main)/organizations/components/business-context-editor.tsx Outdated
@vercel
vercel Bot temporarily deployed to Preview – documentation September 16, 2026 09:42 Inactive
@izadoesdev
izadoesdev marked this pull request as draft September 16, 2026 09:45
@izadoesdev
izadoesdev marked this pull request as ready for review September 16, 2026 09:45
@izadoesdev
izadoesdev merged commit f2b4c36 into staging Sep 16, 2026
21 checks passed
@izadoesdev
izadoesdev deleted the codex/business-context-experience branch September 16, 2026 09:48
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