Add some quick-and-dirty debug info for TileStore (#2887)

* Add some quick-and-dirty debug info for TileStore

I'm still in need of more detailed data in order to understand why big layout shifts happen in large calls. This adds a developer option to enable logging and a visual indicator for the state of the TileStore. The indicator should be useful for matching up the behavior I'm seeing in my recordings with the right timestamps.

* Reduce performance impact of checking for whether debug mode is enabled

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
This commit is contained in:
Robin
2024-12-11 05:23:42 -05:00
committed by GitHub
parent 54149a496c
commit b834d8f679
6 changed files with 91 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ import { FieldRow, InputField } from "../input/Input";
import {
useSetting,
duplicateTiles as duplicateTilesSetting,
debugTileLayout as debugTileLayoutSetting,
} from "./settings";
import type { MatrixClient } from "matrix-js-sdk/src/client";
@@ -22,6 +23,9 @@ interface Props {
export const DeveloperSettingsTab: FC<Props> = ({ client }) => {
const { t } = useTranslation();
const [duplicateTiles, setDuplicateTiles] = useSetting(duplicateTilesSetting);
const [debugTileLayout, setDebugTileLayout] = useSetting(
debugTileLayoutSetting,
);
return (
<>
@@ -70,6 +74,17 @@ export const DeveloperSettingsTab: FC<Props> = ({ client }) => {
)}
/>
</FieldRow>
<FieldRow>
<InputField
id="debugTileLayout"
type="checkbox"
checked={debugTileLayout}
label={t("developer_mode.debug_tile_layout_label")}
onChange={(event: ChangeEvent<HTMLInputElement>): void =>
setDebugTileLayout(event.target.checked)
}
/>
</FieldRow>
</>
);
};

View File

@@ -75,6 +75,8 @@ export const developerSettingsTab = new Setting(
export const duplicateTiles = new Setting("duplicate-tiles", 0);
export const debugTileLayout = new Setting("debug-tile-layout", false);
export const audioInput = new Setting<string | undefined>(
"audio-input",
undefined,