Compare commits

...

5 Commits

Author SHA1 Message Date
Joseph T. Lyons
6367469c27 v0.158.x stable 2024-10-23 13:12:16 -04:00
gcp-cherry-pick-bot[bot]
80799d2424 semantic_index: Disable embeddings index for non-staff (cherry-pick #19618) (#19626)
Cherry-picked semantic_index: Disable embeddings index for non-staff
(#19618)

This PR disables the embeddings index for non-staff users.

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-23 13:03:01 -04:00
Peter Tripp
363530ea84 zed 0.158.1 2024-10-16 14:47:11 -04:00
gcp-cherry-pick-bot[bot]
7ce18afabf assistant: Direct user to account page to subscribe for more LLM usage (cherry-pick #19300) (#19301)
Cherry-picked assistant: Direct user to account page to subscribe for
more LLM usage (#19300)

This PR updates the location where we send the user to subscribe for
more LLM usage to the account page.

Release Notes:

- Updated the URL to the account page when subscribing to LLM usage.

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-16 14:26:52 -04:00
Joseph T. Lyons
f9beb25fb0 v0.158.x preview 2024-10-16 12:47:43 -04:00
6 changed files with 22 additions and 5 deletions

2
Cargo.lock generated
View File

@@ -14577,7 +14577,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.158.0"
version = "0.158.1"
dependencies = [
"activity_indicator",
"anyhow",

View File

@@ -4347,7 +4347,7 @@ impl ContextEditor {
fn render_payment_required_error(&self, cx: &mut ViewContext<Self>) -> AnyElement {
const ERROR_MESSAGE: &str = "Free tier exceeded. Subscribe and add payment to continue using Zed LLMs. You'll be billed at cost for tokens used.";
const SUBSCRIBE_URL: &str = "https://zed.dev/api/billing/initiate_checkout";
const ACCOUNT_URL: &str = "https://zed.dev/account";
v_flex()
.gap_0p5()
@@ -4372,7 +4372,7 @@ impl ContextEditor {
.child(Button::new("subscribe", "Subscribe").on_click(cx.listener(
|this, _, cx| {
this.last_error = None;
cx.open_url(SUBSCRIBE_URL);
cx.open_url(ACCOUNT_URL);
cx.notify();
},
)))

View File

@@ -5,6 +5,7 @@ use crate::{
};
use anyhow::{anyhow, Context as _, Result};
use collections::Bound;
use feature_flags::FeatureFlagAppExt;
use fs::Fs;
use futures::stream::StreamExt;
use futures_batch::ChunksTimeoutStreamExt;
@@ -15,6 +16,7 @@ use log;
use project::{Entry, UpdatedEntriesSet, Worktree};
use serde::{Deserialize, Serialize};
use smol::channel;
use smol::future::FutureExt;
use std::{
cmp::Ordering,
future::Future,
@@ -65,6 +67,10 @@ impl EmbeddingIndex {
&self,
cx: &AppContext,
) -> impl Future<Output = Result<()>> {
if !cx.is_staff() {
return async move { Ok(()) }.boxed();
}
let worktree = self.worktree.read(cx).snapshot();
let worktree_abs_path = worktree.abs_path().clone();
let scan = self.scan_entries(worktree, cx);
@@ -75,6 +81,7 @@ impl EmbeddingIndex {
futures::try_join!(scan.task, chunk.task, embed.task, persist)?;
Ok(())
}
.boxed()
}
pub fn index_updated_entries(
@@ -82,6 +89,10 @@ impl EmbeddingIndex {
updated_entries: UpdatedEntriesSet,
cx: &AppContext,
) -> impl Future<Output = Result<()>> {
if !cx.is_staff() {
return async move { Ok(()) }.boxed();
}
let worktree = self.worktree.read(cx).snapshot();
let worktree_abs_path = worktree.abs_path().clone();
let scan = self.scan_updated_entries(worktree, updated_entries.clone(), cx);
@@ -92,6 +103,7 @@ impl EmbeddingIndex {
futures::try_join!(scan.task, chunk.task, embed.task, persist)?;
Ok(())
}
.boxed()
}
fn scan_entries(&self, worktree: Snapshot, cx: &AppContext) -> ScanEntries {

View File

@@ -336,6 +336,11 @@ mod tests {
init_test(cx);
cx.update(|cx| {
// This functionality is staff-flagged.
cx.update_flags(true, vec![]);
});
let temp_dir = tempfile::tempdir().unwrap();
let mut semantic_index = SemanticDb::new(

View File

@@ -2,7 +2,7 @@
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.158.0"
version = "0.158.1"
publish = false
license = "GPL-3.0-or-later"
authors = ["Zed Team <hi@zed.dev>"]

View File

@@ -1 +1 @@
dev
stable