Skip to content

Commit f9b99ec

Browse files
arunpatroramisbahi
andauthored
clean repo (#12)
This PR is to clean the repo. This is ongoing work to sanitize the Branches repo. --------- Co-authored-by: Rami Sbahi <[email protected]>
1 parent c3c326a commit f9b99ec

13 files changed

+108
-107
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25-
.env
25+
.env
26+
.vercel

CONTRIBUTING.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Contributing to Flux
1+
## Contributing to Branches
22

3-
Thanks for your interest in improving Flux!
3+
Thanks for your interest in improving Branches!
44

55
There are multiple opportunities to contribute at any level. It doesn't matter if you are just getting started with Rust or are the most weathered expert, we can use your help.
66

@@ -11,7 +11,7 @@ It should be considered as a guide to help you navigate the process.
1111

1212
### Code of Conduct
1313

14-
Flux adheres to the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) (even though it's not a Rust project). This code of conduct describes the _minimum_ behavior expected from all contributors.
14+
Branches adheres to the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct) (even though it's not a Rust project). This code of conduct describes the _minimum_ behavior expected from all contributors.
1515

1616
Instances of violations of the Code of Conduct can be reported by contacting the team at [[email protected]](mailto:[email protected]).
1717

@@ -20,7 +20,7 @@ Instances of violations of the Code of Conduct can be reported by contacting the
2020
There are fundamentally four ways an individual can contribute:
2121

2222
1. **By opening an issue:** For example, if you believe that you have uncovered a bug
23-
in Flux, creating a new issue in the issue tracker is the way to report it.
23+
in Branches, creating a new issue in the issue tracker is the way to report it.
2424
2. **By adding context:** Providing additional context to existing issues,
2525
such as screenshots, code snippets and helps resolve issues.
2626
3. **By resolving issues:** Typically this is done in the form of either
@@ -55,7 +55,7 @@ If you have examples of other tools that have the feature you are requesting, pl
5555

5656
### Resolving an issue
5757

58-
Pull requests are the way concrete changes are made to the code and dependencies of Flux.
58+
Pull requests are the way concrete changes are made to the code and dependencies of Branches.
5959

6060
Even tiny pull requests, like fixing wording, are greatly appreciated. Before making a large change, it is usually
6161
a good idea to first open an issue describing the change to solicit feedback and guidance. This will increase
@@ -82,7 +82,7 @@ Keep an eye out for comments from code owners to provide guidance on conflicting
8282

8383
#### Reviewing pull requests
8484

85-
**Any Flux community member is welcome to review any pull request**.
85+
**Any Branches community member is welcome to review any pull request**.
8686

8787
All contributors who choose to review and provide feedback on pull requests have a responsibility to both the project and individual making the contribution. Reviews and feedback must be helpful, insightful, and geared towards improving the contribution as opposed to simply blocking it. If there are reasons why you feel the PR should not be merged, explain what those are. Do not expect to be able to block a PR from advancing simply because you say "no" without giving an explanation. Be open to having your mind changed. Be open to working _with_ the contributor to make the pull request better.
8888

@@ -98,8 +98,8 @@ It is tempting to micro-optimize and make everything about relative performance,
9898

9999
Focus first on the most significant aspects of the change:
100100

101-
1. Does this change make sense for Flux?
102-
2. Does this change make Flux better, even if only incrementally?
101+
1. Does this change make sense for Branches?
102+
2. Does this change make Branches better, even if only incrementally?
103103
3. Are there clear bugs or larger scale issues that need attending?
104104
4. Are the commit messages readable and correct? If it contains a breaking change, is it clear enough?
105105

@@ -109,15 +109,15 @@ When changes are necessary, _request_ them, do not _demand_ them, and **do not a
109109

110110
Specific performance optimization techniques, coding styles and conventions change over time. The first impression you give to a new contributor never does.
111111

112-
Nits (requests for small changes that are not essential) are fine, but try to avoid stalling the pull request. Most nits can typically be fixed by the Flux maintainers merging the pull request, but they can also be an opportunity for the contributor to learn a bit more about the project.
112+
Nits (requests for small changes that are not essential) are fine, but try to avoid stalling the pull request. Most nits can typically be fixed by the Branches maintainers merging the pull request, but they can also be an opportunity for the contributor to learn a bit more about the project.
113113

114114
It is always good to clearly indicate nits when you comment, e.g.: `nit: change foo() to bar(). But this is not blocking`.
115115

116116
If your comments were addressed but were not folded after new commits, or if they proved to be mistaken, please, hide them with the appropriate reason to keep the conversation flow concise and relevant.
117117

118118
##### Be aware of the person behind the code
119119

120-
Be aware that _how_ you communicate requests and reviews in your feedback can have a significant impact on the success of the pull request. Yes, we may merge a particular change that makes Flux better, but the individual might just not want to have anything to do with Flux ever again. The goal is not just having good code.
120+
Be aware that _how_ you communicate requests and reviews in your feedback can have a significant impact on the success of the pull request. Yes, we may merge a particular change that makes Branches better, but the individual might just not want to have anything to do with Branches ever again. The goal is not just having good code.
121121

122122
##### Abandoned or stale pull requests
123123

src/components/App.tsx

+26-26
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ import {
1212
SAVED_CHAT_SIZE_LOCAL_STORAGE_KEY,
1313
} from "../utils/constants";
1414
import { useDebouncedEffect } from "../utils/debounce";
15-
import { newFluxEdge } from "../utils/fluxEdge";
15+
import { newBranchesEdge } from "../utils/branchesEdge";
1616
import {
17-
getFluxNode,
18-
newFluxNode,
19-
appendTextToFluxNodeAsGPT,
20-
getFluxNodeLineage,
21-
modifyFluxNodeText,
17+
getBranchesNode,
18+
newBranchesNode,
19+
appendTextToBranchesNodeAsGPT,
20+
getBranchesNodeLineage,
21+
modifyBranchesNodeText,
2222
markOnlyNodeAsSelected,
2323
getConnectionAllowed,
24-
} from "../utils/fluxNode";
24+
} from "../utils/branchesNode";
2525
import { useLocalStorage } from "../utils/lstore";
2626
import { getAvailableChatModels } from "../utils/models";
2727
import { generateNodeId, generateStreamId } from "../utils/nodeId";
@@ -34,7 +34,7 @@ import { resetURL } from "../utils/qparams";
3434
import { useDebouncedWindowResize } from "../utils/resize";
3535
import {
3636
ToTNodeData,
37-
FluxNodeType,
37+
BranchesNodeType,
3838
Settings,
3939
HumanEvalProblemsType,
4040
} from "../utils/types";
@@ -71,7 +71,7 @@ import ReactFlow, {
7171
import "reactflow/dist/style.css";
7272
import { yieldStream } from "yield-stream";
7373
import { treeDemo } from "./tree";
74-
import { getFluxNodeColor } from "../utils/color";
74+
import { getBranchesNodeColor } from "../utils/color";
7575
import { getEncoding, encodingForModel } from "js-tiktoken";
7676

7777
const HUMAN_EVAL_PROBLEMS = rawHumanEvalProblems as HumanEvalProblemsType;
@@ -219,17 +219,17 @@ function App() {
219219
const temp = settings.temp;
220220
const model = settings.model;
221221
const parentNode = selectedNodeLineage[0];
222-
const submittedNode = getFluxNode(nodes, parentNode.id)!;
222+
const submittedNode = getBranchesNode(nodes, parentNode.id)!;
223223

224224
console.log("current node", submittedNode);
225225

226226
type SetNodes = React.Dispatch<React.SetStateAction<Node[]>>;
227227
type SetEdges = React.Dispatch<React.SetStateAction<Edge[]>>;
228-
type FluxNodeInput = {
228+
type BranchesNodeInput = {
229229
id?: string;
230230
x: number;
231231
y: number;
232-
fluxNodeType: FluxNodeType;
232+
branchesNodeType: BranchesNodeType;
233233
input: string;
234234
text: string;
235235
streamId?: string;
@@ -239,16 +239,16 @@ function App() {
239239
style: any;
240240
explanations: any[];
241241
};
242-
type FluxEdgeInput = {
242+
type BranchesEdgeInput = {
243243
source: string;
244244
target: string;
245245
animated: boolean;
246246
}
247247

248248
const createNewNodeAndEdge = (
249249
currentNode: Node,
250-
newFluxNode: (node: FluxNodeInput) => Node,
251-
newFluxEdge: (node: FluxEdgeInput) => Edge,
250+
newBranchesNode: (node: BranchesNodeInput) => Node,
251+
newBranchesEdge: (node: BranchesEdgeInput) => Edge,
252252
setNodes: SetNodes,
253253
setEdges: SetEdges,
254254
streamId: string,
@@ -264,19 +264,19 @@ function App() {
264264
}
265265

266266
// Create a new node using the currentErrors
267-
const newNode = newFluxNode({
267+
const newNode = newBranchesNode({
268268
id: currentChildNodeId,
269269
x: matchingNode.position.x + 10,
270270
y: matchingNode.position.y + 100,
271-
fluxNodeType: FluxNodeType.GPT,
271+
branchesNodeType: BranchesNodeType.GPT,
272272
input: matchingNode.data.input,
273273
text: "",
274274
streamId,
275275
steps: [...matchingNode.data.steps, ""],
276276
solutions: isSolutionNode
277277
? [...matchingNode.data.solutions, ""]
278278
: [...matchingNode.data.solutions],
279-
style: { background: getFluxNodeColor(!isSolutionNode, true, false, true, 0) },
279+
style: { background: getBranchesNodeColor(!isSolutionNode, true, false, true, 0) },
280280
errors: [...matchingNode.data.errors],
281281
explanations: isSolutionNode
282282
? [...matchingNode.data.explanations]
@@ -290,7 +290,7 @@ function App() {
290290

291291
setEdges((prevEdges) => [
292292
...prevEdges,
293-
newFluxEdge({
293+
newBranchesEdge({
294294
source: currentNode.id,
295295
target: currentChildNodeId,
296296
animated: true,
@@ -312,7 +312,7 @@ function App() {
312312
return {
313313
...node,
314314
style: {
315-
background: getFluxNodeColor(
315+
background: getBranchesNodeColor(
316316
isExplanation || false,
317317
false,
318318
node.data.isTerminal || false,
@@ -509,7 +509,7 @@ function App() {
509509
modifiedNode = {
510510
...node,
511511
style: {
512-
background: getFluxNodeColor(
512+
background: getBranchesNodeColor(
513513
isExplanation,
514514
false,
515515
isTerminal,
@@ -596,8 +596,8 @@ function App() {
596596
if (isNewNode) {
597597
createNewNodeAndEdge(
598598
node,
599-
newFluxNode,
600-
newFluxEdge,
599+
newBranchesNode,
600+
newBranchesEdge,
601601
setNodes,
602602
setEdges,
603603
streamId,
@@ -611,7 +611,7 @@ function App() {
611611
currentText += chars;
612612

613613
setNodes((prevNodes: Node<ToTNodeData>[]) => {
614-
return appendTextToFluxNodeAsGPT(
614+
return appendTextToBranchesNodeAsGPT(
615615
prevNodes,
616616
{
617617
id: currentChildNode?.id!,
@@ -679,7 +679,7 @@ function App() {
679679
const [selectedNodeId, setSelectedNodeId] = useState<string | null>(null);
680680

681681
const selectedNodeLineage =
682-
selectedNodeId !== null ? getFluxNodeLineage(nodes, edges, selectedNodeId) : [];
682+
selectedNodeId !== null ? getBranchesNodeLineage(nodes, edges, selectedNodeId) : [];
683683

684684
/*//////////////////////////////////////////////////////////////
685685
NODE MUTATION CALLBACKS
@@ -971,7 +971,7 @@ function App() {
971971
submitPrompt={submitPrompt}
972972
onPromptType={(text: string) => {
973973
setNodes((nodes) =>
974-
modifyFluxNodeText(nodes, {
974+
modifyBranchesNodeText(nodes, {
975975
asHuman: true,
976976
id: selectedNodeId!,
977977
text,

src/components/NodeInfo.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { CheckIcon } from "@chakra-ui/icons";
1818
import { MdCheck, MdQuestionMark, MdClose, MdThumbUpOffAlt } from "react-icons/md";
1919
import { Settings, ToTNodeData, HumanEvalProblemsType } from "../utils/types";
2020
import { Prompt } from "./Prompt";
21-
import { getFluxNodeParent } from "../utils/fluxNode";
21+
import { getBranchesNodeParent } from "../utils/branchesNode";
2222
import { useEffect, useState } from "react";
2323
import { Markdown } from "./utils/Markdown";
2424
import { Row } from "../utils/chakra";
@@ -87,7 +87,7 @@ export function NodeInfo({
8787

8888
useEffect(() => {
8989
const newSelectedNodeParent =
90-
selectedNodeId !== null ? getFluxNodeParent(nodes, edges, selectedNodeId) : null;
90+
selectedNodeId !== null ? getBranchesNodeParent(nodes, edges, selectedNodeId) : null;
9191
setSelectedNodeParent(newSelectedNodeParent);
9292
}, [selectedNodeId, nodes, edges]);
9393

@@ -137,7 +137,7 @@ export function NodeInfo({
137137
_hover={{
138138
boxShadow: "0 0 0 0.5px #1a192b", // isLast ? "none" : "0 0 0 0.5px #1a192b",
139139
}}
140-
// borderColor={getFluxNodeTypeDarkColor(data.fluxNodeType)}
140+
// borderColor={getBranchesNodeTypeDarkColor(data.branchesNodeType)}
141141
// position="relative"
142142
//onMouseEnter={() => setHoveredNodeId(node.id)}
143143
///onMouseLeave={() => setHoveredNodeId(null)}

src/components/Prompt.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { MIXPANEL_TOKEN } from "../main";
22
import { Row, Center, Column } from "../utils/chakra";
3-
import { getFluxNodeColor, getFluxNodeTypeDarkColor } from "../utils/color";
4-
import { setFluxNodeStreamId } from "../utils/fluxNode";
5-
import { ToTNodeData, FluxNodeType, Settings } from "../utils/types";
3+
import { getBranchesNodeColor, getBranchesNodeTypeDarkColor } from "../utils/color";
4+
import { setBranchesNodeStreamId } from "../utils/branchesNode";
5+
import { ToTNodeData, BranchesNodeType, Settings } from "../utils/types";
66
import { BigButton } from "./utils/BigButton";
77
import { Markdown } from "./utils/Markdown";
88
import { NotAllowedIcon } from "@chakra-ui/icons";
@@ -26,7 +26,7 @@ export function Prompt({
2626

2727
// const promptNode = lineage[0];
2828

29-
// const promptNodeType = selectedNode.data.fluxNodeType;
29+
// const promptNodeType = selectedNode.data.branchesNodeType;
3030

3131
const onMainButtonClick = () => {
3232
submitPrompt();
@@ -35,7 +35,7 @@ export function Prompt({
3535
const stopGenerating = () => {
3636
// Reset the stream id.
3737
setNodes((nodes) =>
38-
setFluxNodeStreamId(nodes, { id: selectedNode?.id ?? '', streamId: undefined })
38+
setBranchesNodeStreamId(nodes, { id: selectedNode?.id ?? '', streamId: undefined })
3939
);
4040

4141
if (MIXPANEL_TOKEN) mixpanel.track("Stopped generating response");
@@ -93,7 +93,7 @@ export function Prompt({
9393
_hover={{
9494
boxShadow: "0 0 0 0.5px #1a192b", // isLast ? "none" : "0 0 0 0.5px #1a192b",
9595
}}
96-
borderColor={getFluxNodeTypeDarkColor(data.fluxNodeType)}
96+
borderColor={getBranchesNodeTypeDarkColor(data.branchesNodeType)}
9797
position="relative"
9898
//onMouseEnter={() => setHoveredNodeId(node.id)}
9999
///onMouseLeave={() => setHoveredNodeId(null)}
@@ -180,7 +180,7 @@ export function Prompt({
180180
_hover={{
181181
boxShadow: "0 0 0 0.5px #1a192b", // isLast ? "none" : "0 0 0 0.5px #1a192b",
182182
}}
183-
borderColor={getFluxNodeTypeDarkColor(data.fluxNodeType)}
183+
borderColor={getBranchesNodeTypeDarkColor(data.branchesNodeType)}
184184
position="relative"
185185
bg={currExplanationNode?.style?.background as string || "#FFFFFF"}
186186
key={currExplanationNode?.id}
@@ -220,7 +220,7 @@ export function Prompt({
220220
<BigButton
221221
tooltip=""
222222
onClick={onMainButtonClick}
223-
color={getFluxNodeTypeDarkColor(FluxNodeType.User)}
223+
color={getBranchesNodeTypeDarkColor(BranchesNodeType.User)}
224224
width="100%"
225225
height="100%"
226226
fontSize="lg"

src/components/modals/SettingsModal.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { MIXPANEL_TOKEN } from "../../main";
2-
import { getFluxNodeTypeDarkColor } from "../../utils/color";
2+
import { getBranchesNodeTypeDarkColor } from "../../utils/color";
33
import { DEFAULT_SETTINGS } from "../../utils/constants";
4-
import { Settings, FluxNodeType } from "../../utils/types";
4+
import { Settings, BranchesNodeType } from "../../utils/types";
55
import { APIKeyInput } from "../utils/APIKeyInput";
66
import { LabeledSelect, LabeledSlider } from "../utils/LabeledInputs";
77

@@ -99,7 +99,7 @@ export const SettingsModal = memo(function SettingsModal({
9999

100100
if (MIXPANEL_TOKEN) mixpanel.track("Changed temperature");
101101
}}
102-
color={getFluxNodeTypeDarkColor(FluxNodeType.User)}
102+
color={getBranchesNodeTypeDarkColor(BranchesNodeType.User)}
103103
max={1.25}
104104
min={0}
105105
step={0.01}
@@ -114,7 +114,7 @@ export const SettingsModal = memo(function SettingsModal({
114114

115115
if (MIXPANEL_TOKEN) mixpanel.track("Changed answer fanout");
116116
}}
117-
color={getFluxNodeTypeDarkColor(FluxNodeType.User)}
117+
color={getBranchesNodeTypeDarkColor(BranchesNodeType.User)}
118118
max={10}
119119
min={1}
120120
step={1}
@@ -129,7 +129,7 @@ export const SettingsModal = memo(function SettingsModal({
129129

130130
if (MIXPANEL_TOKEN) mixpanel.track("Changed explanation fanout");
131131
}}
132-
color={getFluxNodeTypeDarkColor(FluxNodeType.User)}
132+
color={getBranchesNodeTypeDarkColor(BranchesNodeType.User)}
133133
max={10}
134134
min={1}
135135
step={1}

src/components/nodes/LabelUpdaterNode.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { MIXPANEL_TOKEN } from "../../main";
22
import { Row } from "../../utils/chakra";
3-
import { modifyFluxNodeLabel, modifyReactFlowNodeProperties } from "../../utils/fluxNode";
3+
import { modifyBranchesNodeLabel, modifyReactFlowNodeProperties } from "../../utils/branchesNode";
44
import { ToTNodeData } from "../../utils/types";
55
import { Box, Input, Tooltip } from "@chakra-ui/react";
66
import mixpanel from "mixpanel-browser";
@@ -48,7 +48,7 @@ export function LabelUpdaterNode({
4848

4949
const submit = () => {
5050
setNodes((nodes) =>
51-
modifyFluxNodeLabel(nodes, {
51+
modifyBranchesNodeLabel(nodes, {
5252
id,
5353
label: renameLabel,
5454
})

0 commit comments

Comments
 (0)