Skip to content

Commit 27f145d

Browse files
committed
Merge remote-tracking branch 'origin/master' into sso-exclusive-all
2 parents 9c143b4 + a9f5bb1 commit 27f145d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1611
-403
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem. **If the screenshots include text, make sure to also include that text separately so that we can copy and paste it and not have to type it in again!**
25+
26+
27+
28+
**Additional context**
29+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

src/c.js

Lines changed: 0 additions & 123 deletions
This file was deleted.

src/packages/database/postgres-blobs.coffee

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,29 @@ exports.extend_PostgreSQL = (ext) -> class PostgreSQL extends ext
112112
uuid : opts.uuid
113113
cb : (err, _ttl) =>
114114
ttl = _ttl; cb(err)
115+
(cb) =>
116+
# double check that the blob definitely exists and has correct expire
117+
# See discussion at https://github.com/sagemathinc/cocalc/issues/7715
118+
# The problem is that maybe with VERY low probability somehow we extend
119+
# the blob ttl at the same time that we're deleting blobs and the extend
120+
# is too late and does an empty update.
121+
@_query
122+
query : 'SELECT expire FROM blobs'
123+
where : "id = $::UUID" : opts.uuid
124+
cb : (err, x) =>
125+
if err
126+
cb(err)
127+
return
128+
# some consistency checks
129+
rows = x?.rows
130+
if rows.length == 0
131+
cb("blob got removed while saving it")
132+
return
133+
if !opts.ttl and rows[0].expire
134+
cb("blob should have infinite ttl but it has expire set")
135+
return
136+
cb()
137+
115138
], (err) => opts.cb(err, ttl))
116139

117140
# Used internally by save_blob to possibly extend the expire time of a blob.

src/packages/frontend/account/account-preferences.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { Form, Switch, Tooltip } from "antd";
77
import { join } from "path";
8-
98
import { Col, Row } from "@cocalc/frontend/antd-bootstrap";
109
import { redux, useTypedRedux } from "@cocalc/frontend/app-framework";
1110
import { A, Loading } from "@cocalc/frontend/components";
@@ -29,7 +28,7 @@ export const AccountPreferences: React.FC = () => {
2928
const email_address = useTypedRedux("account", "email_address");
3029
const email_address_verified = useTypedRedux(
3130
"account",
32-
"email_address_verified"
31+
"email_address_verified",
3332
);
3433
const passports = useTypedRedux("account", "passports");
3534
const sign_out_error = useTypedRedux("account", "sign_out_error");
@@ -95,7 +94,7 @@ export const AccountPreferences: React.FC = () => {
9594
.getActions("account")
9695
.set_other_settings(
9796
"dark_mode",
98-
!other_settings.get("dark_mode")
97+
!other_settings.get("dark_mode"),
9998
);
10099
}}
101100
style={{

src/packages/frontend/account/actions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ If that doesn't work after a few minutes, try these ${doc_conn} or email ${this.
322322
this.set_account_table({ other_settings: { [name]: value } });
323323
}
324324

325+
set_editor_settings = (name: string, value) => {
326+
this.set_account_table({ editor_settings: { [name]: value } });
327+
};
328+
325329
public set_show_purchase_form(show: boolean) {
326330
// this controlls the default state of the "buy a license" purchase form in account → licenses
327331
// by default, it's not showing up

src/packages/frontend/account/other-settings.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { Card, InputNumber } from "antd";
77
import { Map } from "immutable";
8-
98
import { Checkbox, Panel } from "@cocalc/frontend/antd-bootstrap";
109
import { Rendered, redux, useTypedRedux } from "@cocalc/frontend/app-framework";
1110
import {
@@ -35,6 +34,19 @@ import Tours from "./tours";
3534
import { useLanguageModelSetting } from "./useLanguageModelSetting";
3635
import { UserDefinedLLMComponent } from "./user-defined-llm";
3736

37+
// See https://github.com/sagemathinc/cocalc/issues/5620
38+
// There are weird bugs with relying only on mathjax, whereas our
39+
// implementation of katex with a fallback to mathjax works very well.
40+
// This makes it so katex can't be disabled.
41+
const ALLOW_DISABLE_KATEX = false;
42+
43+
export function katexIsEnabled() {
44+
if (!ALLOW_DISABLE_KATEX) {
45+
return true;
46+
}
47+
return redux.getStore("account")?.getIn(["other_settings", "katex"]) ?? true;
48+
}
49+
3850
interface Props {
3951
other_settings: Map<string, any>;
4052
is_stripe_customer: boolean;
@@ -110,7 +122,10 @@ export function OtherSettings(props: Readonly<Props>): JSX.Element {
110122
}
111123
}
112124

113-
function render_katex(): Rendered {
125+
function render_katex() {
126+
if (!ALLOW_DISABLE_KATEX) {
127+
return null;
128+
}
114129
return (
115130
<Checkbox
116131
checked={!!props.other_settings.get("katex")}

src/packages/frontend/chat/chatroom.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,16 @@ export const ChatRoom: React.FC<Props> = ({ project_id, path }) => {
523523
margin: "0 0 5px 0",
524524
}}
525525
/>
526-
<Button
527-
onClick={on_send_button_click}
528-
disabled={input.trim() === "" || is_uploading}
529-
type="primary"
530-
style={{ height: "47.5px" }}
531-
>
532-
<Icon name="paper-plane" /> Send
533-
</Button>
526+
<Tooltip title={"Send message (shift+enter)"}>
527+
<Button
528+
onClick={on_send_button_click}
529+
disabled={input.trim() === "" || is_uploading}
530+
type="primary"
531+
style={{ height: "47.5px" }}
532+
>
533+
<Icon name="paper-plane" /> Send
534+
</Button>
535+
</Tooltip>
534536
<div style={{ height: "5px" }} />
535537
<Button
536538
onClick={() => actions.set_is_preview(true)}

src/packages/frontend/chat/message.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ export default function Message(props: Readonly<Props>) {
675675
Cancel
676676
</Button>
677677
<Button onClick={sendReply} type="primary">
678-
Send Reply
678+
<Icon name="paper-plane" /> Send
679679
</Button>
680680
<LLMCostEstimationChat
681681
llm_cost={llm_cost_reply}

src/packages/frontend/chat/side-chat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export default function SideChat({ project_id, path, style }: Props) {
159159
type="primary"
160160
>
161161
<Icon name="paper-plane" />
162-
Send Message (shift+enter)
162+
Send
163163
</Button>
164164
</Tooltip>
165165
{/*

0 commit comments

Comments
 (0)