Remove unused debug logs (#33354)

* Remove unused debug logs

* Update WysiwygAutocomplete.tsx

* Update useSuggestion.ts
This commit is contained in:
Will Hunt 2026-05-11 10:00:13 +01:00 committed by GitHub
parent 703941d71e
commit 211dc73207
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 19 deletions

View File

@ -8,7 +8,6 @@ Please see LICENSE files in the repository root for full details.
import React, { type JSX, type Ref, type FunctionComponent } from "react";
import { type FormattingFunctions, type MappedSuggestion } from "@vector-im/matrix-wysiwyg";
import { logger } from "matrix-js-sdk/src/logger";
import Autocomplete from "../../Autocomplete";
import { type ICompletion } from "../../../../../autocomplete/Autocompleter";
@ -111,8 +110,6 @@ const WysiwygAutocomplete = ({
if (!room) return null;
const autoCompleteQuery = buildQuery(suggestion);
// debug for https://github.com/vector-im/element-web/issues/26037
logger.log(`## 26037 ## Rendering Autocomplete for WysiwygAutocomplete with query: "${autoCompleteQuery}"`);
// TODO - determine if we show all of the /command suggestions, there are some options in the
// list which don't seem to make sense in this context, specifically /html and /plain

View File

@ -8,8 +8,7 @@ Please see LICENSE files in the repository root for full details.
import { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings";
import { type AllowedMentionAttributes, type MappedSuggestion } from "@vector-im/matrix-wysiwyg";
import { type SyntheticEvent, useState, type SetStateAction } from "react";
import { logger } from "matrix-js-sdk/src/logger";
import { type SyntheticEvent, useState } from "react";
import { isNotNull } from "../../../../../Typeguards";
@ -57,20 +56,7 @@ export function useSuggestion(
onSelect: (event: SyntheticEvent<HTMLDivElement>) => void;
suggestion: MappedSuggestion | null;
} {
const [suggestionData, setSuggestionData0] = useState<SuggestionState>(null);
// debug for https://github.com/vector-im/element-web/issues/26037
const setSuggestionData = (suggestionData: SetStateAction<SuggestionState>): void => {
// setState allows either the data itself or a callback which returns the data
logger.log(
`## 26037 ## wysiwyg useSuggestion hook setting suggestion data to ${
suggestionData === null || suggestionData instanceof Function
? suggestionData
: suggestionData.mappedSuggestion.keyChar + suggestionData.mappedSuggestion.text
}`,
);
setSuggestionData0(suggestionData);
};
const [suggestionData, setSuggestionData] = useState<SuggestionState>(null);
// We create a `selectionchange` handler here because we need to know when the user has moved the cursor,
// we can not depend on input events only