Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3f0ccd1
start react hooks/compiler fixes
dtemkin1 Nov 29, 2025
62cb3b0
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Dec 8, 2025
ff32423
move dep
dtemkin1 Dec 8, 2025
872bff1
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Dec 9, 2025
35b9327
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Feb 20, 2026
db22f7b
remove uneeded dependency
dtemkin1 Feb 20, 2026
9c090f2
fix unit test
dtemkin1 Feb 20, 2026
4ad49d1
up
dtemkin1 Feb 20, 2026
9aa0024
format smh
dtemkin1 Feb 20, 2026
1635cb9
ignore eslint issues (todo: fix later)
dtemkin1 Feb 20, 2026
c9bad40
add @babel/core
dtemkin1 Feb 20, 2026
991f70e
move and update
dtemkin1 Feb 20, 2026
240900e
install and format...
dtemkin1 Feb 20, 2026
8935a61
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Feb 22, 2026
f9bb05d
format
dtemkin1 Feb 22, 2026
8b7843a
force install
dtemkin1 Feb 22, 2026
5c8df15
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Mar 11, 2026
5553a36
format
dtemkin1 Mar 11, 2026
e0f31df
eslint 9
dtemkin1 Mar 11, 2026
04f2fc4
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Apr 16, 2026
2319e2b
forgor this in the merge commit
dtemkin1 Apr 16, 2026
4d248a4
fix (?)
dtemkin1 Apr 16, 2026
8fc964c
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Apr 18, 2026
9c5ad64
fix some bugs
dtemkin1 Apr 18, 2026
1d3cb6c
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Jun 29, 2026
295fc88
format
dtemkin1 Jun 29, 2026
59703a1
Merge branch 'main' of https://github.com/sipb/hydrant into compiler
dtemkin1 Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import globals from "globals";

import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";
// import reactHooks from "eslint-plugin-react-hooks";
import reactHooks from "eslint-plugin-react-hooks";
import vitest from "@vitest/eslint-plugin";
import { reactRefresh } from "eslint-plugin-react-refresh";

Expand All @@ -17,7 +17,7 @@ export default defineConfig(
js.configs.recommended,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
// reactHooks.configs.flat.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite(),
eslintConfigPrettier,
{
Expand Down
75 changes: 75 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"node": "^22.22.0 || >=24"
},
"devDependencies": {
"@babel/core": "^7.29.7",
"@chakra-ui/cli": "^3.36.0",
"@eslint/js": "^10.0.1",
"@react-router/dev": "^8.1.0",
Expand All @@ -59,15 +60,18 @@
"@types/react": "^19.2.17",
"@types/react-dom": "19.2.3",
"@vitest/eslint-plugin": "^1.6.20",
"babel-plugin-react-compiler": "^1.0.0",
Comment thread
dtemkin1 marked this conversation as resolved.
"eslint": "^10.6.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.3",
"globals": "^17.7.0",
"jsdom": "^29.1.1",
"prettier": "^3.9.3",
"typescript": "^6.0.3",
"typescript-eslint": "^8.62.1",
"vite": "^8.1.0",
"vite-plugin-babel": "^1.7.3",
"vitest": "^4.1.9"
}
}
98 changes: 49 additions & 49 deletions src/components/ActivityButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
parseColor,
} from "@chakra-ui/react";
import type { ComponentPropsWithRef, SubmitEventHandler } from "react";
import { useContext, useLayoutEffect, useState } from "react";
import { useContext, useState } from "react";

import { ColorPickerInput } from "./ui/colorpicker-input";

Expand Down Expand Up @@ -74,7 +74,7 @@ function OverrideLocations(props: { secs: Sections }) {
setRoom(secs.roomOverride);
};
const onConfirm = () => {
secs.roomOverride = room.trim();
secs.setRoomOverride(room.trim());
setIsOverriding(false);
state.updateActivities();
};
Expand Down Expand Up @@ -115,6 +115,7 @@ function OverrideLocations(props: { secs: Sections }) {

/** Div containing section manual selection interface. */
function ClassManualSections(props: { cls: Class | PEClass }) {
"use no memo";
const { cls } = props;
const { state } = useContext(HydrantContext);
const genSelected = (cls: Class | PEClass) =>
Expand All @@ -126,26 +127,23 @@ function ClassManualSections(props: { cls: Class | PEClass }) {
: LockOption.Auto,
);
const [selected, setSelected] = useState(genSelected(cls));
useLayoutEffect(() => {
setSelected(genSelected(cls));
}, [cls]);

const RenderOptions = () => {
const getLabel = (sec: SectionLockOption, humanReadable?: boolean) => {
if (sec === LockOption.Auto) {
return humanReadable ? "Auto (default)" : LockOption.Auto;
} else if (sec === LockOption.None) {
return LockOption.None;
} else if (!humanReadable) {
return sec.rawTime;
} else if (sec instanceof PESection) {
return `${sec.sectionNumber}: ${sec.parsedTime}`;
} else {
return sec.parsedTime;
}
};

return (

const getLabel = (sec: SectionLockOption, humanReadable?: boolean) => {
if (sec === LockOption.Auto) {
return humanReadable ? "Auto (default)" : LockOption.Auto;
} else if (sec === LockOption.None) {
return LockOption.None;
} else if (!humanReadable) {
return sec.rawTime;
} else if (sec instanceof PESection) {
return `${sec.sectionNumber}: ${sec.parsedTime}`;
} else {
return sec.parsedTime;
}
};

return (
<Flex>
<>
{cls.sections.map((secs, sectionIndex) => {
const options = [LockOption.Auto, LockOption.None, ...secs.sections];
Expand Down Expand Up @@ -192,12 +190,6 @@ function ClassManualSections(props: { cls: Class | PEClass }) {
);
})}
</>
);
};

return (
<Flex>
<RenderOptions />
</Flex>
);
}
Expand Down Expand Up @@ -257,8 +249,9 @@ function ActivityColor(props: { activity: Activity; onHide: () => void }) {

/** Buttons in class description to add/remove class, and lock sections. */
export function ClassButtons(props: { cls: Class | PEClass }) {
"use no memo";
const { cls } = props;
const { state } = useContext(HydrantContext);
const { state, hydrantState } = useContext(HydrantContext);
const [showManual, setShowManual] = useState(false);
const [showColors, setShowColors] = useState(false);
const isSelected = state.isSelectedActivity(cls);
Expand Down Expand Up @@ -296,7 +289,9 @@ export function ClassButtons(props: { cls: Class | PEClass }) {
</ToggleButton>
)}
</ButtonGroup>
{isSelected && showManual && <ClassManualSections cls={cls} />}
{isSelected && showManual && (
<ClassManualSections cls={cls} key={cls.id + hydrantState.saveId} />
)}
{isSelected && showColors && (
<ActivityColor
activity={cls}
Expand All @@ -309,6 +304,29 @@ export function ClassButtons(props: { cls: Class | PEClass }) {
);
}

const RenderCheckboxes = (props: {
days: Record<string, boolean>;
setDays: React.Dispatch<React.SetStateAction<Record<string, boolean>>>;
}) => {
const { days, setDays } = props;

return (
<>
{WEEKDAY_STRINGS.map((day) => (
<Checkbox
key={day}
checked={days[day]}
onCheckedChange={(e) => {
setDays({ ...days, [day]: !!e.checked });
}}
>
{day}
</Checkbox>
))}
</>
);
};

/** Form to add a timeslot to a custom activity. */
function CustomActivityAddTime(props: { activity: CustomActivity }) {
const { activity } = props;
Expand All @@ -332,24 +350,6 @@ function CustomActivityAddTime(props: { activity: CustomActivity }) {
}
};

const RenderCheckboxes = () => {
return (
<>
{WEEKDAY_STRINGS.map((day) => (
<Checkbox
key={day}
checked={days[day]}
onCheckedChange={(e) => {
setDays({ ...days, [day]: !!e.checked });
}}
>
{day}
</Checkbox>
))}
</>
);
};

const timesCollection = createListCollection({
items: TIMESLOT_STRINGS,
});
Expand Down Expand Up @@ -395,7 +395,7 @@ function CustomActivityAddTime(props: { activity: CustomActivity }) {
Add time
</Button>
<Group wrap="wrap">
<RenderCheckboxes />
<RenderCheckboxes days={days} setDays={setDays} />
</Group>
<Flex align="center" gap={1}>
{renderTimeDropdown("start")} to {renderTimeDropdown("end")}
Expand Down
1 change: 1 addition & 0 deletions src/components/ActivityDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ function ClassDescription(props: { cls: Class }) {

/** Full custom activity description, from title to timeslots. */
function CustomActivityDescription(props: { activity: CustomActivity }) {
"use no memo";
const { activity } = props;
const { state } = useContext(HydrantContext);

Expand Down
4 changes: 2 additions & 2 deletions src/components/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const AnnouncementsBanner = () => {
color="whiteAlpha.900"
_hover={{ bg: "blackAlpha.300" }}
onClick={() => {
state.showBanner = false;
state.setShowBanner(false);
}}
/>
</Flex>
Expand All @@ -58,7 +58,7 @@ export const AnnouncementsBanner = () => {
color="whiteAlpha.900"
_hover={{ bg: "blackAlpha.300" }}
onClick={() => {
state.showBanner = false;
state.setShowBanner(false);
}}
/>
</Float>
Expand Down
5 changes: 3 additions & 2 deletions src/components/ClassTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ function ClassFlags(props: {
/** Callback for updating the grid filter manually. */
updateFilter: () => void;
}) {
"use no memo";
const { setFlagsFilter, updateFilter } = props;
const { state } = useContext(HydrantContext);

Expand All @@ -325,11 +326,11 @@ function ClassFlags(props: {
// this callback needs to get called when the set of classes change, because
// the filter has to change as well
useEffect(() => {
state.fitsScheduleCallback = () => {
state.setFitsScheduleCallback(() => {
if (flags.get("fits")) {
updateFilter();
}
};
});
}, [state, flags, updateFilter]);

const onChange = (flag: Filter, value: boolean) => {
Expand Down
Loading
Loading