cleanup historyview model

This commit is contained in:
Red Adaya 2024-02-08 08:55:56 +08:00
parent 5770e482a1
commit 648d98f065

View File

@ -1,98 +1,26 @@
// Copyright 2023, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import type React from "react";
import * as mobx from "mobx";
import { sprintf } from "sprintf-js";
import { v4 as uuidv4 } from "uuid";
import { boundMethod } from "autobind-decorator";
import { debounce } from "throttle-debounce";
import * as mobxReact from "mobx-react";
import { isBlank } from "../util/util";
import {
handleJsonFetchResponse,
base64ToString,
stringToBase64,
base64ToArray,
genMergeData,
genMergeDataMap,
genMergeSimpleData,
boundInt,
isModKeyPress,
isBlank,
} from "../util/util";
import { TermWrap } from "../plugins/terminal/term";
import { PluginModel } from "../plugins/plugins";
import {
SessionDataType,
LineType,
RemoteType,
HistoryItem,
RemoteInstanceType,
RemotePtrType,
CmdDataType,
FeCmdPacketType,
TermOptsType,
ScreenDataType,
ScreenOptsType,
PtyDataUpdateType,
ModelUpdateType,
UpdateMessage,
InfoType,
UIContextType,
HistoryInfoType,
HistoryQueryOpts,
FeInputPacketType,
RemoteInputPacketType,
ContextMenuOpts,
RendererContext,
RendererModel,
PtyDataType,
BookmarkType,
ClientDataType,
HistoryViewDataType,
AlertMessageType,
HistorySearchParams,
FocusTypeStrs,
ScreenLinesType,
HistoryTypeStrs,
RendererPluginType,
WindowSize,
WebShareOpts,
TermContextUnion,
RemoteEditType,
RemoteViewType,
CommandRtnType,
WebCmd,
WebRemote,
OpenAICmdInfoChatMessageType,
StatusIndicatorLevel,
} from "../types/types";
import * as T from "../types/types";
import { WSControl } from "./ws";
import {
getMonoFontSize,
windowWidthToCols,
windowHeightToRows,
termWidthFromCols,
termHeightFromRows,
} from "../util/textmeasure";
import { termWidthFromCols, termHeightFromRows } from "../util/textmeasure";
import dayjs from "dayjs";
import localizedFormat from "dayjs/plugin/localizedFormat";
import customParseFormat from "dayjs/plugin/customParseFormat";
import { getRendererContext, cmdStatusIsRunning } from "../app/line/lineutil";
import { MagicLayout } from "../app/magiclayout";
import { modalsRegistry } from "../app/common/modals/registry";
import * as appconst from "../app/appconst";
import { checkKeyPressed, adaptFromReactOrNativeKeyEvent, setKeyUtilPlatform } from "../util/keyutil";
import { OV, OArr, OMap, CV } from "../types/types";
import { Session } from "./session";
import { checkKeyPressed, adaptFromReactOrNativeKeyEvent } from "../util/keyutil";
import { OV, OArr, OMap } from "../types/types";
import { CommandRunner } from "./commandrunner";
import { ScreenLines } from "./screenlines";
import { InputModel } from "./input";
import { PluginsModel } from "./plugins";
import { BookmarksModel } from "./bookmarks";
import { Model } from "./model";
import { Cmd } from "./cmd";
import { SpecialLineContainer } from "./speciallinecontainer";
const HistoryPageSize = 50;