Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type { BillingErrorPayload } from '../../../../../middleware/shared/ports/types'
import { Modal, ModalContent, ModalHeader, ModalTitle } from '../../../_molecules/modal'

Expand Down Expand Up @@ -51,7 +51,7 @@
const description = isInactive
? `Your subscription is ${billingError.subscriptionStatus ?? 'inactive'}. Reactivate it to keep using AI features.`
: billingError.monthlyLimit != null
? `You've used all ${billingError.monthlyLimit} ACU for this billing period. Buy more ACU or upgrade your plan to keep going.`
? `You've used all ${Math.round(billingError.monthlyLimit)} ACU for this billing period. Buy more ACU or upgrade your plan to keep going.`
: "You're out of ACU for this billing period. Buy more ACU or upgrade your plan to keep going."
const ctaLabel = isInactive ? 'Reactivate subscription' : 'Upgrade plan'
// subscription_inactive carries its own reactivation URL; insufficient_acu doesn't.
Expand All @@ -76,7 +76,8 @@
typeof billingError.remaining === 'number' &&
typeof billingError.required === 'number' && (
<p className='text-[12px] text-neutral-500 dark:text-neutral-400'>
This request needed {billingError.required} ACU; only {billingError.remaining} remaining.
This request needed {Math.round(billingError.required)} ACU; only {Math.round(billingError.remaining)}{' '}
remaining.
</p>
)}
<div className='mt-2 flex items-center justify-end gap-2'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import './configs'

import { Editor as PrimitiveEditor } from '@monaco-editor/react'
Expand Down Expand Up @@ -1257,6 +1257,19 @@
// Editor options
// -----------------------------------------------------------------------

// Inline AI completions take over the suggest widget only while they are
// actually active (same gate as the provider registration above). When the
// user turns inline completions off, fall back to Monaco's normal quick
// suggestions (the auto-dropdown). Ctrl+Space still triggers the suggest
// widget manually in both modes — `quickSuggestions` only governs the
// automatic popup, and `suppressSuggestions` only suppresses the auto popup
// while an inline suggestion is showing.
const inlineCompletionsActive =
capabilities.hasAIAssistant &&
aiState.isEnabled &&
aiState.hasConsented &&
aiState.preferences.inlineCompletionsEnabled

const monacoEditorUserOptions: monacoEditorOptionsType = {
minimap: { enabled: false },
dropIntoEditor: { enabled: true },
Expand All @@ -1273,7 +1286,7 @@
tabSize: 4,
insertSpaces: true,
detectIndentation: false,
quickSuggestions: capabilities.hasAIAssistant ? false : undefined,
quickSuggestions: inlineCompletionsActive ? false : undefined,
// Pinned for cross-platform consistency with the variables-code-editor.
// Monaco's default is platform-dependent (12 on macOS, 14 elsewhere) —
// without this both surfaces would mismatch on Linux/Windows even
Expand All @@ -1295,7 +1308,7 @@
// `document.body` with `position: fixed`, so they escape both
// the editor container and the variables table above it.
fixedOverflowWidgets: true,
...(capabilities.hasAIAssistant && {
...(inlineCompletionsActive && {
inlineSuggest: {
enabled: true,
suppressSuggestions: true,
Expand Down
Loading