WIP: comment out checkpoint logic

This commit is contained in:
Test 2024-11-20 17:38:29 -08:00
parent f90d4bc502
commit b4d364f761
8 changed files with 46 additions and 33 deletions

View file

@ -129,18 +129,26 @@ export function History() {
return (
<Fragment key={index}>
{index === 0 && date > yesterday && (
<tr className={HEADER_CLASS}>Today</tr>
<tr className={HEADER_CLASS}>
<td colSpan={3}>Today</td>
</tr>
)}
{date < yesterday &&
date > lastWeek &&
prevDate > yesterday && (
<tr className={HEADER_CLASS}>This Week</tr>
<tr className={HEADER_CLASS}>
<td colSpan={3}>This Week</td>
</tr>
)}
{date < lastWeek && date > lastMonth && prevDate > lastWeek && (
<tr className={HEADER_CLASS}>This Month</tr>
<tr className={HEADER_CLASS}>
<td colSpan={3}>This Month</td>
</tr>
)}
{date < lastMonth && prevDate > lastMonth && (
<tr className={HEADER_CLASS}>Older</tr>
<tr className={HEADER_CLASS}>
<td colSpan={3}>Older</td>
</tr>
)}
<HistoryTableRow

View file

@ -12,7 +12,6 @@ import {
setEditStatus,
addCodeToEdit,
focusEdit,
setIsInEditMode,
} from "../redux/slices/editModeState";
import { setShowDialog } from "../redux/slices/uiStateSlice";
import {
@ -193,9 +192,8 @@ const Layout = () => {
useWebviewListener(
"focusEdit",
async (payload) => {
dispatch(setIsInEditMode(true));
dispatch(focusEdit(payload));
async () => {
dispatch(focusEdit());
navigate("/edit");
},
[navigate],

View file

@ -13,9 +13,11 @@ export interface EditActionsProps {
}
export default function EditActions({ index, item }: EditActionsProps) {
const curCheckpointIndex = useSelector(
(store: RootState) => store.state.curCheckpointIndex,
);
// const curCheckpointIndex = useSelector(
// (store: RootState) => store.state.curCheckpointIndex,
// );
const active = useSelector((state: RootState) => state.state.active);
const applyStates = useSelector(
(state: RootState) => state.state.applyStates,
@ -29,10 +31,10 @@ export default function EditActions({ index, item }: EditActionsProps) {
(state) => state.status === "closed",
);
const isCurCheckpoint = Math.floor(index / 2) === curCheckpointIndex;
// const isCurCheckpoint = Math.floor(index / 2) === curCheckpointIndex;
const hasPendingApplies = pendingApplyStates.length > 0;
console.log({ isCurCheckpoint, curCheckpointIndex, index });
if (active) return;
return (
<div
@ -40,14 +42,21 @@ export default function EditActions({ index, item }: EditActionsProps) {
>
<div className="flex-1" />
{isCurCheckpoint && (
{/* {isCurCheckpoint && (
<div className="flex-2 flex justify-center">
{hasPendingApplies && (
<AcceptRejectAllButtons pendingApplyStates={pendingApplyStates} />
)}
{hasClosedAllStreams && <UndoAndRedoButtons />}
</div>
)}
)} */}
<div className="flex-2 flex justify-center">
{hasPendingApplies && (
<AcceptRejectAllButtons pendingApplyStates={pendingApplyStates} />
)}
{/* {hasClosedAllStreams && <UndoAndRedoButtons />} */}
</div>
<div className="flex flex-1 justify-end">
<CopyIconButton

View file

@ -36,8 +36,8 @@ export default function StepContainer(props: StepContainerProps) {
);
const uiConfig = useUIConfig();
const shouldHideActions = active && props.isLast;
const isStepAheadOfCurCheckpoint =
isInEditMode && Math.floor(props.index / 2) > curCheckpointIndex;
// const isStepAheadOfCurCheckpoint =
// isInEditMode && Math.floor(props.index / 2) > curCheckpointIndex;
useEffect(() => {
if (!active) {
@ -76,7 +76,7 @@ export default function StepContainer(props: StepContainerProps) {
return (
<div
className={isStepAheadOfCurCheckpoint ? "opacity-25" : "relative"}
// className={isStepAheadOfCurCheckpoint ? "opacity-25" : "relative"}
style={{
minHeight: props.isLast ? "50vh" : 0,
}}

View file

@ -14,7 +14,7 @@ export const CodeBlockComponent = (props: any) => {
const isFirstContextItem = false; // TODO: fix this, decided not worth the insane renders for now
return (
<NodeViewWrapper className="code-block-with-content" as="p">
<NodeViewWrapper className="code-block-with-content" as="div">
<CodeSnippetPreview
borderColor={
isFirstContextItem

View file

@ -25,7 +25,7 @@ function FilenameLink({ rif }: FilenameLinkProps) {
onClick={onClick}
>
<FileIcon filename={rif.filepath} height="20px" width="20px" />
<span className="align-middle underline underline-offset-2">
<span className="align-baseline underline underline-offset-2 mb-0.5">
{getBasename(rif.filepath)}
</span>
</span>

View file

@ -36,14 +36,16 @@ export default function WorkingSet() {
}
}
const codeToEditItems = editModeState.codeToEdit.map((code, i) => (
<CodeToEditListItem
key={code.filepath + i}
code={code}
onDelete={onDelete}
onClickFilename={onClickFilename}
/>
));
const codeToEditItems = [...editModeState.codeToEdit]
.reverse()
.map((code, i) => (
<CodeToEditListItem
key={code.filepath + i}
code={code}
onDelete={onDelete}
onClickFilename={onClickFilename}
/>
));
return (
<div

View file

@ -31,6 +31,7 @@ export const editModeStateSlice = createSlice({
state.fileAfterEdit = undefined;
},
focusEdit: (state) => {
state.isInEditMode = true;
state.editStatus = "not-started";
state.previousInputs = [];
state.fileAfterEdit = undefined;
@ -40,7 +41,6 @@ export const editModeStateSlice = createSlice({
state.editStatus = "streaming";
},
removeCodeToEdit: (state, { payload }: PayloadAction<CodeToEdit>) => {
// Remove entry from codeToEdit that doesn't match the payload's filepath and contents
state.codeToEdit = state.codeToEdit.filter(
(entry) =>
!(
@ -96,9 +96,6 @@ export const editModeStateSlice = createSlice({
state.editStatus = "done";
state.previousInputs = [];
},
setIsInEditMode: (state, { payload }: PayloadAction<boolean>) => {
state.isInEditMode = payload;
},
},
});
@ -111,6 +108,5 @@ export const {
removeCodeToEdit,
focusEdit,
clearCodeToEdit,
setIsInEditMode,
} = editModeStateSlice.actions;
export default editModeStateSlice.reducer;