Commit Graph

8758 Commits

Author SHA1 Message Date
Stefan Hengl
4f79980e0e
notebooks: store default pattern type per notebook (#63472)
This PR refactors notebooks to support the upcoming Keyword Search GA. The main goal is to make it easier to switch to a new default pattern type without breaking existing notebooks.

**Before**
- pattern type and version were hardcoded in several places

**After**
- Each notebook has a read-only pattern type as determined by the new column `notebooks.pattern_type` (defaults to "standard").

**Notes**
- Notebooks call the Stream API via various helper functions. `patternType` and `version` are both required parameters, which is redundant, because version acts as a default pattern type already. I left a TODO in the code for that. I don't want to change this as part of this PR because the change would get very big and affect too much code outside of Notebooks. 
- We support rendering notebooks with `.snb.md` extension. Unlike notebooks stored in our db, we cannot migrate those files.

**Q&A**
Q: How does this help for Keyword Search GA?
A: Once we default to keyword search, we can change the default of `notebooks.pattern_type` from "standard" to "keyword". Existing notebooks will still work with "standard". New Notebooks will use "keyword". 

Q: How can customers migrate existing notebooks to a new version? 
A: Use the existing "Copy to My Notebooks" function of Notebooks. The copied notebook will have the current default pattern type. 
 
Test plan:
- existing tests pass
- manual testing
  - I created a couple of notebooks with all the different block types and verified via the network tab that all requests to the Stream API have the proper pattern type. I played around with different values in `notebooks.pattern_type` to make sure that the request parameters change.
2024-07-01 10:45:46 +02:00
Quinn Slack
40ea9132ab
narrow NamespaceProps type (#63571)
Also reduce dependency on the GraphQL result types.


## Test plan

CI
2024-07-01 01:11:54 -07:00
Quinn Slack
d81a9f21f2
remove unused code for org member summary & autocomplete (#63567)
These have been unused for ~2 years. All usage of these APIs was removed
in https://github.com/sourcegraph/sourcegraph/pull/43644 and related
changes.

## Test plan

CI
2024-07-01 07:58:14 +00:00
Quinn Slack
78f4357852
fetch User.id to suppress GraphQL cache warning (#63538)
Fixes `Cache data may be lost when replacing the user field of a Query
object. ...`
2024-06-29 04:07:48 +00:00
Kevin Chen
0e82e717b3 updated models
updated models
2024-06-28 16:43:56 -07:00
Kevin Chen
654620900f Update free tier limits 2024-06-28 16:43:56 -07:00
Peter Guy
bca052634e
fix(search): VSCode Search extension: hide file preview link (#63552)
The VSCode Search extension does not support file preview, so hide it
from the search results when the search originates from the VSCode
Search extension.

Example showing the file preview links (before this PR):
<img width="1511" alt="Screenshot 2024-06-28 at 09 42 26"
src="https://github.com/sourcegraph/sourcegraph/assets/129280/552cef26-9109-487a-96dd-0789d758c074">

Example without the file preview links (after this PR):
<img width="1511" alt="Screenshot 2024-06-28 at 09 43 46"
src="https://github.com/sourcegraph/sourcegraph/assets/129280/c53a1c8e-c27e-4958-808b-e5469745d182">

## Test plan

### Automated tests still pass
Including visual and functional tests of the file preview functionality.

### Build and run locally

#### Build
```
git switch peterguy/vscode-hide-preview-file-link
cd client/vscode
pnpm run build
```
#### Run
- Launch extension in VSCode: open the `Run and Debug` sidebar view in
VS Code, then select `Launch VS Code Extension` from the dropdown menu.
- Run a search using the search bar.
- See that the file preview link 

### Check that the file preview link exists in the web app
The web app uses the branded components also, so run `sg start` or `sg
start web-standalone`, do a search and see that the file preview link
still exists.
If you want to be an over-achiever, you can edit
`client/branded/src/search-ui/results/StreamingSearchResultsList.tsx`,
changing `hideFilePreviewButton = false,` to `hideFilePreviewButton =
true,` and reload the search results to see that the file preview link
disappears.
2024-06-28 15:06:42 -06:00
Camden Cheek
daae1d18d1
Svelte: add debug view for code intel occurrences (#63475)
This implements the debug view for code intel ranges. Since we're doing
work here, it's very useful to be able scan the info while exploratory
testing and debugging.

Note that this does _not_ use the snapshot API. After #63473, everything
uses occurrences, so rather than rely on another API request, the only
argument to the debug extension is a set of occurrences. This is
particularly nice because it would be very easy to do things like:
- Show the occurrences as calculated from syntax highlighting data
- Show the occurrences before and after we make them non-overlapping
2024-06-28 20:27:33 +00:00
Felix Kling
b25cf26b05
fix(svelte): Reference layout shift while loading data (#63546)
This commit fixes an issue with layout shifting while loading data in
the reference. The class/style was incorrectly applied causing
additional padding to be added while data was loading. This commit fixes
that and

- adds a divider between the last list item and the loader
- changes the default proxy to be S2. Dotcom didn't make sense anymore
now that `pnpm dev:dotcom` does that explicitly.

## Test plan

Manual testing
2024-06-28 21:29:01 +02:00
Ara
141d2e0cc4
Add Support for Counting Tokens for Azure Code and Update in Redis (#63100)
Description:

This PR introduces support for counting tokens within the Azure code and
updating these counts in Redis. The token counting logic is embedded
directly in the Azure code rather than using a standardized point for
all token counting logic.

Reasoning:

• Azure does not currently support obtaining token usage from their
streaming endpoint, unlike OpenAI.
• To enable immediate functionality, the token counting logic is placed
within the Azure code itself.
	•	The implementation supports GPT-4o.

Future Considerations:

• When Azure eventually adds support for token usage from the streaming
endpoint, we will migrate to using Azure’s built-in capabilities.
• This will ensure full utilization of Azure OpenAI features as they
achieve parity with OpenAI.

Changes:

	•	Added token counting logic to the Azure code.
	•	Updated Redis with the token counts.

Testing:

	•	Verified the implementation works with GPT-4o.

Conclusion:

This is a temporary solution to enable token counting in Azure. We will
adapt our approach as Azure enhances its feature set to include token
usage from their streaming endpoint.

## Test plan
Tested locally with debugger
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-28 12:37:53 +00:00
Felix Kling
8c32333608
fix(search): Token decoration in keyword-enabled query input (#63543)
Fixes srch-646

This commit fixes how tokens are decorated in the query input. The
"chip" style needs to have lower presedence than the syntax highlighting
so that it doesn't get split across the individual parts of e.g. a repo
filter.

This commit also removes the activeFilter extension. It was conflicting
a bit with the filter decoration. This should be fine since it wasn't
used for quite a while in the main search input either.

I also noticed an issue with the size of the CodeMirror input in the
saved searches form. I couldn't enter any query actually because the
input was too "narrow". Adding `flex:1` fixes that.


## Test plan

Manual testing.


![2024-06-28_13-12](https://github.com/sourcegraph/sourcegraph/assets/179026/4aff056c-2a18-4a41-9033-94d642c0858b)
2024-06-28 14:30:16 +02:00
Michael Bahr
468a89be5e
feat: remove experimental label from batches merge changesets action (#63542)
Closes SRCH-630

## Test plan

- Manual testing
2024-06-28 11:08:26 +00:00
Felix Kling
d4548b2be5
chore(svelte): Hide cody nav entries and upsell banner when cody isn't enabled (#63463)
Contributes to srch-529

This commit refactors the main navigation and search home page code to
make it more configurable. In particular we now only show navigation
entries for features that are enabled (as determined by
`window.context`) and only show the cody upsell banner when cody is
enabled.

I extended the dev HTML template and .env files to support this.
## Test plan

Manual testing.
2024-06-28 12:23:04 +02:00
Quinn Slack
c6bc1b5181
make Cody and Code Search global navbar items one-click (#63514)
I found it annoying that it took 2 clicks to go to Cody chat: click
**Cody** in the global navbar, then click **Web Chat**. Users rarely
will visit their dashboard, and that's associated with their user
anyway, so it should be under their user. Same 2-click annoyance applies
to going to Code Search.

Moves some other links:

- Contexts, Search Jobs, Code Monitors, Notebooks --> moved to "Tools"
global navbar item
- Cody dashboard --> moved to user nav item (in top right)


![image](https://github.com/sourcegraph/sourcegraph/assets/1976/6b87ad4a-cb8a-4706-8954-f79e588803cd)

![image](https://github.com/sourcegraph/sourcegraph/assets/1976/b971c2f2-5965-4cd9-b8ac-17dc0ff9921d)

![image](https://github.com/sourcegraph/sourcegraph/assets/1976/933865d9-105f-406f-b88e-62e370896cfd)


## Test plan

With minimize nav on and off, and with all states of dotcom and
user-has-Cody-enabled, ensure matches expectations. The expectations are
codified in the tests/

## Changelog

- Code Search and Cody now are one-click links in the global navbar.
Other features are in the new "Tools" menu: search contexts, code
monitors, search jobs, and notebooks. Your Cody dashboard is linked from
your user menu (in the top right).
2024-06-28 02:04:05 -07:00
Camden Cheek
6fd099edda
Chore: refactoring occurrence indexing (#63473)
This is a bit of refactoring as a followup to #63217. The goal is to
unify how we use `Occurrences` so that we can use the same interface for
both syntax highlighting data and occurrence data from the new API. An
additional goal is to encode more of the invariants in the type system
so it's more difficult to use incorrectly.
2024-06-28 02:46:20 +00:00
Camden Cheek
6e57dfec13
Codenav: use new occurrences API for symbol definitions (#63217)
This integrates the new occurrences API into the Svelte webapp. This
fixes a number of issues where the syntax highlighting data is not an
accurate way to determine hoverable tokens. It is currently behind the
setting `experimentalFeatures.enablePreciseOccurrences`
2024-06-28 00:26:17 +00:00
Michael Lin
b572e071bb
cloud: update feature flag warning severity (#63499)
follow up https://github.com/sourcegraph/sourcegraph/pull/63484

got feedback from teammates that it shouldn't be `warning` but `info`

warning usually indicates something is wrong, this is not the case.

<!-- PR description tips:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e
-->

## Test plan

<!-- REQUIRED; info at
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

## Changelog

<!-- OPTIONAL; info at
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c
-->

n/a
2024-06-27 16:38:03 -07:00
Camden Cheek
42990e1c1b
Svelte: rev picker design updates and addition to commits page (#63506)
This cleans up the revision picker design, adds a copy button, and adds
it to the file page.
2024-06-27 22:39:06 +00:00
Quinn Slack
3e283e457e
link to Cody chat on the web from the Cody manage page (#63530)
Improves the Cody PLG management page to have a more prominent link to
Cody Web. Also renames `Ask Cody` to `Cody` for simplicity.

Closes
https://linear.app/sourcegraph/issue/PRIME-396/improve-web-chat-link-on-cody-manage-page

<img width="1226" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/1976/8f74f8f6-c5b8-41f1-abb6-2da5e02a25aa">


## Test plan

View in dotcom mode and ensure section looks nice
2024-06-27 21:27:28 +00:00
Peter Guy
72c00d397a
fix(search): VSCode Search extension: bring back matched lines in search results. (#63524)
Due to changes in the code base, the search extension code when run from
`main` shows file names only in the search results page - no matches in
the files. This is a regression from the behavior in the deployed
extension.

Deployed extension:
<img width="1504" alt="Screenshot 2024-06-27 at 10 04 37"
src="https://github.com/sourcegraph/sourcegraph/assets/129280/edd97903-d03f-4612-98c8-c8f286f0cb3b">

Running from `main`:
<img width="1502" alt="Screenshot 2024-06-27 at 10 11 17"
src="https://github.com/sourcegraph/sourcegraph/assets/129280/d7aefcfe-3a25-4486-9fa6-a5e6bc7c6a8e">

Turns out the reason is because some shared code expects chunk matches,
while the search queries were all returning line matches.

Added support for line matches in the shared code, and then fixed an
issue with the search results display not keeping up with `MatchGroups`.

## Test plan
Build and run locally.

### Build
```
git switch peterguy/vscode-bring-back-matched-lines-in-search-results
cd client/vscode
pnpm run build
```
### Run
- Launch extension in VSCode: open the `Run and Debug` sidebar view in
VS Code, then select `Launch VS Code Extension` from the dropdown menu.
- Run a search using the search bar.
- See that the results contain matched lines in the files and not just a
list of file names. Compare to the currently-deployed extension - the
search results should look generally the same.
2024-06-27 13:24:51 -06:00
Stefan Hengl
09992ad92d
saved searches: use default pattern type (#63487)
This is part of the Keyword GA Project.

Instead of hardcoding the pattern type to "standard" we use the default pattern type. This really only affects highlighting, because users are already forced to explicity state a pattern type by the GraphQL API.

Test plan:
- new unit test
- manual testing:
I tested the following workflows:

Creating a saved search from search results page
Creating a saved search from the user menu
Editing an existing saved search after the default patternType had changed
2024-06-27 16:24:49 +02:00
Quinn Slack
dc478c82dd
chore(ci): remove Percy visual tests (#63515)
These are more frequently erroneous than helpful.

See
https://sourcegraph.slack.com/archives/C04MYFW01NV/p1719209633005499.

This eliminates a source of frustration and flakiness in pull requests
and removes a lot of code and Bazel complexity.

If we want to revive them, we can revert this commit. Note that
`client/web-sveltekit` does not use Percy, and if we want it to, we can
always revert this commit or start over from scratch if that's easier.


<!-- PR description tips:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e
-->

## Test plan

CI

Co-authored-by: Jean-Hadrien Chabran <jean-hadrien.chabran@sourcegraph.com>
2024-06-27 16:20:06 +02:00
Stefan Hengl
cb41db37cb
search: fix regexp toggle if regexp is default (#63489)
I noticed that the regexp toggle doesn't work anymore if `"search.defaultPatternType": "regexp"`. This is related to a recent change #63410.

We also append `patternType:keyword` in that case which I don't think we want, because we have an UI element to indicate that keyword search is active.

The question I don't know how to answer is: What should happen if `regexp` is the default and the user toggles keyword search off. Should we go back to `regexp` or to `standard`?

Test plan:
- new unit test
- manual testing with default pattern type set to "keyword" and "regexp".
2024-06-27 12:50:12 +02:00
Quinn Slack
4767166e1e
remove unused CTAs (#63512)
These CTAs are all inaccessible on dotcom anyway and would never show
up.


## Test plan

Visit pages where CTAs were deleted and ensure they work.
2024-06-27 08:43:47 +00:00
Quinn Slack
7e7de5ffb1
looser eslint rules (#63511)
Turn off 2 low-value eslint rules that add a lot of noise:

- `@typescript-eslint/no-explicit-any` because if you mean to use `any`
then you probably mean to. We still have eslint warnings for `any`
member access, which is indeed riskier.
- `@typescript-eslint/no-non-null-assertion` because if you type `!`
then you mean it.

Both of these have hundreds of warnings in our current codebase, so this
significantly reduces the eslint noise and makes it so that the
higher-value eslint rules are more noticeable.
2024-06-27 08:42:51 +00:00
Quinn Slack
74f030b3ca
misc wording and UI tweaks to search contexts pages (#63513)
## Test plan

Visit search contexts page and ensure it renders as expected.
2024-06-27 01:33:35 -07:00
Quinn Slack
a82afa8a7d
fix Cody nav link for unauthed dotcom users (#63510)
Previously, this took users to
`https://sourcegraph.com/https://sourcegraph.com/cody`, which was
because it used `<Navigate />` incorrectly. Now it correctly takes you
to https://sourcegraph.com/cody.


## Test plan

Test locally in dotcom mode
2024-06-27 07:56:25 +00:00
Quinn Slack
f729863b58
oops, fix Cody Web enablement (#63508)
Added this during testing and forgot to remove it before merging.


## Test plan

n/a
2024-06-26 22:58:58 -07:00
Quinn Slack
0021f95d6c
remove Cody "upsells"—and all Cody links if Cody is disabled (#63430)
At a high level, we don't want to show annoying ads/upsells for Cody
that are not useful. And if Cody is disabled, we don't want to show
*any* links to Cody.

### Detailed desired behavior

- Dotcom
  - Navbar
    - Unauthed: "Cody" single link to /cody (marketing page)
- Authed: "Cody" dropdown with "Dashboard" (/cody/manage) and "Chat"
(/cody/chat)
  - Routes
    - /cody: always the marketing page
- /cody/manage: requires sign-in, shows Cody PLG subscription status for
the user (Free plan is auto-opted-into by default)
    - /cody/chat: requires sign-in
- Enterprise with Cody enabled on instance
  - Navbar
- Cody NOT enabled for current user: "Cody" single link to
/cody/dashboard
- Cody enabled for current user: "Cody" dropdown with "Dashboard"
(/cody/manage) and "Chat" (/cody/chat)
  - Routes
- /cody: this link should not be present anywhere, but redirect to
/cody/dashboard
- /cody/manage: informational page, with editor/web links for
Cody-enabled users and a "contact admin to get access" message for
Cody-disabled users
- /cody/chat: chat for Cody-enabled users, redirect to /cody/manage for
Cody-disabled users
- Enterprise with Cody NOT enabled on instance (`"cody.enabled": false`
in site config)
  - Navbar: no Cody link or dropdown
  - Routes: all Cody routes 404
- All
  - Do not show a Cody upsell on the /search page

This is an example of what we will KEEP for users on instances with Cody
enabled but who do not themselves yet have access to Cody. This is
useful because it informs users how to get access to Cody, and
presumably their site admin wants people to request it who want to use
it.


![image](https://github.com/sourcegraph/sourcegraph/assets/1976/c2adb086-44ec-4240-ad44-95981763fb72)


Fixes
https://linear.app/sourcegraph/issue/SRCH-529/hide-cody-ai-tab-and-cody-upsell-if-cody-is-not-enabled

### Unexpected code changes needed

This ended up being a much bigger change than I expected because I found
error-prone code that needed cleaning up:
    
- Improve how we determine if Cody is enabled in the frontend code.
Previously, we checked the license features in some places,
`cody.enabled` site config in others, and the user's current RBAC
permissions for Cody in yet others. The most error-prone was checking
the license features, since a license may entitle the instance to Cody
but the site admin may still choose to disable it. There were no places
in the frontend code where checking the license's entitlements was
actually correct, so I changed everything to checking either
`window.context.codyEnabledOnInstance` or
`window.context.codyEnabledForCurrentUser`.
- Did the same for `window.context.codeSearchEnabledOnInstance` for
symmetry.
- Removed "helper" functions that just checked 1 or 2 boolean values on
`window.context` related to this, in favor of accessing `window.context`
directly. Globals aren't great, and we should use React context or
something similar, but now that the JSContext has the right fields
(i.e., enabled instead of licensed), it's simpler and there is no need
for helper functions.
- Removed prop drilling of the `licenseFeatures` that was unnecessary
since these values are available in globals and were being set from
globals at some arbitrary point in the React component hierarchy anyway.
- Updated the GlobalNavbar test snapshots.

## Test plan

Run in 3 modes: (1) dotcom mode, (2) `"cody.enabled": false` in site
config, (3) normal `sg start`.

## Changelog

- When Cody is disabled in site config (with `"cody.enabled": false`),
all links and UI elements about Cody are hidden from all users.
Previously, when Cody was disabled, users would see some links informing
them about Cody.
2024-06-27 05:29:54 +00:00
Erik Seliger
83d0f6876c
dotcom: Remove on-demand cloning of repositories (#63321)
Historically, sourcegraph.com has been the only instance. It was
connected to GitHub.com and GitLab.com only.
Configuration should be as simple as possible, and we wanted everyone to
try it on any repo. So public repos were added on-demand when browsed
from these code hosts.

Since, dotcom is no longer the only instance, and this is a special case
that only exists for sourcegraph.com.
This causes a bunch of additional complexity and various extra code
paths that we don't test well enough today.

We want to make dotcom simpler to understand, so we've made the decision
to disable that feature, and instead we will maintain a list of
repositories that we have on the instance.
We already disallowed several repos half a year ago, by restricting size
of repos with few stars heavily.
This is basically just a continuation of that.

In the diff, you'll mostly find deletions. This PR does not do much
other than removing the code paths that were only enabled in dotcom mode
in the repo syncer, and then removes code that became unused as a result
of that.

## Test plan

Ran a dotcom mode instance locally, it did not behave differently than a
regular instance wrt. repo cloning.
We will need to verify during the rollout that we're not suddenly
hitting code paths that don't scale to the dotcom size.

## Changelog

Dotcom no longer clones repos on demand.
2024-06-26 14:53:14 -07:00
Vova Kulikov
94bf178504
Cody Web: Fix Cody page for signed out users (#63498)
The New Cody Web client doesn't work for non-auth users, we should never
render
new Cody web client for signed-out users and show cody landing page
instead.

## Test plan
- Run local instance and sign out 
- Check that Cody Web page shows the welcome landing page
2024-06-26 17:05:21 -03:00
Vova Kulikov
26c872cb77
Fix initial context for Cody Web on the repository page (#63497)
Closes
https://linear.app/sourcegraph/issue/SRCH-620/cody-web-has-incorrect-initial-context-on-blank-repository-page

## Test plan
- Go to the repository root and open Cody Web, it should have only
repository as the initial context
2024-06-26 16:50:25 -03:00
Camden Cheek
aae480a77b
Svelte: improve contrast for file tree guide line (#63495)
Bumped it up to `--secondary`. Also fixed the visual centering against
the new lucide chevrons.

Fixes SRCH-485
2024-06-26 13:03:40 -06:00
Vova Kulikov
781a421d23
Enable new Cody Web by default (#63493)
This PR turns on the new Cody Web by default for everyone. It's still
possible to opt-out to the old Cody Web with `"newCodyWeb": false` in
your experimental features in settings.

I forgot that the dot com instance seeds its global settings and site
configuration from files and
doesn't allow us to override specific settings there; 

## Test plan
- Check that the new Cody Web client is available to you without any
feature flag by default
2024-06-26 15:05:32 -03:00
Felix Kling
6ea958be33
chore(svelte): Upgrade SvelteKit (#63490)
This upgrades SvelteKit for good measure. I think a lot of the fixes are
not relevant to us but
https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%402.5.8
is interesting and makes navigating around in the app after a dev server
start less jarring.

## Test plan

`pnpm dev`, `pnpm build` and `bazel test
//client/web-sveltekit:svelte-check`
2024-06-26 18:52:26 +02:00
Michael Lin
78a8f6be8a
cloud: add feature flags to show no edit warning (#63484)
ref CLO-380

on Cloud, customer changes to feature flags are overridden by our
automation. let's add a warning message to avoid suprises.

## Test plan

![CleanShot 2024-06-25 at 19 56
04](https://github.com/sourcegraph/sourcegraph/assets/8373004/ebe18608-929d-4d92-92e9-188b6637371c)
2024-06-26 16:27:11 +00:00
Vova Kulikov
a61c881e47
[React]: Add initial usage of the new web worker-based cody web chat (#62792)
Part of https://github.com/sourcegraph/sourcegraph/issues/62448
Linear issue
[SRCH-573](https://linear.app/sourcegraph/issue/SRCH-573/integrate-cody-web-package-into-the-sourcegraph-ui)

This is highly experimental usage of the new (not currently merged but
published in NPM `cody-web-experimental`) package

## How to run it 
- (Optional) if you previously linked any local packages make sure they
don't exist in your node_modules anymore, `rm -rf node_modules` in the
root then `pnpm install`
- Run standard `sg start web-standalone`
- Turn on `newCodyWeb: true` in your `experimentalFeatures`

## How to run it locally with prototype PR in Cody repository 

- Open Cody repository on the `vk/integrate-cody-web-chat-2` branch 
- At the root of the repo, run `pnpm install` to make sure you're up to
date with all of the dependencies.
- Go to the web package (`cd web`)
- Build it with `pnpm build`
- Create a global link with `pnpm link --global` (Ignore the warning
message about no binary)
- Open sourcegraph/sourcegraph repository on this PR branch
- Make sure you are in the root of the repo.
- Run `pnpm link --global cody-web-experimental`
- Run `sg start web-standalone` to bundle the web app and launch an
instance that uses S2 for the backend. You'll need to create a login on
S2 that is not federated by GitHub.
- Turn on `newCodyWeb: true` in your `experimentalFeatures`
- Have fun experimenting!

## Test plan
- Check that old version of Cody has got no regressions
2024-06-26 12:13:29 -03:00
Felix Kling
70ba49e46a
chore(svelte): Properly route to revision agnostic pages (#63444)
There are two kinds of repository pages: Those who depend on the
revision possibly present in the URL and those who are not.

This commit re-arranges the routes to better distinguish between these
two types. It also adds a visual indication to the commits that the
history at a specific revision is shown. Additionally it removes the
revision from links to revision agnostic pages.

Overall this should make it clearer to the user when and when not the
revision in the URL is relevant.

 Note: I originally added a redirect for revision agnostic pages that
 would remove the revision if it was present in the URL. I decided to
 not do that for now because that redirect introduces an additional
 history entry which makes it difficult to navigate back.

Closes srch-600


## Test plan

Manual testing.
2024-06-26 12:46:56 +00:00
Stefan Hengl
bc49218e6c
code monitors: respect default pattern type (#63333)
This is part of the Keyword Search GA project (see background below). 

The core change is that we use the default pattern type consistently for
the query input field and preview. Before, we hardcoded `literal` as the
default and used `standard` for previews.

This is does not affect existing code monitors.

Other fixes:
- highlight keyword queries correctly

Background:
- "keyword" will soon be the new default pattern type
- the default pattern type can be overridden in the user/global settings
- query fields in all of our products should respect the default

Test Plan:
- The unit test is currently "skipped" with the following comment
```
// TODO: these tests trigger an error with CodeMirror, complaining about being
// loaded twice, see https://github.com/uiwjs/react-codemirror/issues/506
```
- Manual testing:
- I created several code monitors with and without pattern type and
checked in the DB that the correct pattern type was appended.
- I configured a new default pattern type in my user settings and
verified that the setting changes the default pattern type for code
monitors.

Co-authored-by: Felix Kling <felix@felix-kling.de>
2024-06-26 11:59:42 +02:00
Quinn Slack
eacde544f3
add React key to fragments in code monitoring logs (#63479)
Fixes the "missing key" React warning.


## Test plan

Ensure no console warning
2024-06-26 11:06:54 +02:00
Camden Cheek
732c7c8675
Chore: fix repo stars alignment (#63476)
This is the only one I know of that's left from SRCH-551, so saying this fixes SRCH-551.
2024-06-26 11:03:29 +02:00
Felix Kling
617599b66b
fix(svelte): Preserve selected lines in codehost URL (#63334) 2024-06-26 07:08:09 +02:00
Quinn Slack
7396ee0cce
fix chopped-off tooltips in code monitor query input (#63478)
The tooltips for autocomplete and diagnostics in the code monitor query
editor were being chopped off due to an `overflow: hidden`. Now they
show up.

Before (note the tiny vertical border that is part of the tooltip above
the text):

<img width="402" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/1976/94523c8c-8e4b-4168-8675-8716b25d4b60">



After:
<img width="622" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/1976/9bc4c4f1-ec1c-4172-a4d2-1518bd0bde91">


## Test plan

Hover over a diagnostic at
https://sourcegraph.test:3443/code-monitoring/new and confirm the
tooltip shows.

## Changelog

- Fixed an issue when creating or editing a code monitor that obscured
helpful tooltips in the query editor.
2024-06-26 04:42:04 +00:00
Robert Lin
92c44507f9
feat/dotcom: show subscription UUID in Enterprise Portal format (#63482)
The current "name" thing is not used anywhere for subscriptions - all
internal capabilities and APIs depend use the UUID, and Enterprise
Portal will use the UUID as well.

This change replaces all name/IDs with the UUID, prefixed in Enterprise
Portal format, as we prepare to launch Enterprise Portal in more places
(such as Cody Analytics: https://linear.app/sourcegraph/issue/CORE-101).
This is particularly relevant for Cody Analytics so I can document how
to find the UUID in a way that isn't "get it from the URL".

It's not super beautiful in the subscriptions list, but as we progress
on the migration to Enterprise Portal I plan to replace the ID in the
list with "Display name", which is a first-class citizen in Enterprise
Portal.

## Test plan

<img width="953" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/23356519/30c4ae6b-e50b-485c-a2c8-e4ab6445fc01">


![image](https://github.com/sourcegraph/sourcegraph/assets/23356519/cca8e6d1-2e20-4954-8f72-7694ad1d8bfa)
2024-06-25 17:26:26 -07:00
Quinn Slack
b79cf5b03b
remove beta labels for code monitoring Slack notifs & logs (#63480)
These features have passed the steps needed to take them out of beta.
They have been feature-complete and in widespread use for more than a
year with no outstanding issues, and they work well.

-
https://linear.app/sourcegraph/project/slack-notifications-ga-code-monitoring-7dbb9fa13f62
-
https://linear.app/sourcegraph/issue/SRCH-533/remove-beta-label-from-code-monitor-logs-tab

Closes
https://linear.app/sourcegraph/issue/SRCH-533/remove-beta-label-from-code-monitor-logs-tab



## Test plan

Create a new code monitor with a Slack notif. Ensure it works e2e by
pushing a commit that matches and watching it show up in Slack
(https://sourcegraph.slack.com/archives/C68386Z5Z/p1719357942294309).


## Changelog

- Code monitoring Slack notifications, previously in beta, are now GA.
This feature lets you post matching code changes to a Slack channel.
- Code monitoring logs, previously in beta, are now GA. This feature
lets you see the status of and activity related to code monitors to
troubleshoot issues with finding results and performing configured
actions.
2024-06-25 17:11:57 -07:00
Julie Tibshirani
37b6ded5f1
Search: always respect default pattern type (#63410)
Previously, enabling then disabling the regexp toggle would always set the
patterntype to `keyword`, even when the user has set
`search.defaultPatternType: standard`. Now, toggles always revert back to the
default pattern type.

To support this, this PR adds `defaultPatternType` to the nav bar query state,
which is updated every time there's a settings update. Having
`defaultPatternType` available also lets us fix another bug: when
the default pattern type has been set to `standard` we no longer awkwardly show
`patterntype: standard` in the search bar. (This confusing behavior was
introduced recently in #63326.)

**Overall, this PR set us up to remove `experimentalFeatures.keywordSearch`,
along with the keyword search toggle.** To opt out of keyword search, users can
just set `search.defaultPatternType`, and have it work everywhere.
2024-06-25 09:43:14 -07:00
Taras Yemets
dbc8d5b68a
fix(plg): ensure invite flow is enabled only for embedded UI (#63466)
Makes the invite flow on "/cody/manage" page dependent on the
`dotcom.codyProConfig.useEmbeddedUI` site config param.

Previously we didn't have a check for this site config param on this
page (to be precise, it's predecessor, see
https://github.com/sourcegraph/sourcegraph/pull/63442).

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->

| `useEmbeddedUI` | Plan |  Role  | Screenshot |
| -- | -- | -- | -- |
| `false` | admin | Pro |<img width="1483" alt="Screenshot 2024-06-25 at
13 02 18"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/8d5687df-43a9-4dbe-b82c-ecc60696da0f">|
| `false` | member | Pro |<img width="1483" alt="Screenshot 2024-06-25
at 13 14 17"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/cd53550c-5d51-4830-834c-1c233d13e72a">|
| `false` | n/a | Free |<img width="1483" alt="Screenshot 2024-06-25 at
13 17 15"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/f18720d4-a000-4bfb-b948-bbda29e49911">|
| `true` | admin | Pro |<img width="1483" alt="Screenshot 2024-06-25 at
13 30 03"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/618675d5-13b9-44b8-be50-4c506b46b702">|
| `true` | member | Pro |<img width="1483" alt="Screenshot 2024-06-25 at
13 25 24"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/ccac77e8-c7ca-44a5-b033-3c6dad8e5d70">|
| `true` | n/a | Free |<img width="1483" alt="Screenshot 2024-06-25 at
13 31 41"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/a7373ae9-a440-4282-805f-018d703cf3b0">|


## Test plan
- Tested manually (screenshots attached):
  - Run Sourcegraph instance in dotcom mode
- Tweak `dotcom.codyProConfig.useEmbeddedUI` site config param, log in
with users with different team roles (member/admin) and check results
with the table above.
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->




<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-25 15:33:53 +00:00
Quinn Slack
6c861d1446
add back /post-sign-up (#63456)
This is needed for the signup flow to work.


## Test plan

Manually test
2024-06-24 16:09:39 -07:00
Quinn Slack
4d69b06d4d
remove extraneous Cody onboarding steps (#63373)
- Remove the "personal or work" step
- Remove the "do you want us to call you?" step
- Cleaner design of the Cody dashboard
- Improve some wording
- Remove CodySurveyToast (unused) and user.CompletedPostSignup. These
have not been used in many months. On Amplitude, the relevant events
have no data.

Fix
https://linear.app/sourcegraph/issue/PRIME-375/remove-personal-or-work-survey-signup-step

<img width="2032" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/1976/ef100e60-71b5-479b-ac63-2450cdad0220">


## Test plan

n/a
2024-06-24 20:37:39 +00:00
Dan Adler
5413fd1fd4
fix(analytics): fix broken v1 codeintel event logging (#63449)
Codeintel v1 telemetry/event logging was broken in
https://github.com/sourcegraph/sourcegraph/pull/62586 due to the lack of
parens around a ternary operator. This simply fixes that issue.

## Test plan

CI

## Changelog

Co-authored-by: Dan Adler <5589410+dadlerj@users.noreply.github.com>
2024-06-24 20:35:28 +00:00
Dan Adler
e8742bcf9c
Add language ID to private metadata for v2 codeintel events (for in p… (#63421)
…orduct analytics)

As part of the v1 -> v2 telemetry transition, in product analytics
("IPA") aka admin analytics pages need to all be updated as well.

The codeintel IPA page shows codeintel actions by language. We aren't
capturing this metadata for v2 events. This PR adds it to private
metadata (since this is only needed on the instance itself).


## Test plan

CI

---------

Co-authored-by: Dan Adler <5589410+dadlerj@users.noreply.github.com>
Co-authored-by: Aditya Kalia <32119652+akalia25@users.noreply.github.com>
2024-06-24 11:26:26 -07:00
Quinn Slack
c3ce26f308
remove Code Search upsell from Cody page (#63440)
The general principle here is that we want to remove non-functional
upsells in our product. They add clutter and complexity and sometimes
annoy admins and users. As we unify the products, we will be adding a
lot more functional CTAs in the product to the same effect.

## Test plan

n/a; removal only
2024-06-24 08:39:15 -07:00
Quinn Slack
673f9e87dd
remove old and unused Cody search page (#63439)
This page (at `/cody/search`) let you type in a natural-language
description of what to search for, and then it used an LLM to rewrite
that to Sourcegraph search query syntax. This was enabled using the
`cody-web-search` feature flag, which has been disabled on dotcom for a
while and was never documented or shared with customers, so it's safe to
remove.

It was a cool idea, but we decided to focus on making Cody's search in
the editor better, and we haven't seriously improved this for ~12
months.

## Test plan

n/a; removed feature
2024-06-24 08:39:02 -07:00
Quinn Slack
6f9b7c5d80
remove unused CODY_APP esbuild config and entrypoint (#63438)
Cody App was removed in Dec 2023, and the `app/main.tsx` file has not
existed for a long time.

## Test plan

n/a
2024-06-24 08:38:40 -07:00
Quinn Slack
896819f811
remove disabled web UI code for embeddings (#63432)
Repository embeddings were removed in Feb 2024 as part of the Cody
Enterprise GA. They have not been used since. Some Sourcegraph instances
still running an older pre-GA version may still rely on Cody Gateway
(deployed by us) for embeddings generation, but they do not rely on this
UI code at all, so it is safe to remove.

No changelog entry needed since this code's UI has been disabled since
Feb 2024.

## Test plan

Existing tests suffice since this is removing functionality.
2024-06-24 08:38:09 -07:00
Felix Kling
843f703958
fix(svelte): Properly rounded corner for file view hover cards (#63446)
Fixes srch-130

## Test plan

Visual inspection
2024-06-24 15:33:05 +00:00
Taras Yemets
345a06abb1
chore(plg): add useEmbeddedUI site config param (#63442)
Adds `dotcom.codyProConfig.useEmbeddedUI` site config param. 
This param defines whether the Cody Pro subscription and team management
UI should be served from the connected instance running in the dotcom
mode. The default value is `false`. This change allows us to enable the
SSC proxy on the instance without enabling the new embedded Cody Pro UI.

Previously whether the embedded Cody Pro UI is enabled was defined by
the `dotcom.codyProConfig` being set, which prevented us from enabling
the SSC proxy without enabling the embedded UI:
> Whether the SSC proxy is enabled is [defined based on
`dotcom.codyProConfig`](41fb56d619/cmd/frontend/internal/ssc/ssc_proxy.go (L227-L231))
being set in the site config. This value is also partially
[propagated](41fb56d619/cmd/frontend/internal/app/jscontext/jscontext.go (L481))
to the frontend via jscontext. And the frontend [uses this
value](41fb56d619/client/web/src/cody/util.ts (L8-L18))
to define whether to use new embedded UI or not.

For more details see [this Slack
thread](https://sourcegraph.slack.com/archives/C05PC7AKFQV/p1719010292837099?thread_ts=1719000927.962429&cid=C05PC7AKFQV).

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- CI
- Tested manually:
  - Run Sourcegraoh instance locally in dotcom mode
  - Set `dotcom.codyProConfig` in the site config
- Type `context. frontendCodyProConfig` that it returns the [correct
values from the site
config](184da4ce4a/cmd/frontend/internal/app/jscontext/jscontext.go (L711-L715))
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-24 07:49:58 -07:00
Quinn Slack
1ff74b0f27
"Cody" in navbar not "Cody AI" (#63429)
The name of the product is "Cody", not "Cody AI". Also, "AI" just looks
dumb and hype-y.


## Test plan

View the navbar and ensure it reads "Cody" not "Cody AI".

## Changelog

- In the navbar, Cody is now just "Cody" not "Cody AI".
2024-06-22 23:58:20 -06:00
Taras Yemets
dfabe647ba
Revert "fix(plg): Cody Pro routes conditions & add links to the user nav dropdown (#63378) (#63424)
This reverts commit 5cf81e0210
(https://github.com/sourcegraph/sourcegraph/pull/63378).

This PR intorduced a call to the SSC backend via proxy on the
Sourcegraph backend (see `cmd/frontend/internal/ssc/ssc_proxy.go`). It
appeared that proxy is not properly configured on dotcom, causing
requests to fail with 503 "proxy not configured" errors.
Reverting this PR until we fix the configuration.

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- CI
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-22 00:58:32 +03:00
Bolaji Olajide
e707101ebd
chore(batch-changes): remove beta badge from batch changes (#63423) 2024-06-21 21:15:59 +00:00
Felix Kling
ce7531f060
feat(svelte): Make fuzzy finder matching more reliable (#63397)
Currently the fuzzy finder filters and ranks results received from the
server locally. This was done to improve performance since local
filtering is much faster.
However it can introduce inconsistencies (as reported) because the local
filtering logic works differently that the one on the server. That means
the shown results is depedent on on the local cache, which is not
obvious to the user.

This commit removes the client side filtering and ranking and instead
relies only on the server for this. This makes things more consistent
and predictable, at the expense of being a little slower. However it
still feels quite fast to me.

Note that I didn't implement some aspects due to the limitations of the
GraphQL-based search API:
- No match highlighting. Personally I didn't miss is it so far. I don't
know if the highlighting actually provides a lot of value.
- No total result count. It seems since we are adding `count:50`, the
server cannot actually give use an approximate total count. But we
should probably still convey somehow that we are limiting results to the
top 50.

Because we don't have locally cached data anymore that can be shown
immediately I decided to increase the throttle time to prevent the
result list flickering in and out when typing with a moderate speed.

This change enables three additional features: 'search all' mode, multi
word search and regex search via `/.../` literals (just like for normal
search queries). This is consistent with our existing search query
language (currently regex literals are not syntax highlighted, but we
should consider doing that).

Fixes srch-139
Fixes srch-133
Fixes srch-134
Fixes srch-543



https://github.com/sourcegraph/sourcegraph/assets/179026/81e24345-9e06-4df6-bb4a-8a55e433bfd1


## Test plan

Manual testing.

## Changelog

- Add 'search all' tab
- Support multi-word search
- Support regular expression patterns
- Fix matching reliability
2024-06-21 22:23:48 +02:00
Jean-Hadrien Chabran
19a0c73030
fix(client): restore paths for extension bundles (#63402)
When moving to ESBuild, the filenames for extension bundles changed,
which led to broken bitbucket plugins for example.

See
[discussion](https://sourcegraph.slack.com/archives/C04MYFW01NV/p1718902092493689)


## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

Inspected the relevant target to see the paths in their proper location.


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-21 16:12:34 +02:00
Taras Yemets
2c2ec726ef
feat(plg): remove seats from subscription (#63408)
Closes https://github.com/sourcegraph/sourcegraph/issues/63234

[Design](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=5556-13856&t=f13ek1ZSgoUdrH6z-0)

Adds a button to remove the remaining invites from a subscription. 


https://github.com/sourcegraph/sourcegraph/assets/25318659/679e19dd-0e0e-4561-8ac1-af1b6979ee73

**Known deviation from design (cc: @rrhyne)**

The “Remove User” success message and the “Remove Seats from
Subscription” alerts are positioned differently than in the design. The
“Remove User” banner, along with other user and invite list alerts, is
placed above the users list, below the page title or the invites textbox
if rendered. The “Remove Seats from Subscription” banner, along with
other invite textbox alerts, is located above the invites textbox
instead of above the page title and all the page content. These issues
will be addressed in follow-up PRs, as we need to refactor the existing
Team Members page layout.
Created an issue to address it:
- https://github.com/sourcegraph/sourcegraph/issues/63411






<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- Run a Sourcegraph instance in dotcom mode
- Sign in as a team admin
- Ensure there are free seats on your team (invites remaining)
- Ensure "Remove invites from plan" button is rendered
- Check the number of invites remaining
- Click the button
- Ensure the subscription has been updated and now the max seats reduced
by the number of remaining invites
- Ensure the success banner is rendered

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-21 02:35:58 +03:00
Bolaji Olajide
c437c21ba6
chore(batch-changes): remove visibility options from create batch changes page (#63393) 2024-06-20 17:23:21 -05:00
Taiyab Raja
9aa5cb850e
Svelte: Make the byline in the fuzzy finder items bigger (#63398)
Tiny change to increase font-size of byline on the items in the fuzzy
finder.

## Before
<img width="1304" alt="CleanShot 2024-06-20 at 18 19 30@2x"
src="https://github.com/sourcegraph/sourcegraph/assets/5337876/8af80041-d64a-4cae-b717-a807b37081e6">

## After 
<img width="1337" alt="CleanShot 2024-06-20 at 18 20 53@2x"
src="https://github.com/sourcegraph/sourcegraph/assets/5337876/53725e1e-2ebd-4b2c-be4d-ca9fa7fb00cb">


## Test plan
Manually tested locally.
2024-06-20 20:37:59 +01:00
Taras Yemets
18f42a7873
feat(plg): require confirmation before removing user or revoking admin (#63388)
Closes https://github.com/sourcegraph/sourcegraph/issues/63240

Adds a confirmation modal before revoking admin or removing user.

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->








<img width="549" alt="Screenshot 2024-06-20 at 19 50 28"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/361bce61-b2c3-42da-8d3c-5389a7ba9bd2">
<img width="549" alt="Screenshot 2024-06-20 at 19 50 36"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/f0bbc9c7-2097-46af-a290-74551d99896e">

## Test plan

- Run Sourcegraph instance in dotcom mode
  - Sign in as Cody Pro team site admin
  - Navigate to "/cody/team/manage" page
  - Click on remove button next to the team member
    - Ensure the confirmation modal is visible
- Ensure clicking the cancel button closes the confirmation modal and
user is not removed
- Ensure clicking the confirm button removes the user and closes the
confirmation modal
  - Click on the revoke admin button next to the team admin
    - Repeat steps for the user removal

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-20 17:00:52 +00:00
Felix Kling
b05bd5bb16
fix(svelte): Open correct file from preview panel line number (#63309)
Fixes srch-553

This commit changes the "selectline" handler to open the correct file
when the file view is embedded.


## Test plan

Manual testing. Open reference panel, click on reference to open preview
panel, click on line number in review panel.
2024-06-20 17:44:32 +02:00
Varun Gandhi
0505269d54
chore: Bump go-enry and Zoekt to handle new languages (#63281)
- Updates enry to include languages from Linguist v7.29.0 such as Mojo etc.
- Updates auto-complete filters in frontend code.
- Updates Zoekt to pick up newer version with bumped enry dep.
- Updates language extension overrides to avoid ambiguity for `.json` and `.yml`.
- Updates snapshot tests.
2024-06-20 22:19:39 +08:00
Taras Yemets
5cf81e0210
fix(plg): Cody Pro routes conditions & add links to the user nav dropdown (#63378)
Closes https://github.com/sourcegraph/sourcegraph/issues/63264

1. Adds Cody Pro section to the user nav dropdown on dotcom:
- team admins have links to "cody/subscription/manage" and
"cody/team/manage" pages
   - team members have only link only to the "cody/team/manage" page
2. Makes subscription management page only available for team admins. If
team members try to navigate this page by changing the URL, they will be
redirected to the "/cody/manage" page.
- Makes "Manage subscription" link on the "/cody/manage" available only
for the team admins (previously - any Pro user)
3. Lifts `QueryClientProvider` (wrapper around react-query
`ClientProvider` higher in the component tree so that Cody Pro API query
and mutations can be used not only on the Cody Pro routes.


[Design](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=5351-19126&t=LfNQR7vUCJhlNvyT-4)

| Role | Screenshot |
|--|--|
|Admin|<img width="1605" alt="Screenshot 2024-06-20 at 12 57 13"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/e7b995fd-4322-4f7f-86bb-c7027cacd644"><img
width="1605" alt="Screenshot 2024-06-20 at 13 10 28"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/84be111c-76e2-4b14-9b73-ebdd5f8cbb9a">|
|Member|<img width="1605" alt="Screenshot 2024-06-20 at 12 56 50"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/aefd8b3b-29fe-4957-87ee-b493eb489922"><img
width="1605" alt="Screenshot 2024-06-20 at 13 09 51"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/8209e7a0-4deb-4681-9f6b-3cfde8110842">|




<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- Start Sourcegraph instance in dotcom mode
  - sign in as a Cody Pro team admin 
- ensure that "Manage subscription" and "Manage team" links are present
in the user nav dropdown
    - ensure "/cody/manage" page has "Manage subscription" link
  - sign in as a Cody Pro team member (not admin)
    - ensure "Manage team" link is present in the user nav dropdown
    - navigate to "/cody/subscription/manage/ page by changing the URL
    - ensure you've been redirected to the "/cody/manage" page
    - ensure "/cody/manage" page doesn't have "Manage subscription" link
- start Sourcegraph in the enterprise mode
  - ensure the mentioned links are not rendered
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-20 11:12:19 +00:00
David Veszelovszki
625e188512
plg(feat): Make page headers the same style (#63380)
**Note:** This PR also makes sure that we use `CodyProRoutes` everywhere
for URLs.
2024-06-20 10:50:33 +00:00
David Veszelovszki
2a02d7c88b
Improve InviteUsers interface (#63383)
Based on @taras-yemets's
[feedback](https://github.com/sourcegraph/sourcegraph/pull/63375#discussion_r1647346730)
on https://github.com/sourcegraph/sourcegraph/pull/63375

## Test plan

Just a refactor
2024-06-20 12:42:53 +02:00
David Veszelovszki
03179a757e
feat(plg): Tweak invite co-workers flow (#63374) 2024-06-20 10:28:36 +00:00
David Veszelovszki
345f6b94a0
feat(plg): Invite users on Cody Dashboard (#63375) 2024-06-20 12:15:00 +02:00
Felix Kling
3b7919501a
chore(svelte): Update fuzzy finder designs (#63354)
Closes srch-458

This implements the new fuzzy finder design, specifically:

- Backdrop and dropshadow
- Border radius
- Tab header (affects all tab headers)
- Options

Note 1: Some aspects of the options UI (such as how paths are rendered
and highlighted), and the "footer" depend on how the highlighted parts
are computed. This will change when the local matching and ranking logic
is removed and will be updated when that happens.

Note 2: The symbol icon coloring was broken by #63288 and will be fixed
in a separate PR.

## Test plan

Manual testing
2024-06-20 08:28:29 +00:00
Julie Tibshirani
5630eef9e9
Search: surface pattern type in query input (#63326)
We plan to remove the 'Keyword Search' toggle as part of bringing the feature
to GA. Once the toggle is removed, the search UX will only represent `keyword`
(the default pattern type) and `regexp` (through the regex toggle), with no
visual indication for other pattern types. So if a user clicks on a link using
`patterntype:standard`, the search will just behave differently, without any
indication in the UX as to why.

This PR surfaces the `patterntype` filter in the search bar whenever it's not
`keyword` or `regexp`. That way, users can see an old pattern type is being
used and understand why the search behavior may be different.

Relates to SPLF-68
2024-06-19 14:24:10 -07:00
Felix Kling
15ea951e0d
chore(svelte): Simplify development for dotcom (#63341)
Whether or not the app is in "dotcom mode" is determined by
`window.context.sourcegraphDotComMode`. In development we use a stub
`window.context` object defined in `app.html`.

This commit extends that object to set `sourcegraphDotComMode` depending
on an environment varible. The environment variable is set by using vite
modes (https://vitejs.dev/guide/env-and-mode.html).

The whole setup can be started with `pnpm dev:dotcom`.


## Test plan

Ran `pnpm dev:dotcom` and saw the dotcom specific header and footer.
2024-06-19 22:55:01 +02:00
Camden Cheek
4087e1a844
Svelte: repo header followups (#63319)
Two followups from implementing the repo menu:
1) Remove the rounded corners from the trigger button to match the rest
of the header
2) Add an external link icon to the code host link
2024-06-19 14:02:55 -06:00
Rob Rhyne
d4948d25f6
Cody pro icon was squashed in the upgrade banner (#63356) 2024-06-19 19:29:38 +00:00
Felix Kling
2bdcc36ef7
fix(svelte): Use correct symbol icon color (#63355)
Fixes srch-601

## Test plan

Visual inspection
2024-06-19 19:26:41 +00:00
David Veszelovszki
1a038db04d
feat(plg): Update Cody Pro badge deck (#63352) 2024-06-19 20:47:12 +02:00
Peter Guy
5ee5e8817b
fix(search): VSCode Search extension: remove auth provider (#63262)
VSCode extensions can use authentication providers to enable
authentication actions from the Accounts menu, and to allow for
federated authentication. The Sourcegraph Search extension needs neither
of those - it can meet all of its authentication needs with the existing
actions in is side panel.

On top of that, the authentication provider isn't implemented quite
correctly, which leads to issues like #43608.

This PR removes the authentication provider.

It retains all of the expected behavior of the extension: the user can
still authenticate against sourcegraph.com or private instances using an
access token, and log out.

## Test plan

### First
Build and run locally.
```
git switch peterguy/vscode-remove-auth-provider
cd client/vscode
pnpm run build
```
### Then
- Launch extension in VSCode: open the `Run and Debug` sidebar view in
VS Code, then select `Launch VS Code Extension` from the dropdown menu.
- Note that the Accounts icon does not display a "1" badge and "Sign in
with SOURCEGRAPH_AUTH" is not present in the menu.
- Click on `Have an account?` to open the login dialog.
- Enter an access token and the URL of the Sourcegraph instance to which
you would like to connect.
- Click `Authenticate account`.
- Check the Accounts icon and menu - should not be anything there that's
a result of Sourcegraph Search.
- In the Help and Feedback section, click your username to open the
logout panel, then log out.
- Note again, the lack of modifications to the Accounts icon and menu
from the Sourcegraph Search extension.

## Changelog

- Remove interaction between the Sourcegraph Search extension and the
Accounts menu.
2024-06-19 11:23:10 -07:00
Jean-Hadrien Chabran
c521d988ac
chore(ci): mark web-sveltekit:e2e_test as flaky (#63351)
Marks the `web-sveltekit:e2e_test` as flaky (tries them up to three
times). It just failed main on this build
db7a268c34

## Test plan

ci

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-19 17:44:09 +00:00
David Veszelovszki
76a1c65d8b
feat(plg): Use react-query for team management (#63267) 2024-06-19 19:05:14 +02:00
Camden Cheek
db7a268c34
Chore: remove search console (#63322)
The search console page is broken, is not used or maintained, and is
only referenced by a series of blog posts years ago. We have product
support to remove it.
2024-06-19 11:05:03 -06:00
David Veszelovszki
611dcfa806
feat(plg): Add seats (#63227) 2024-06-19 19:04:00 +02:00
Felix Kling
8b5eec2301
fix(svelte): Data/code preloading doesn't work when using panels (#63339)
Fixes srch-507

The panels code prevents event propagation of mouse move events, which
in turn seems to prevent SvelteKit from its own preloading logic.

Looking at the event handlers it seems they are global only (per
document), so I don't think that stopping the propagation is necessary
for the panel itself to work. However, I think it makes sense to stop
any of default event behavior when the mouse is currently pressed, since
that means the user is currently dragging a resize handler. Would love
to get @vovakulikov's confirmation that my understanding is correct.

## Test plan

Manual testing. Changing the size of a panel (e.g. repo page) seems to
work as expected. Hovering over a file tree entry preloads data and code
now, as visible in the network tab.
2024-06-19 16:33:42 +00:00
Felix Kling
29e07b7f6a
fix(svelte): Properly scope global CSS selector (#63332)
The tags page contains a `:global` selector at the root level, which
affects all elements that match the selector, even those not part of the
page.
`:global` selectors always need to be scoped one way or the other.

## Test plan

Code inspection, trivial change.
2024-06-19 17:38:21 +02:00
Taras Yemets
e617ca4c76
chore(plg): migrate invoices list to react-query (#63343) 2024-06-19 17:49:08 +03:00
Felix Kling
ec3b6b14a9
chore(svelte): Remove stub logger (#63342)
We've recently added v2 telemetry support and should not use the stub
logger anymore.

## Test plan

Code inspection.
2024-06-19 13:54:31 +00:00
Felix Kling
399525b716
fix(svelte): History suggestions should show immediately when clicking the history button (#63335)
Fixes srch-545

We are hiding suggestions until the user has interacted with the input
(e.g. by clicking or typing), but, as it is not, it does not include
clicking on the history button.

This commit changes that.


## Test plan

Manual testing. Clicking the history button without having interacted
with the search input in any other way will now show history suggestions
and focus in the input.
2024-06-19 11:54:46 +00:00
David Veszelovszki
0e3a85f80e
feat(plg): Apply designs to Cody Pro pages (#63244) 2024-06-19 10:58:46 +02:00
Camden Cheek
f9cae73b3f
Minor: update license wording (#63318)
In response to some customer feedback that multiple users thought this
meant their user's license was expiring, this updates the wording to
clarify that it's the sourcegraph instance license that's expiring.
2024-06-18 14:25:49 -06:00
Felix Kling
29aaa71449
fix(svelte): Fix reference panel loading/error state (#63316)
Contributes to srch-578

Currently we keep showing the loading indicator even if no references
have been found. This commit moves the info messages into the layout
because the layout has information we need to properly distinguish the
different states.

I think more refactoring is necessary to make this API better but that
will be done as part of adding search-based code intel support.


## Test plan

Manual testing.
2024-06-18 17:55:37 +02:00
Felix Kling
978cf37f48
fix(svelte): Reference panel width (#63310)
Fixes srch-584

When the reference panel preview opens, the bottom panel extends beyond
its boundaries and ist partially hidden. Allowing it to shrink past it's
content width fixes it.

| Before | Header |
|--------|--------|
|
![2024-06-18_11-22](https://github.com/sourcegraph/sourcegraph/assets/179026/33224c07-946e-4662-bba3-1ce5cf35d834)|
![2024-06-18_11-23](https://github.com/sourcegraph/sourcegraph/assets/179026/3d976506-23e4-4e53-8c8f-e82d189960d9)
|

## Test plan

Manual testing
2024-06-18 16:03:46 +02:00
Varun Gandhi
3437f8253d
chore: Centralize languages package as source-of-truth (#63292)
This patch does a few things:

- Adds `go-enry` packages to depguard, so that people do not
  accidentally use enry APIs instead of the corresponding APIs
  in the `languages` package.
- Adds more tests for different functions in the languages package
  to ensure mutual consistency in how language<->extension mappings
  are handled.
- Adds tests for enry upgrades
- Adds comments with IDs so that related parts in the code can be
   pieced together easily
2024-06-18 13:10:24 +00:00
Erik Seliger
3e3ef6e8fa
webhooks: Add support for secrets for Bitbucket Cloud (#63198)
We didn't support secrets for bitbucket cloud so far, but the code host
does support them. They use the same mechanism as Bitbucket and GitHub
so that was easy to add.

Closes SRC-393

Test plan:

Set up a webhook locally and tested that with a wrong secret it fails,
and with the correct secret it passes. Also wrote a test.
2024-06-18 11:54:01 +02:00
Taras Yemets
9b88b93f2a
feat(plg): remove accept invite page (#63290)
Removes "/cody/invites/accept" page.

Invite processing is handled on the "/cody/manage" page and
"/cody/invites/accept" is used only to redirect to the former.

Backend counterpart:
https://github.com/sourcegraph/self-serve-cody/pull/886

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- Tested manually
- checkout branch
fromhttps://github.com/sourcegraph/self-serve-cody/pull/886 and run SSC
backend locally
  - run Sourcegraoh instance in dotcom mode locally
  - log in as a Cody Pro team admin and send an invite to another user
  - log in as an invited user and follow the link from the email
- ensure link navigates to the "/cody/manage/" page and is hanled as
expected (see test plan from
https://github.com/sourcegraph/sourcegraph/pull/63231)
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-18 12:10:21 +03:00
Matthew Manela
92b8ffb8e1
fix(Source): Fix documentation URLs for code hosts help pages (#63274)
It seems many of our doc links for code hosts are broken in production
due to a url changed from external_services to code_hosts. I did a find
an replace to update all the ones I could find.
2024-06-17 14:32:46 -04:00
Camden Cheek
34368c1dda
Svelte: fix sidebar icon alignment (#63296)
This fixes the alignment of the icons in the dynamic filters sidebar by
mvoing the icon out of the `label` span and directly under the section
item flexbox. I did this by creating an `icon` slot, which also allowed
me to simplify a bunch of other complex slot interactions.
2024-06-17 11:49:15 -06:00
Felix Kling
f716d7aa11
fix(svelte): Fix icon color in search sidebar (#63288) 2024-06-17 18:45:11 +02:00
Taras Yemets
02e9afcbdd
fix(plg): banner styles (#63287)
Adresses [UI
feedback](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=5472-12492&t=ndgEZFI57dVTIBpo-4)
on https://github.com/sourcegraph/sourcegraph/pull/63231

|Description|Before|After|
|--|--|--|
| Change dismiss button variant from "secondary" to "link" |<img
width="1516" alt="Screenshot 2024-06-14 at 14 34 30"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/d6b53dc4-c7df-45eb-a743-9baddfdd8aa3">|<img
width="1170" alt="Screenshot 2024-06-17 at 12 35 53"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/6778a4bf-9a03-4c3b-a83c-57777859b7f1">|
| Fix banner content alignment |<img width="1516" alt="Screenshot
2024-06-14 at 14 35 41"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/eaa871ce-acd3-4a7e-a25c-74011a42af58"><img
width="1516" alt="Screenshot 2024-06-14 at 14 38 42"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/1382e5a0-4375-4002-93a4-ec25d354317f">|<img
width="1165" alt="Screenshot 2024-06-17 at 12 31 14"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/532930ff-8471-46d8-83c0-f2bbeb1a8bcd">|






<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- Tested manually (screenshots attached)
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-17 16:27:06 +03:00
Felix Kling
6019de52e2
fix(search): Better diagnostic message for invalid and incomplete select: filter value (#63266) 2024-06-15 10:06:49 +02:00
Jean-Hadrien Chabran
1975c67f06
fix(ci): remove broken glob (#63277)
A glob that doesn't match any files got introduced in
4077b3ec22 (diff-f7c1ab1acb5e753bccdd4b092b0098fa58855899e8764b68829ada2ba9cea760R147)
which appears to confuse Gazelle, leading to `sg bazel configure` not
updating ts files.

Fixes https://github.com/sourcegraph/devx-support/issues/1029


## Test plan

Locally tested: 

1. Dropped the offending glob 
2. rm'ed `client/web/src/cody/subscription/subscriptionSummary.ts` 
3. `sg bazel configure` 
4. Observed the build file being updated accordingly. 

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
5. Add bullet list items for each additional detail you want to cover
(see example below)
6. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
7. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-14 21:50:22 +00:00
Felix Kling
32b119ee0c
fix(search): Improve syntax highlighting of search history entries (#63271)
Currently queries are assumed to be 'literal', but in the current apps
we mostly use 'keyword' and 'standard'. Ideally we could pass the
pattern type that was used for each history entry, but we don't have
that information and cannot pass it easily.
Defaulting to the 'standard' or 'keyword' type is the next best option
to ensure that regex literal in the query are properly highlighted.

I defaulted to 'standard' in the React app because it's still possible
to opt out of keyword search.
2024-06-14 13:11:54 -06:00
Felix Kling
bfe3e18927
fix(search): Ignore *lock keys for keyboard shortcut matching (#63272) 2024-06-14 20:34:00 +02:00
Camden Cheek
7228b4958d
Svelte: add repo header dropdown menu (#63257)
Adds a dropdown menu when clicking the repo name for common repo-level actions.
2024-06-14 18:11:20 +00:00
Taras Yemets
fadcaa264f
PLG: encode URL search params (#63275)
Fixes bug intorduced in
https://github.com/sourcegraph/sourcegraph/pull/63231

Encode the URL search params added to `returnTo` search param value.

Previously the search param value hasn't been encoded resulting in URLs
with broken search params , e.g.
*"/sign-in?returnTo=/cody/manage?teamID=1&inviteID=2"* (note the second
"?" making the search params invalid).



<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan
- CI
- Tested manually:
- Make `signOutAndRedirectToSignIn` available in the window object, e.g.
`window.signOutAndRedirectToSignIn = signOutAndRedirectToSignIn` in the
*client/web/src/cody/management/api/react-query/callCodyProApi.ts*
- On "/cody/manage" page (any page works actually) ensure that a few
search params are added to the URL
   - call `signOutAndRedirectToSignIn` in the browser console
- ensure you have been sign out, signed back in and the search params
are still in the URL
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
3. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
4. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-14 20:40:06 +03:00
Taras Yemets
50471a67b1
PLG: Allow users who are already on a team accept invites (#63231)
Closes https://github.com/sourcegraph/sourcegraph/issues/63078
Part of https://github.com/sourcegraph/self-serve-cody/issues/804 (see
also its backend counterpart
https://github.com/sourcegraph/self-serve-cody/pull/858)

[Figma](https://www.figma.com/design/FMSdn1oKccJRHQPgf7053o/Cody-PLG-GA?node-id=4042-4927&t=Ob2UbemEkft4ofJZ-0)

### Summary

1. Moved the accept invite UI to the "/cody/manage" page.
2. Handled cases where the invited user is already a Cody Pro user.
3. Fixed styles in the CodyAlert component to ensure images are visible.

### Implementation Details

1. Added the `useInviteState` hook, which returns `initialInviteStatus`
and `initialUserStatus`.

We track the initial statuses to determine the appropriate UI variant to
display. For example, if the initial invite status is "sent" (indicating
the invite can be accepted) and the initial user status is
`UserInviteStatus.NoCurrentTeam` (indicating the user is not a member of
any team), a confirmation banner is shown for the user to accept or
decline the invite. After the user responds, the invite query is
invalidated, updating the status to "accepted", "canceled", or "errored"
based on their action. Depending on the result, a success or error
banner is displayed, or the banner is hidden if the invite is canceled.
More configuration examples can be found in the Screenshots section. All
possible states are detailed in the `AcceptInviteBannerContent`.

2. For users who are the sole admin of their current team, the banner is
shown on the "/cody/manage" page.

The design requires showing a banner on the "/cody/team/manage" page to
suggest transferring the admin role to another team member. However,
this page is not yet ready. To sync the banner state with user role
changes or deletion actions, the members list query must be invalidated
after each action. The current implementation of the "cody/manage/team"
page does not support refetching with the `useSSCQuery` hook. To resolve
this, we need to migrate the "cody/manage/team" page to use React Query
to allow query invalidation after each action. For now, users who are
sole admins see a banner on the "cody/manage" page suggesting
transferring the admin role, with a link to the "/cody/manage/team"
page.
<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


### Screenshots

| Description | Screenshot |
|--|--|
| Failed to define user state OR invite status is not "sent" (thus can't
be accepted) | <img width="1516" alt="Screenshot 2024-06-14 at 14 39 41"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/cf712239-6a8e-4a66-a4a2-c1932ba70ffd">
|
| User is not on a Cody Pro team | <img width="1516" alt="Screenshot
2024-06-14 at 14 34 30"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/d6b53dc4-c7df-45eb-a743-9baddfdd8aa3"><img
width="1516" alt="Screenshot 2024-06-14 at 14 34 40"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/617957cf-8259-4056-a117-8b806ece6efe">|
|on the team they've been invited to|<img width="1516" alt="Screenshot
2024-06-14 at 14 35 41"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/eaa871ce-acd3-4a7e-a25c-74011a42af58">|
| User is the sole admin of another team |<img width="1516"
alt="Screenshot 2024-06-14 at 14 38 42"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/1382e5a0-4375-4002-93a4-ec25d354317f">|
| User is on another team |<img width="1516" alt="Screenshot 2024-06-14
at 14 36 38"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/2bf20073-f49b-4fb1-9996-6143671c1727"><img
width="1516" alt="Screenshot 2024-06-14 at 14 36 43"
src="https://github.com/sourcegraph/sourcegraph/assets/25318659/349e9445-b2ec-402d-ac0a-6b2517abde9c">|




## Test plan

- Checkout the branch from
https://github.com/sourcegraph/self-serve-cody/pull/858 and run SSC
locally
- Run Sourcegraph in dotcom mode
- As a Cody Pro team admin send invites to users that have different
statuses (are not on a team, are members of the team they were invited
to, are members of another team, are sole admins of their teams)
- As the invited user:
  - click the invite link from the email
- modify the hostname in the URL so that it points to the local
Sourcegraph instance
  - ensure the correct banner is displayed
- ensure user can accept/decline the invite (if applicable for the
banner type)
<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->


## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
5. Add bullet list items for each additional detail you want to cover
(see example below)
6. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
7. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->
2024-06-14 16:56:49 +00:00
Felix Kling
919f64b3af
fix(svelte): Add trailing slash to group and directory suggestions (#63273)
This PR appends a trailing slash to org and directory suggestions so
that we don't search in repos or directories that are a prefix of the
current org/directory.

## Test plan

Manual testing.
2024-06-14 18:04:08 +02:00
Felix Kling
8474caf35f
feat(search/svelte): Add context specific suggestions to repo search input (#62880)
This PR adds a new suggestions source to the repository search input. It
currently offers the following suggestions:

- Repository group/org (on every repo page)
- Current file and/or directory (on blob and tree pages)
- Language of current file (on blob pages)

When on a commit page it adds the revision of the commit to the repo
filter.

A new context store is introduced to propagate those values to the
search input. I also had to update our query processing logic to
preserve pattern and filter token ranges (first commit) so that we can
also replace filters, not just add the.

NOTE: I'm not convinced the way the information is propagated via
context is the best way to do, but it's the simplest I could think of
now. I can imagine in the future that individual pages create/register
suggestions directly.



https://github.com/sourcegraph/sourcegraph/assets/179026/7c1b78e3-061b-4dc8-a1ee-fb3273e633ba



## Test plan

Manual testing.

---------

Co-authored-by: Camden Cheek <camden@ccheek.com>
2024-06-14 12:45:55 +00:00
Camden Cheek
bb359cde47
Svelte: implement keyboard shortcut design (#63253) 2024-06-14 00:12:48 -06:00
Camden Cheek
f8bbc3f2d8
fix(svelte): scrolling search input (#63261)
With the change in font, the minimum line-height to fit that font has
also increased. 1.6 seemed to do the job.
2024-06-13 23:55:53 -06:00
Felix Kling
81e5d696e7
chore(svelte): Migrate all icons to Lucide/custom icons (#63246)
Closes srch-467

tl;dr: This commit switches all remaining mdi icons to lucide.

This commit does a couple of things to make the migration to lucide
icons and to the `Icon2` (now `Icon` again) component complete:

- Use lucide icons instead of mdi icons
- Turn custom icons back to SVG files and use `unplugin-icon`s custom
collections support to reference them
- Rename `Icon` component to `SVGIcon`. We still need it for integrating
with shared web app code.
- Rename `Icon2` component to `Icon`.
- Update to svelte@4.2.18 to [bring in a fix for
`<svelte:component`](https://github.com/sveltejs/svelte/releases/tag/svelte%404.2.12)
which is used by (now) `Icon`.

I put our generic icons in `assets/icons/` and the specific symbol icons
in `assets/symbol/icons`. They can be referenced via `ISgName` and
`ISymbolName`. I'm open to changes to the location and the naming.

If the same icon wasn't available in lucide I tried to find one that
made sense semantically. I expect we'll make another pass (in a separate
PR) to adjust icons and tweak icon sizes/colors.

## Test plan

`pnpm build` and svelte check
2024-06-13 18:49:03 +02:00
Camden Cheek
af22bd261f
Chore: disable flaky tests (#63251)
Of the last 10 failures, only two tests were flaking. This disables
those tests until we can figure out why they were flaking.
2024-06-13 18:45:44 +02:00
Felix Kling
0b8d12dcad
fix(search): Copy text from read-only code host configuration input (#63239)
PR #49682 made some CSS changes to hide the caret as well as bracket
matching for this input. I assume that seeing those in a read-only input
was confusing.

However, hiding the textarea element also breaks copying the input's
value. Instead of hiding the textarea, we are now hiding the visiual
representation of the caret.

A noteable difference in behavior now is that it's possible to focus the
input via tab, but there is no visual indiciation that the editor has
focus (since we hide the caret, as before).


## Test plan

Manual tested on
https://sourcegraph.test:3443/site-admin/external-services/RXh0ZXJuYWxTZXJ2aWNlOjky
2024-06-13 16:16:46 +00:00
Camden Cheek
323034edac
Svelte: use Roboto Mono as monospace font (#63247)
This adds Roboto Mono as the default monospace font for the Svelte
webapp. Previously, we were nominally using SF Mono, but that is not
installed by default and we were not fetching it, so the figma designs
looked different than what was being rendered in the web app. This uses
FontSource packages for the font for easy self-hosting (no external
requests).
2024-06-13 09:41:31 -06:00
David Veszelovszki
fb0e466ac3
fix(plg): Fix "Remove team member" feature (#63241) 2024-06-13 17:33:56 +02:00
Matthew Manela
a3a6545612
feat(Search): Add icon for the Hack language (#63233)
Fixes GRAPH-620

Adds the icon for the Hack language to the Svelte UI
2024-06-13 07:24:46 -04:00
Felix Kling
498c03d91d
chore(search/svelte): Remove dependencies on barrel files to speed up dev build (#63230)
Fixes srch-516

Using vite's inspect plugin I found out that we are importing a lot of
unnecessary components again, including `@sourcegraph/wildcard` and
`@sourcegraph/branded`.


By removing those dependencies we speed up the development build significantly.

## Test plan

`pnpm build`
2024-06-13 08:19:41 +02:00
Camden Cheek
d8d370913c
Svelte: add footer links for dotcom (#63170)
Completes SRCH-493
2024-06-12 09:32:10 -06:00
Camden Cheek
c46bfad20a
Svelte: remove v1 telemetry (#63220)
Fixes SRCH-495
2024-06-12 14:59:38 +00:00
Peter Guy
9d82cd17eb
Fix(search): auth issues with Sourcegraph VSCode extension (#63175)
Fixes the issues requiring the workaround described in [this
video](https://www.loom.com/share/10a4a66a19b548c7b0866fe2cc358daa).

Closes #60710 

No more manual editing of `settings.json`.

The endpoint URL and access code can now all be managed from the UI

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan

### First
Build and run locally.
```
git switch peterguy/vscode-sourcegraph-extension-fix-auth
cd client/vscode
pnpm run build
```
### Then
Launch extension in VSCode: open the `Run and Debug` sidebar view in VS
Code, then select `Launch VS Code Extension` from the dropdown menu.
Click on `Have an account?` to open the login dialog.
Enter an access token and the URL of the Sourcegraph instance to which
you would like to connect.
Click `Authenticate account`.
In the Help and Feedback section, click your username to open the logout
panel, then log out.
Repeat the login process.
You can check `settings.json` if you'd like to confirm that it's no
longer being used.
If you're logging in to dotcom, you'll probably se a SQL error. The
login process still works; the SQL error does not have long to live.

## Changelog

- Entering the URL and access token in the UI now works - no more manual
editing of `settings.json`
2024-06-12 07:07:10 -07:00
Camden Cheek
e0e234c509
Svelte: add Cody upsell banner (#63167)
Fixes SRCH-492
2024-06-12 14:01:08 +00:00
Felix Kling
1c28f460ae
feat(search/svelte): Support more file icons (#63181)
Closes SRCH-452

Until this commit both the React and Svelte apps have used the same code
to determine the correct file icon. That code however still held
separate logic for the two apps with the result that our file icon set
for the Svelte app was a lot smaller.
    
This commit separates the logic and now makes use of `unplugin-icons` in
the Svelte app.
    
I tried to use `unplugin-icons` in the React so that the code could
continued to be shared but I couldn't get it to work.

Note that I didn't use the exact same icons as in the React app. I
wanted to minimize the number of different icon sets we are using.

## Test plan

Builds without error, manual testing.
2024-06-12 15:59:32 +02:00
Camden Cheek
378977912f
Svelte: use Inter font for --font-family-base (#63221)
This adds `Inter` as the preferred for `--font-family-base` in the
Svelte webapp. Previously, we were using system fonts for our base font,
which meant our web app looked different depending on the OS+browser.

Instead of depending on the Google Fonts CDN, this uses Fontsource,
which let us easily self-host Google Fonts (and other OSS fonts) just by
importing an NPM package. No committing font files to git, and no
dependency or connection to a 3rd-party server. The font itself weighs
~40KB for the full, variable-weight font.

Contributes to SRCH-445
2024-06-12 13:41:03 +00:00
David Veszelovszki
4774879465
feat(plg): Add new Checkout flow that uses Stripe's createToken API (#63213) 2024-06-12 09:57:10 +00:00
Matthew Manela
949a538654
feat(search): Support Magik language file filter in search (#63110)
Adds support to the lang file filter for Magik language (`lang: Magik`).
In order to do that we add wrappers around go-enry and update search
code to use them. This provides flexibility for us in the future to
support other languages that are not in Linguist as well.
2024-06-11 13:41:39 -04:00
Felix Kling
54d94ba450
fix(search/svelte): Hide diff view when closing bottom panel (#63184)
Closes SRCH-496

#63128 added a dedicated button for closing the bottom panel but
clicking the button didn't cause the diff view to close. This commit
fixes that.

## Test plan

Manual testing.
2024-06-11 10:30:54 +02:00
Felix Kling
ce83585b44
fix(search): Contributors page errors with empty date string (#63182) 2024-06-11 06:57:15 +02:00
Vova Kulikov
ab305657ab
[Svelte]: Fix standard click-based popover flow (#63192)
Closes
[SRCH-504](https://linear.app/sourcegraph/issue/SRCH-504/popover-click-triggers-are-no-longer-working-properly)

It seems that this problem was caused by slipped-out showOnHover check
for hover-based trigger event listeners

## Test plan 
Manual testing
2024-06-10 15:38:32 -03:00
David Veszelovszki
8971855d09
SSC: Fix checkout links (#63190) 2024-06-10 20:34:04 +02:00
David Veszelovszki
855dd2cc3e
SSC: Fix "Make admin" and "Revoke admin" button actions (#63188) 2024-06-10 20:23:49 +02:00
Craig Furman
d0506f9300
feat(appliance): deploy frontend (#63158) 2024-06-10 15:55:28 +01:00
Camden Cheek
bebc8277fc
Svelte: fix tests (#63146)
I disabled a few tests to get #62560 merged. This just goes back and fixes the ones I disabled. There are still a handful skipped, but the fixes were non-trivial.
2024-06-07 15:44:26 +00:00
Camden Cheek
929258e8a0
Svelte: add sentry (#63126)
This adds basic sentry support to the Sveltekit webapp.
2024-06-07 15:35:27 +00:00
Camden Cheek
a36b750842
Svelte: allow popovers to have external targets (#63141)
This updates the `Popover` component to accept a passed-in target rather
than setting the target via an action. This allows us to pass in targets
not owned by the `Popover` component, which is important for things like
the file tree where the logical target is a wrapper around what the
consumer has access to.
2024-06-07 09:28:21 -06:00
Matthew Manela
c9d391cdec
fix(highlighting): Update JSX/TSX highlighting to more properly label tag delimiters (#63138)
Better highlighting for tags in JSX and TSX
2024-06-07 08:46:34 -04:00
Felix Kling
9341fcf7d2
svelte: Migrate repo sidebar toggle button to use lucide icon (#63129)
See title.

Contributes to SRCH-467

## Test plan

Visual inspection.
2024-06-07 09:29:59 +02:00
Felix Kling
b2f1746844
svelte: Add bottom panel close button (#63128)
Closes SRCH-450

This commit adds a button to the right hand side of the tabs that allows
closing the bottom panel.

For this I

- extended the Tabs.svelte component to allow rendering something to the
right hand side of the tabs.
- added a new `text` variant to button that renders an unstyled button
and shows a background on hover

Note that the icon as shown in the figma design doesn't exist in lucide.


![2024-06-06_17-36](https://github.com/sourcegraph/sourcegraph/assets/179026/d3c95784-df02-4534-9fd5-cbe7d0300056)


## Test plan

Visual/manual inspection in light and dark mode

## Changelog

- Added bottom panel close button
- Added 'text' variant to Button component
- Added 'actions' slot to Tabs component
- Added Button component stories
2024-06-07 09:07:57 +02:00
Felix Kling
993ed3ae5c
fix(search): Properly handle URLs with file paths that contain route segments (#63123)
Fixes SRCH-484. See that issue for more information about the problem.

Instead of hardcoding the routes that can contain file paths, I'm using
the generated list of routes in `routes.ts` and extract any route that
ends with a `[...path]` segment (which, so far at least, is used as the
file path parameter).

This list is then used to hook into the routing process and encode the
file path when any of the routes match. As mentioned in the `reroute`
documentation, this does not affect the URL displayed in the browser.
Because the file path is now URL encoded we need to decode it before we
can process it further (I grepped for all occurrences of `params.path`).

## Test plan

Manual testing, integration test.
2024-06-06 21:29:59 +02:00
James McNamara
4077b3ec22
feat(ci): Adds playwright tests for sveltekit to bazel (#62560)
This runs playwright tests with bazel. This changes how the
app is served in the tests, specifically playwright will intercept all
network calls to the local server and serve the static assets directly
or serve root index.html file if nothing is matched.

---------

Co-authored-by: bahrmichael <michael.bahr@sourcegraph.com>
Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
Co-authored-by: Michael Bahr <1830132+bahrmichael@users.noreply.github.com>
Co-authored-by: Jean-Hadrien Chabran <jean-hadrien.chabran@sourcegraph.com>
Co-authored-by: Camden Cheek <camden@ccheek.com>
2024-06-06 12:45:05 -06:00
Camden Cheek
8f4a610c67
Svelte: inject into primary app.html (#63088)
This modifies our pattern for shipping a svelte-enabled HTML document by
injecting the svelte-specific things into our primary `app.html` rather
than trying to make `app.prod.html` match the behavior of the frontend
`app.html`.

I could not figure out a "blessed" way to integrate this into the build
system, so I went for the hacky way: render `app.prod.html` in a format
that's easily parseable, then parse it in `frontend` and inject it into
our `app.html` with the standard go template patterns.
2024-06-06 09:33:39 -06:00
Robert Lin
b574300714
feat/enterprise: make per-subscription model allowlists no-op (#62912)
With #62911, per-enterprise-subscription model allowlists are no longer
respected, so we can safely update the UI to remove mentions of
allowlists, and also update our various allowlist-evaluation mechanisms
in `licensing` and GraphQL resolvers to just provide a wildcard
allowlist instead. It's not strictly required, but will make how the
model allowlists work more clearer/explicit.

Because we have a [planned migration for all this state to Enterprise
Portal](https://linear.app/sourcegraph/project/kr-enterprise-portal-manages-all-enterprise-subscriptions-12f1d5047bd2/overview),
we're not making any database changes.

Part of https://linear.app/sourcegraph/issue/CORE-135

### Context

In https://sourcegraph.slack.com/archives/C05SZB829D0/p1715638980052279
we shared a decision we landed on as part of #62263:

> Ignoring (then removing) per-subscription model allowlists: As part of
the API discussions, we've also surfaced some opportunities for
improvements - to make it easier to roll out new models to Enterprise,
we're not including per-subscription model allowlists in the new API,
and as part of the Cody Gateway migration (by end-of-June), we will
update Cody Gateway to stop enforcing per-subscription model allowlists.
Cody Gateway will still retain a Cody-Gateway-wide model allowlist.
[@chrsmith](https://sourcegraph.slack.com/team/U061QHKUBJ8) is working
on a broader design here and will have more to share on this later.

This means there is one less thing for us to migrate as part of
https://github.com/sourcegraph/sourcegraph/pull/62934, and avoids the
need to add an API field that will be removed shortly post-migration.

As part of this, rolling out new models to Enterprise customers no
longer require additional code/override changes.

## Test plan

Various tests pass.

Visual inspection of `sg start dotcom`:

- **Before:** <img width="947" alt="image"
src="https://github.com/sourcegraph/sourcegraph/assets/23356519/2dc0ab72-c77d-4c0e-a57e-4c336041da4e">
-
**After:**![image](https://github.com/sourcegraph/sourcegraph/assets/23356519/ab2e6d97-38c7-42df-9a5f-2448793db0cc)
2024-06-05 17:08:58 +00:00
Peter Guy
d5a0415e7f
cleanup: fix typo: scretTokenKey --> secretTokenKey (#63101)
This one is straightforward: changing the spelling of a variable. 

As I poked around in the vscode extension looking for what's going on
with the authentication errors, the misspelling of `scretTokenKey`
became difficult to ignore. So I fixed it. :-D
 
## Test plan

1. Build and run locally.
```
cd client/vscode
pmpn run build
```
2. Launch extension in VSCode: open the `Run and Debug` sidebar view in
VS Code, then select `Launch VS Code Extension` from the dropdown menu.
Verify expected behavior.
2024-06-05 15:12:14 +00:00
Noah S-C
4a93f29755
chore(bazel): enable rules_esbuild sandbox with object-inspect workaround (#61969)
Sandbox escapes be-gone

## Test plan

Tested in CI and locally with `bazel build //client/...` as well as a
lot of blood, sweat n tears tearing through failed sandboxes

## Changelog
2024-06-05 15:34:29 +01:00
Camden Cheek
d61368d2b5
Svelte: collapse path when too long (#63082)
This applies the `sizeToFit` action to the file header, allowing us to
collapse the header in multiple steps:
- First, collapse the actions down to icons
- Next, collapse elements one by one from the front of the path and put
them in an overflow dropdown
2024-06-05 07:54:33 -06:00
David Veszelovszki
23eed1d5ef
Fix Cody onboarding redirect problem (#63096) 2024-06-05 12:07:08 +00:00
Taras Yemets
231c31279d
PLG: use react-query for async state management (#62939) 2024-06-05 07:18:00 +00:00
Beatrix
f2590cbb36
Cody Gateway: Add Gemini models to PLG and Enterprise users (#63053)
CLOSE https://github.com/sourcegraph/cody-issues/issues/211 &
https://github.com/sourcegraph/cody-issues/issues/412 &
https://github.com/sourcegraph/cody-issues/issues/412
UNBLOCK https://github.com/sourcegraph/cody/pull/4360

* Add support for Google Gemini AI models as chat completions provider
* Add new `google` package to handle Google Generative AI client
* Update `client.go` and `codygateway.go` to handle the new Google
provider
* Set default models for chat, fast chat, and completions when Google is
the configured provider
* Add gemini-pro to the allowed list

<!-- 💡 To write a useful PR description, make sure that your description
covers:
- WHAT this PR is changing:
    - How was it PREVIOUSLY.
    - How it will be from NOW on.
- WHY this PR is needed.
- CONTEXT, i.e. to which initiative, project or RFC it belongs.

The structure of the description doesn't matter as much as covering
these points, so use
your best judgement based on your context.
Learn how to write good pull request description:
https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e?pvs=4
-->


## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles
-->

For Enterprise instances using google as provider:

1. In your Soucegraph local instance's Site Config, add the following:

```
    "accessToken": "REDACTED",
    "chatModel": "gemini-1.5-pro-latest",
    "provider": "google",
```

Note: You can get the accessToken for Gemini API in 1Password.

2. After saving the site config with the above change, run the following
curl command:

```
curl 'https://sourcegraph.test:3443/.api/completions/stream' -i \
-X POST \
-H 'authorization: token $LOCAL_INSTANCE_TOKEN' \
--data-raw '{"messages":[{"speaker":"human","text":"Who are you?"}],"maxTokensToSample":30,"temperature":0,"stopSequences":[],"timeoutMs":5000,"stream":true,"model":"gemini-1.5-pro-latest"}'
```

3. Expected Output:

```
❯ curl 'https://sourcegraph.test:3443/.api/completions/stream' -i \
-X POST \
-H 'authorization: token <REDACTED>' \
--data-raw '{"messages":[{"speaker":"human","text":"Who are you?"}],"maxTokensToSample":30,"temperature":0,"stopSequences":[],"timeoutMs":5000,"stream":true,"model":"gemini-1.5-pro-latest"}'

HTTP/2 200
access-control-allow-credentials: true
access-control-allow-origin:
alt-svc: h3=":3443"; ma=2592000
cache-control: no-cache
content-type: text/event-stream
date: Tue, 04 Jun 2024 05:45:33 GMT
server: Caddy
server: Caddy
vary: Accept-Encoding, Authorization, Cookie, Authorization, X-Requested-With, Cookie
x-accel-buffering: no
x-content-type-options: nosniff
x-frame-options: DENY
x-powered-by: Express
x-trace: d4b1f02a3e2882a3d52331335d217b03
x-trace-span: 728ec33860d3b5e6
x-trace-url: https://sourcegraph.test:3443/-/debug/jaeger/trace/d4b1f02a3e2882a3d52331335d217b03
x-xss-protection: 1; mode=block

event: completion
data: {"completion":"I","stopReason":"STOP"}

event: completion
data: {"completion":"I am a large language model, trained by Google. \n\nThink of me as","stopReason":"STOP"}

event: completion
data: {"completion":"I am a large language model, trained by Google. \n\nThink of me as a computer program that can understand and generate human-like text.","stopReason":"MAX_TOKENS"}

event: done
data: {}
```

Verified locally:


![image](https://github.com/sourcegraph/sourcegraph/assets/68532117/2e6c914d-7a77-4484-b693-16bbc394518c)

#### Before

Cody Gateway returns `no client known for upstream provider google`

```sh
curl -X 'POST' -d '{"messages":[{"speaker":"human","text":"Who are you?"}],"maxTokensToSample":30,"temperature":0,"stopSequences":[],"timeoutMs":5000,"stream":true,"model":"google/gemini-1.5-pro-latest"}' -H 'Accept: application/json' -H 'Authorization: token $YOUR_DOTCOM_TOKEN' -H 'Content-Type: application/json' 'https://sourcegraph.com/.api/completions/stream'

event: error
data: {"error":"no client known for upstream provider google"}

event: done
data: {
```

## Changelog

<!--
1. Ensure your pull request title is formatted as: $type($domain): $what
2. Add bullet list items for each additional detail you want to cover
(see example below)
5. You can edit this after the pull request was merged, as long as
release shipping it hasn't been promoted to the public.
6. For more information, please see this how-to
https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?

Audience: TS/CSE > Customers > Teammates (in that order).

Cheat sheet: $type = chore|fix|feat $domain:
source|search|ci|release|plg|cody|local|...
-->

<!--
Example:

Title: fix(search): parse quotes with the appropriate context
Changelog section:

## Changelog

- When a quote is used with regexp pattern type, then ...
- Refactored underlying code.
-->

Added support for Google as an LLM provider for Cody, with the following
models available through Cody Gateway: Gemini Pro (`gemini-pro-latest`),
Gemini 1.5 Flash (`gemini-1.5-flash-latest`), and Gemini 1.5 Pro
(`gemini-1.5-pro-latest`).
2024-06-04 23:46:36 +00:00
Camden Cheek
bf851d4598
Svelte: fix editor button styling (#63080)
The editor button would wrap before the div would overflow, causing weird wrapping. This fixes that and also makes it a proper button.
2024-06-04 12:49:40 -06:00
David Veszelovszki
b1cbbc82e5
Change JetBrains IDE statuses from Beta to Stable (#63073) 2024-06-04 09:55:34 -07:00
David Veszelovszki
b7cb870a0a
feature(plg): Use custom Stripe checkout (#62955)
* Bug fix: Stripe was called twice
* Split "individual" vs. "team" case for page title
* Use WhiteIcon for Cody logo
* Add customUI to CreateCheckoutSessionRequest
* Use custom Stripe checkout, matching Rob's designs
* Use debouncing
* Add "loading" states
* Redirect after successful payment (needs more fixes)
2024-06-04 17:01:30 +02:00
Camden Cheek
c6ff22a814
Svelte: make search header primary (#62991)
This implements the change to move the search bar back into the header, and the repo header down a level.
2024-06-04 14:23:26 +00:00
Camden Cheek
a5699594f2
Svelte: clean up file tree (#63009)
After the changes to the file tree layout in #62981, we can clean up the styles and DOM a bit. These changes are partially in prep for experimenting with alternative "current path" representations. Comments inline.
2024-06-04 07:43:40 -06:00
Vova Kulikov
5915788ef0
Svelte: Add telemetry v2 to svelte client (#63041)
* Svelte: Add telemetry v2 to svelte client

* Run format

* Add telemetry to the bazel config
2024-06-04 11:12:32 +02:00
Dan Adler
8275054987
v2t: add v2 telemetry to the client/shared folder (#62586) 2024-06-03 16:34:28 -07:00
Taras Yemets
88d71af290
PLG: extract Cody Pro routes to a separate file (#63003) 2024-06-03 12:42:54 +00:00
Petri-Johan Last
ef88ae5387
Remove external accounts modal feature flag (#62983) 2024-06-03 12:12:15 +02:00
Vova Kulikov
85136df312
Svelte: Paper cuts for 5.5 release (#62997)
* Add search files quick actions for collapsed file sidebar

* Update tabs appearance

* Fix fuzzy finder appearance

* Fix fuzzy finder appearance [2]

* Add keyboard support for tabs

* Set a proper delays to opt in/out popover/tooltip

* Add close on escape hotkeys

* Add shortcuts to history and references panels

* Fix sidebar shadows problem

* Run prettier

* Simplify shortcuts keys
2024-06-01 00:40:51 +02:00
Julie Tibshirani
9afc06c631
Embeddings: hide site admin references (#63014)
This PR fixes a bug in the site admin UI where we showed references to
embeddings even when they were disabled in site config.

In follow-up work, we plan to remove the embeddings logic completely.

Closes https://github.com/sourcegraph/cody-issues/issues/50
2024-05-31 15:00:05 -07:00
Greg Magolan
bbae7a4954
build(bazel): bump to rules_esbuild 0.16.0 (#63005)
* build(bazel): pin bazel fetched esbuild version to 0.19.2

* build(bazel): bump to rules_esbuild 0.16.0

* Update WORKSPACE

Co-authored-by: Noah S-C <noah@sourcegraph.com>

---------

Co-authored-by: Noah S-C <noah@sourcegraph.com>
2024-05-31 11:20:23 -07:00
Camden Cheek
52059fc947
Svelte: add lines to directory groups (#62981)
This adds guidelines for open directories in the file tree.
2024-05-31 07:37:12 -06:00
Felix Kling
a6c1c87c56
feat(search): Add inline file search to Svelte app (#62961)
This PR adds the inline file search to the file view.

## Changelog

- Refactored the existing CodeMirror extension to allow UI customization
- Moved utility functions around to avoid loading all of wildcard into the prototype (which lead to build errors)
- Tweaked the new icon component to better align within buttons (I missed that in #62908 because I didn't test it within buttons)
- Noticed that button group styles didn't apply correctly and the reason seemed to be that we were mixing sveltekit and react styles. So I copied the button styles into the sveltekit app.
- Added a switch component, following https://web.dev/articles/building/a-switch-component .
2024-05-31 11:14:06 +00:00
Beatrix
fe227af6e2
Cody PLG: add support for Google Gemini models (#62993)
This change adds support for the Google Gemini 1.5 Flash and Pro models in the ModelBadges component and the isAllowedCustomChatModel function. This allows these models to be displayed and used in the Sourcegraph product subscriptions UI and chat functionality.
2024-05-31 07:52:04 +02:00
Julie Tibshirani
e45ec596b4
Batch changes: remove structural search example (#62958)
This PR refactors a batch changes example that uses `patterntype:structural` to
use regex instead. We no longer expose `patterntype:structural` by default, and
want to push users towards other pattern types.
2024-05-30 08:47:46 -07:00
Camden Cheek
70d2439f77
Svelte: remove go to repository root button (#62979) 2024-05-30 15:07:14 +00:00
Camden Cheek
819b2d0e68
Svelte: QoL fixes for hover popovers (#62974)
- Adds a hoverDelay parameter to Popover so each consumer doesn't need to do this manually
- Makes hovers only show when the mouse comes to rest
- Closes the popover when the window loses focus so we don't miss a mouseleave event and have popovers get stuck open
- Adds a delay to popover closing when the mouse leaves one of the target elements so there is room for error when moving the mouse from the trigger to the popover
- Adds preloading back to the file tree because the popover now does not create the element until the delay has passed
- Makes it so clicking the target closes the popover when hover is enabled.
2024-05-30 15:00:27 +00:00
Camden Cheek
0e2a668954
Svelte: simplify and grow last commit (#62978)
This makes various tweaks and simplifications to the LastCommit component shown on the file page.
- Uses the Timestamp component
- Removes a bunch of unnecessary DOM elements and styles in favor of just using flexbox well
- Removes the max width on the last commit component, allowing it to take up as much space as is available (but leaving a healthy gap from the tabs). This was the primary reason I tackled this PR. Most commits I see are truncated to the "barely useful" level
2024-05-30 08:17:45 -06:00
Camden Cheek
376cc7a7cc
Svelte: add repo popovers to repo name in header and in dynamic filters (#62865)
This adds the RepoPopover hover info to the dynamic filters in the search sidebar (replacing the full repo name tooltip) and to the global header.
2024-05-30 08:04:32 -06:00
Taras Yemets
03bec9ceda
PLG: migrate subscription management page (#62754) 2024-05-30 15:07:33 +03:00
Dan Adler
74ed4d52c9
Update titles for and references to the Analytics > Extensions page t… (#62967)
Update titles for and references to the Analytics > Extensions page to reflect that they cover Search extensions only, not Cody extensions
2024-05-29 12:43:25 -07:00
Felix Kling
d6b3b4f0e2
fix: Icon auto-import in Bazel (#62963)
We still need to run `AutoImport` so that the `import` directives are
generated, but we don't want to update the `.d.ts` file.
2024-05-29 13:59:40 +00:00
Felix Kling
de520327a4
svelte: Add lucide icons and new icon API (#62908)
See also #62904.

This PR adds a new icon component (`Icon2`), which takes an svg component imported by `unplugin-icons`. To make things easier the icons can be auto-imported via `unplugin-auto-import`.

Usage example:

```js
import Icon2 from '$lib/Icon2.svelte'

<Icon2 icon={ILucideX} inline />
```

`unplugin-icons` allows us to:

- use other icon sets besides lucide, while using the same API. Other icon sets are necessary for file icons. `react-icons`, which we use in the React app, also pulls from multiple icon sets.
- define our own icon sets

See https://github.com/unplugin/unplugin-icons for more information.

If it turns out that auto-importing (which involves generating TypeScrip types) doesn't work with our Bazel pipeline we can fall back to manual importing.

This PR converts some icons as example.
2024-05-29 11:25:04 +02:00
Beatrix
838221e665
Rename smartContext to smartContextWindow (#62948)
* Rename smartContext to smartContextWindow

* Update CHANGELOG.md

Co-authored-by: Kalan <51868853+kalanchan@users.noreply.github.com>

---------

Co-authored-by: Kalan <51868853+kalanchan@users.noreply.github.com>
2024-05-28 10:00:34 -07:00
Noah S-C
4e31a4e38d
feat/bazel: //cmd/{frontend,server} targets that don't include client bundle for backend integration tests (#62877)
Currently, all backend integration tests transitively depend on the client bundle. This results in rebuilds of the closure, and a (likely) cache miss on the test, when modifying any client-side files. 
Given that the client bundle isnt needed for these tests, we can create targets that don't include the client bundle in its transitive closure, which should in theory improve the cache hit for backend integration tests by not having client side changes invalidate it. This would also be beneficial in local env, to keep frontend rebuilds down

To do this, we still need to create a `web.manifest.json` file due to some unfortunate requirement on that file existing as part of initializing the sourcegraph instance. For this I just create an empty json file, `select` this instead of the client bundle target in client/web/dist/BUILD.bazel based on a `//:integration_testing_enabled` config setting, and creating a `go_binary`-wrapping bazel rule + macro that automatically applies a transition to set this to true `go_binary_nobundle`, and using that rule for the specific `//cmd/{server,frontend}:{server,frontend}_nobundle` binary rules (along with the relevant `oci_{image,tarball}` etc rules to consume it).



## Test plan

- Integration tests in CI still work
- `bazel cquery 'kind("js_library", deps(//cmd/frontend:image_nobundle))'`, `bazel cquery 'kind("js_library", deps(//cmd/server:image_nobundle))'`, ``bazel cquery 'kind("js_library", deps(//testing:backend_integration_test))'` etc  all return empty set
- Release test with marker in web bundle to ensure released images contain the web bundle via `sg release run test --version 5.4.2` (commenting out other tests for brevity)
2024-05-28 14:32:48 +01:00
David Veszelovszki
7375a2738d
SSC: Add "Welcome to Cody Pro" banner (#62936)
* Add "welcome to Cody Pro" notification
* Trigger the notification in accept invitations
* Trigger the notification in signups
* Redirect to the correct page after accepting an invite
* Unrelated: Fix header style
2024-05-28 11:57:52 +00:00
David Veszelovszki
03f82d67b2
SSC: Handle team=1 input on checkout form (#62906)
* Add team feature to checkout form
* Slightly unrelated typo fixes, warning fixes, variable rename, rearrange
2024-05-28 13:02:02 +02:00
David Veszelovszki
7f0080fe07
SSC: Handle "Accept invite" calls (#62888)
* Extract common components + split manage team CSS
* Add "accept invite" page
* Small fixes
2024-05-27 12:06:52 +00:00
Julie Tibshirani
2afbe46b39
Revert "web: navigate to file@commit instead of file@branch" (#62889)
This reverts commit e45c2ed.

We've decided to revert this behavior after receiving negative feedback from
several customers. Instead, we'll work to improve indexing speed and
reliability to minimize drift between search results and the file view.
2024-05-24 08:59:07 -07:00
Felix Kling
4497bba9ad
svelte: Add link to code-graph page to repo navigation (#62899)
This adds a link to the repository's code-graph page to the repo
navigation.

Additional changes:
- added a flag to each menu item that specifies whether
or not show the entry for non-admin users (defaults to `false`)
- updated vite's proxy configuration to properly load React repo pages
  from the server
2024-05-24 17:11:35 +02:00
Camden Cheek
53c3d3cfd1
Svelte: add copy button and reduce spacing (#62867)
This adds a copy button to the file path in the file view, reduces spacing between path elements, and removes spaces from the the copied text for the file path.
2024-05-24 13:40:59 +00:00
Felix Kling
7f7ea20e2d
svelte: Allow closing the diff and commit view from the history panel (#62901)
This updates the history panel entries to allowing closing the diff and
commit view by clicking the same link again (i.e. the commit subject or
the 'view at commit' button).
2024-05-24 15:37:49 +02:00
Felix Kling
1195dd9049
svelte: Format code (#62900)
This simply runs `pnpm format` and the LSPs formatter to format .svelte
files that have been recently added.

(we do not run the formatter for .svelte files in CI)
2024-05-24 12:30:21 +00:00
Felix Kling
d01b4cb140
svelte: Fix GraphQL error on contributors page (#62896) 2024-05-24 13:12:27 +02:00
David Veszelovszki
ebe14c4e01
SSC: Fix notification colors (#62860) 2024-05-24 10:26:09 +03:00
David Veszelovszki
86bfb30b6a
SSC: Fix invite date formatting (#62858) 2024-05-23 19:22:39 +00:00
Michael Bahr
d8284e34fe
feat: popover to configure editor (#62452)
Co-authored-by: Felix Kling <felix@felix-kling.de>
2024-05-23 16:36:58 +02:00
David Veszelovszki
aafce44cc7
Make the URL dynamic, now with a fallback (#62852) 2024-05-23 09:54:37 +00:00
Felix Kling
a376a02bf5
svelte: Fix failing/skipped playwright tests (#62866)
Follow up for #62820 to fix failing/skipped tests that are easy to fix
(which is all but one).
2024-05-22 23:10:02 +02:00
Camden Cheek
c95e4ed85f
Svelte: linkify and wrap dir entries (#62862)
This makes each dir entry in the file popover header a link, and allows wrapping so the full path is always visible. Uses the same wrapping logic as the file header so the slashes work right. Additionally, it linkifies the commit message to point to the same page as the OID link
2024-05-22 18:11:52 +00:00
Camden Cheek
cc7aebf187
Svelte: add default badge to default branch (#62829) 2024-05-22 11:45:44 -04:00
Camden Cheek
159c89c451
Svelte: remove site-admin-only data from repo popover (#62834)
The repo popover has deployed to S2, but it's not visible to anyone who is not a site admin because one of the GraphQL fields used is restricted to only site admins.

This updates the query to use a non-restricted field, and also fixes the code host capitalization while I'm at it.
2024-05-22 13:13:55 +00:00
Felix Kling
88de40c1df
svelte: Show correct byline when commit has author and committer (#62841)
It was reported that the "byline" isn't correct when a commit has an
author and a committer.

This fixes it.
2024-05-22 12:53:03 +02:00
Michael Bahr
9c905aa066
chore: skip failing tests (#62820) 2024-05-22 12:33:53 +02:00
Felix Kling
d24b981989
svelte: Improve commit page loading state (#62842) 2024-05-22 12:28:44 +02:00
David Veszelovszki
1652ed0c17
SSC: Three small fixes for Teams & invites (#62818)
* Fix logging mistakes
* Fix URL and logging
* Make invite count dynamic in notification
2024-05-22 08:58:41 +00:00
Chris Smith
59b51561ac
Fix woes related to undefined frontendCodyProConfig.sscBaseUrl (#62835) 2024-05-21 23:22:05 +00:00
Felix Kling
01dbcfccc6
svelte: Add tailling space to default repo search input (#62832)
The input is missing a trailing space.
2024-05-21 21:21:08 +00:00
Jason Hawk Harris
939e000cdc
Svelte: Implement and instantiate FilePopover (#62498)
Implements the file popover on the SvelteKit web app.

Co-authored-by: Camden Cheek <camden@ccheek.com>
2024-05-21 15:26:00 -04:00
Felix Kling
4bba154a15
svelte: Preserve current revision in repo search input (#62822) 2024-05-21 17:36:39 +02:00
Camden Cheek
899145fea8
Svelte: unrevert RepoPopover (#62744)
This re-applies #61989 after it was reverted. In addition to reapplying the change:

- It reverts the changes to Popover.svelte that removed the border.
- We only start loading data on hover, not on mount
- Various fixes in text overflow conditions
- Removes the language from the popover data because it can be very expensive to calculate 
   (another reason to pre-calculate language, but that's for another day)
- Moves the data loading out of the page loader. Exports the data loading function from 
   the component so data loading is still orchestrated by the caller. (I know this will be controversial, reasoning inline)
- Adds a delay to the popover so it doesn't get in the way as your mouse moves over the page.
- Uses the display name instead of the author name
- Linkifies the commit message
2024-05-21 13:20:26 +00:00
David Veszelovszki
376a737d61
Make SSC base url dynamic (#62790)
* Add config item, get it to the front end
* Use config on the front end
* Send team=1 if the team button is clicked
* Unrelated: Event logging cleanup
2024-05-21 09:58:08 +00:00
gitstart-app[bot]
e2a0fd6113
SG-61976 - Run a test to remove steps from the new user signup flow (#62413)
update: Remove A/B testing on web signup and keep on IDE signup

Co-authored-by: gitstart-sourcegraph <gitstart-sourcegraph@users.noreply.github.com>
Co-authored-by: GitStart-SourceGraph <89894075+gitstart-sourcegraph@users.noreply.github.com>
2024-05-21 06:28:54 +03:00
Chris Smith
622cf7d730
Fix auth-related error in the SSC REST API client hook (#62798)
* Fix bug in API client hooks

* lint
2024-05-20 12:45:21 -07:00
Chris Smith
49b99e65e9
Add missing API types (#62797)
* Add missing API types

* Run "bazel run //:configure"
2024-05-20 19:01:27 +00:00
David Veszelovszki
5d6ef98432
Change "Remove" button to a regular button (#62794) 2024-05-20 20:18:16 +02:00
David Veszelovszki
43012534ad
Fix up "Manage team" page UI (#62761)
* Remove "open in new" icon
* Make "Add seats" button of the "success" type
* Add title
* Left-align "Send" button
* Remove unneeded filter
* Convert table to grid
* Fix copy
* Center align action buttons
* Update button type
* Fix copy
* Add red outline to textbox if erroneous
* Error replaces help text
* Use text-uppercase in ADMIN and INVITED labels
2024-05-20 10:49:18 +00:00
Chris Smith
a4af00e716
Add Cody Pro REST API client library (#62715)
* Add Cody Pro REST API client library

* Expose REST API methods for Subscriptions

* Address PR feedback

* Address even more, great PR feedback

* Add unit tests

* Run 'sg lint', 'bazel run //:configure'

* Fix error from bad merge

* Lint
2024-05-17 14:58:10 -07:00
David Veszelovszki
4a049d894e
Fix a condition I negated by accident (#62763) 2024-05-17 13:56:58 +00:00
Philipp Spiess
1e3cb2bc68
Change chat defaults to Sonnet and autocomplete defaults to StarCoder or Haiku (#62757) 2024-05-17 14:04:10 +02:00
Michael Bahr
e85028b8bd
fix: update links for dev docs (#62758)
* fix: license checker info is in docs-legacy

* fix: update remaining dev links
2024-05-17 13:47:34 +02:00
Taiyab Raja
4b91a49999
Svelte: Increase search suggestions font size (#62724)
Increase search suggestions font size.
2024-05-16 20:07:03 +01:00
Camden Cheek
50f13cd418
Svelte: update navigation bar for dotcom deployment (#62682)
This updates the navigation bar in svelte to show the dotcom-specific nav bar on dotcom (whenever svelte is enabled there).
2024-05-16 14:55:26 -04:00
Camden Cheek
d84fdc55ad
Web: add mermaid diagram rendering (#62678)
This adds rendering for mermaid diagrams to the web app (both React and Svelte). We do not do this on the backend because mermaid is a JS library.
2024-05-16 14:54:43 -04:00
Felix Kling
3f5028cc20
svelte: Show correct keyboard shortcut on Linux in "search files" button (#62729) 2024-05-16 18:21:48 +02:00
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
David Veszelovszki
aae97ad078
SSC: Refactor team management (#62694) 2024-05-16 12:46:12 +00:00
Felix Kling
78a995831f
svelte: Fix various z-index/layering issues (#62726)
While looking into #62713 I stumbled upon two z-index issues. This
commit removes a bunch of z-index settings to simplifying layering.

- Instead of setting a z-index on the header to make the sidebar
  navigation work, we can "portal" the sidebar to the end of the
  document.
- Likewise the repo search input is portalled to ensure that it renders
  above all other content.
2024-05-16 14:30:23 +02:00
Michael Bahr
09da22edb7
fix: update search timeout docs (#62692) 2024-05-15 17:32:54 +01:00
Vova Kulikov
acc4d4cd11
Svelte: Fix global header navigation layers (#62697)
Fix global header navigation layers
2024-05-15 17:32:54 +01:00
Camden Cheek
7e2d0bf0d8
Svelte: follow up on display limit TODO (#62681)
This updates the svelte webapp to respect the new search.displayLimit.
2024-05-15 09:44:05 -04:00
Vova Kulikov
cb7b38e594
Svelte: First run on file tree visual update (#62585)
* First run on file tree visual update

* Fix spacings and colors for the file tree items

* Fix spacing for nested levels

* Add "move to scope" feature to the file tree

* Fix go to the root repository and improve move to scope transition

* Add a comment about resetting the cache before go to the root

* Move root button to the first row

* Add fixes by PR review comments

* Fix fuzzy finder state

* Fix ts problems

* Fix width layout problem for deep nested items
2024-05-15 14:52:15 +02:00
David Veszelovszki
99ebb4f89a
SSC: Teams and Invites: Create "Manage team" page (#62453) 2024-05-15 08:01:45 +00:00
Vova Kulikov
b19d5de4ca
Revert "Svelte [RepoPopover]: Instantiate the RepoPopover result across the web-app (#62684)
Revert "Svelte [RepoPopover]: Instantiate the RepoPopover result across the web-app (#61989)"

This reverts commit 0d8003f655.
2024-05-15 03:48:13 +02:00
Namit Chandwani
111503d2ad
feat: make display limit configurable from user settings (#60761)
- On the frontend:
	- Added a new field named `search.displayLimit` to the User settings
	- Started using the `search.displayLimit` value while performing stream search
- On the backend:
	- No changes
---------

Co-authored-by: Stefan Hengl <stefan@sourcegraph.com>
2024-05-14 13:04:34 -07:00
Felix Kling
196d3f6446
web: Cycle through in-file search results when pressing the numpad enter key (#62665)
We already cycle through results when pressing the "normal" Enter key.
This didn't work for the numpad enter key because `event.code` reports
`NumpadEnter`, not `Enter`. `event.key` returns the same value for both
keys.

This was adjusted in response to customer feedback.
2024-05-14 15:42:54 +00:00
Jason Hawk Harris
0d8003f655
Svelte [RepoPopover]: Instantiate the RepoPopover result across the web-app (#61989)
Instantiate RepoPopover.
2024-05-14 15:17:47 +00:00
Ólafur Páll Geirsson
f2bfaa39e9
LLM Models: add GPT-4o support (#62639)
Fixes https://linear.app/sourcegraph/issue/PRIME-236/enable-gpt-4o-in-gateway

Previously, we only supported GPT-4 Turbo and GPT-3.5 for chat. This PR
adds additional support for the new GPT-4o model.
2024-05-13 14:06:25 -07:00
Camden Cheek
63680e8ea1
Python notebooks: fix anchor offset (#62637)
This fixes an issue with Jupyter notebook rendering where the offset from the anchor can clip the left side of the header text. The issue is that we use margin-left: 1rem; to offset the anchor, but the anchor isn't guaranteed to be exactly 1rem wide. This makes the relationship explicit and adds a comment that those are linked.
2024-05-13 17:38:37 +00:00
Petri-Johan Last
68fe349b01
Check for ClientID when matching auth provider to user external account (#62631) 2024-05-13 17:02:51 +02:00
gitstart-app[bot]
ab575f8197
PLG-590 - Add 16px margin between the "$9/month" and CTA (#62588) 2024-05-13 12:23:43 +02:00
Camden Cheek
9ea7adc82b
Web: small style fix for jupyter notebooks (#62605) 2024-05-10 21:56:28 +00:00
Camden Cheek
a4a1111c56
Render Jupyter notebooks (#62583)
Adds basic Jupyter notebook rendering to the file view. It does not include math rendering, only basic block rendering.
2024-05-10 12:21:10 -04:00
Vova Kulikov
7f9549efbf
[Svelte]: Hide suggestion UI after query was submitted (#62574) 2024-05-10 11:05:51 -04:00
Camden Cheek
d7dc2b9d9a
Svelte: implement symbol redesign (#62473) 2024-05-09 15:22:49 +00:00
Taras Yemets
23a2cea646
Create a shared Cody Ignore dataset (#61968) 2024-05-09 13:18:35 +00:00
Taiyab Raja
9c8247ce5a
Svelte: Styling updates to search filters (#62536)
* Styling updates to search filters.

* Help footer styling updates.

* Section gap reduced to bring filter group heading and list together.
2024-05-08 21:33:27 +01:00
Dan Adler
13d04b2fd9
v2t: add v2t to client/branded (#62364) 2024-05-08 10:25:09 -07:00
Felix Kling
97706f7f84
svelte: First pass on fuzzy finder (#62494)
This commit adds a first version of the fuzzy finder.

Supported features:

- Repos, symbols, files search
- Automatic scoping of files and symbol search to current repository
- Activting search modes via keyboard shortcuts
- Keyboard support

Not yet supported:

- "All" search
- Result counts
- Scope toggle (i.e. search all files even when inside repository)
- Full a11y support

Additional changes:

- Introduced separate tab headers component. In this case I wanted to
  reuse the same panel/UI and only change the data source.
- Added a function for formatting keyboard shortcuts that work with our
  hotkey implementation.

Follow up work:

- Cleanup and tweak sources (matching, ranking, etc)
- Design updates
- Work on "not yet supported" items
2024-05-08 18:21:12 +02:00
Felix Kling
4df95dcfee
svelte: Fix file tree behavior (#62538)
While working on #62494 I noticed that the file tree didn't work as
expected.
In particular, when being at the repo root and navigating to a file via
the fuzzy finder the file tree would  switch to the parent directory,
just like as if the file was directly navigated to.

However, what should happen is that the tree expands all directories to
reveal the file, because the repo root is the top level directory and we
should always be showing the most top level directory that was visited.

The issue is that we are not properly detecting the repo root level (I
think we switched from using `'.'` to `''` at some point). To avoid this
problem I'm now using a constant instead.

I also changed how the tree entries are scrolled into view. The current
solution doesn't work for deeply nested entries because at the time the
scroll logic is invoked the entry hasn't been loaded yet.
By moving the logic to the node it can scroll itself into view when it's
available.

The waterfall loading nature of the file tree also became much more
apparent. We can avoid this by using making use of the `ancestors` field
but that needs to be done in a separate PR because that entails larger
changes.
2024-05-08 17:07:26 +02:00
Taras Yemets
4c0399d3f9
Cody Ignore: use "cache-and-network" fetch policy for context filters query (#62545) 2024-05-08 14:32:25 +00:00
Felix Kling
c1410f0f3c
svelte: Reduce imported global CSS (#62457)
Until now we've simply imported the global `base.scss` file, which in
turn imports a bunch of other files and defines global CSS classes. Many
(most?) of them are actually not used.

This commit reduces to the number of imported files to the ones that
contain styles that are used. My methodology was to inspect every
file that `base.scss` imports and find out whether it defines custom
properties (variables) or global classes. In some cases I extracted
variables into their own files.
2024-05-08 15:51:31 +02:00
Dan Adler
ee376b66e7
v2t: add v2t to src/teams (#61808) 2024-05-08 13:59:27 +02:00
Taiyab Raja
c3f259c34a
Svelte: Visual updates to diff summary (#62534)
* Color change on neutral diff square.

* Bold diff summary font weight.

* Margin added between number and squares in diff summary.
2024-05-08 11:52:13 +01:00
Gabe Torres
99f49a46c9
Add access request enabled check in backend redirect (#62472)
* add accessrequest check in backend

* update tests

* remove debug

* remove unused test

* update comment
2024-05-07 09:58:41 -07:00
Chris Smith
992930f830
Migrate "New Cody Subscription" page (#62322)
* Wire 'frontendCodyProConfig' to frontend

* Register /cody/manage/subscription/new

* Add 'cody-enable-embedded-cody-pro-ui' feature flag

* Add NewCodyProSubscriptionPage

* Run bazel generate, lint

* Address PR feedback

* Remove debugging line

* Address PR feedback

* Run `sg lint` and friends
2024-05-07 09:14:20 -07:00
Camden Cheek
7a32f4876d
Svelte: fix badge centering (#62474)
Some changes in text size made it obvious that we were not correctly centering the badge number. This fixes it by adding display: contents to the wrapping span that is just used for targeting an override. This way, the flexbox aligns items centered as intended.

Co-authored-by: Felix Kling <felix@felix-kling.de>
2024-05-07 16:14:02 +00:00
Vova Kulikov
107b79b80b
[Svelte]: Fix blob content panels css selectors (#62486)
Fix panel css selectors
2024-05-07 13:59:00 +02:00
Felix Kling
c8cb66a400
svelte: Enable repo routes by default (#62374)
This commit enables the following routes via the `web-next-rollout`
flag:

- repo home
- blob
- file
- branches
- tags
- commits
- commit
2024-05-07 11:11:29 +00:00
Vova Kulikov
a095bfe462
[Svelte]: Fix default blob page panel distribution (#62478) 2024-05-07 12:39:57 +02:00