Skip to content

Commit a4a8490

Browse files
authored
Add 0.6.0 remote notes. (#161)
1 parent 63ab63b commit a4a8490

File tree

3 files changed

+13
-31
lines changed

3 files changed

+13
-31
lines changed

src/components/NotesProvider/utils/remoteSources.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ const DEFAULT_SOURCES = [
3737
id: -100,
3838
name: "Changes in v0.5.4",
3939
url: "https://fluffylabs.dev/graypaper-notes/version-0.5.4.json",
40-
isEnabled: true,
40+
isEnabled: false,
4141
versions: ["579bd12e792667c968ab64d07f56c6b7da72b4e2"],
4242
},
43+
{
44+
id: -101,
45+
name: "Changes in v0.6.0",
46+
url: "https://fluffylabs.dev/graypaper-notes/version-0.6.0.json",
47+
isEnabled: true,
48+
versions: ["78ca0a81d8058531c2e2e46235db2b832eae0213"],
49+
},
4350
];
4451

4552
function updateDefaultSources(sources: IRemoteSource[]) {

src/components/RemoteSources/RemoteSources.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export function RemoteSources({ remoteSources, onChange }: RemoteSourcesProps) {
3131
<button onClick={() => setAddingNew(true)}>➕ new source</button>
3232
)}
3333
<hr />
34+
<em>
35+
Disclaimer: the only source of the truth is the Gray Paper. The notes here are shared as-is and are not
36+
guaranteed to be correct.
37+
</em>
38+
<hr />
3439
</>
3540
);
3641
}

src/components/Selection/Selection.tsx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export function Selection({ activeTab, switchTab }: SelectionProps) {
1515
CodeSyncContext,
1616
) as ICodeSyncContext;
1717
const [linkCreated, setLinkCreated] = useState(false);
18-
const [selectionCopied, setSelectionCopied] = useState(false);
1918
const [sectionTitle, setSectionTitle] = useState<string | null>("");
2019
const [subsectionTitle, setSubsectionTitle] = useState<string | null>("");
2120

@@ -40,29 +39,6 @@ export function Selection({ activeTab, switchTab }: SelectionProps) {
4039
window.setTimeout(() => setLinkCreated(false), 2000);
4140
}, [selectedBlocks]);
4241

43-
const openGpt = useCallback(() => {
44-
const text = selectionString;
45-
46-
const prompt = `
47-
Based only on the GrayPaper and within the context of the following quote located on page ${pageNumber}${
48-
sectionTitle !== null ? `, within section ${sectionTitle}` : ""
49-
}${subsectionTitle ? ` (subsection: ${subsectionTitle})` : ""}:
50-
51-
${text}
52-
53-
provide a deep explanation of the above quote with description of all used symbols based on the "Index of Notation" appendix.
54-
`;
55-
window.navigator.clipboard.writeText(prompt);
56-
57-
setSelectionCopied(true);
58-
window.setTimeout(() => setSelectionCopied(false), 2000);
59-
60-
const a = document.createElement("a");
61-
a.target = "_blank";
62-
a.href = "https://chatgpt.com/g/g-ZuDULS0ij-dzemmer";
63-
a.click();
64-
}, [pageNumber, selectionString, sectionTitle, subsectionTitle]);
65-
6642
const openNotes = useCallback(() => {
6743
switchTab("notes");
6844
}, [switchTab]);
@@ -98,12 +74,6 @@ export function Selection({ activeTab, switchTab }: SelectionProps) {
9874
<Button onClick={createLink} tooltip="Create a shareable link to the selected content.">
9975
{linkCreated ? <span>Copied</span> : "Link"}
10076
</Button>
101-
<Button
102-
onClick={openGpt}
103-
tooltip="Open a GrayPaper-specific ChatGPT and copy the prompt with selection to clipboard."
104-
>
105-
{selectionCopied ? <span>Copied</span> : "Explain"}
106-
</Button>
10777
{activeTab !== "notes" && (
10878
<Button onClick={openNotes} tooltip="Create a local note to the selected content.">
10979
Add note

0 commit comments

Comments
 (0)