Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion packages/api/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dts from 'rollup-plugin-dts'
import esbuild from 'rollup-plugin-esbuild'
import packageJson from './package.json' assert { type: 'json' };
import packageJson from './package.json' with { type: 'json' };
import path from 'path';

const name = packageJson.main.replace(/\.js$/, '');
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dts from 'rollup-plugin-dts'
import esbuild from 'rollup-plugin-esbuild'
import path from 'path';
import packageJson from './package.json' assert { type: 'json' };
import packageJson from './package.json' with { type: 'json' };

const name = packageJson.main.replace(/\.js$/, '');

Expand Down
2 changes: 1 addition & 1 deletion packages/react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import bundleSize from 'rollup-plugin-bundle-size';
import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';
import analyze from 'rollup-plugin-analyzer';
import packageJson from './package.json' with { type: 'json' };

const packageJson = require('./package.json');
const PRODUCTION = process.env.NODE_ENV === 'production';

export default [
Expand Down
21 changes: 20 additions & 1 deletion packages/react/src/views/CommandList/CommandsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,32 @@ function CommandsList({
style = {},
messageRef,
setFilteredCommands,
filteredCommands,
filteredCommands: propsFilteredCommands,
execCommand,
commandIndex,
setCommandIndex,
setShowCommandList,
...props
}) {
// Fix for issue #968: Filter out duplicate keyboard shortcut descriptions
// The server returns multiple shortcuts with the same description for message navigation.
// We want to dedup them here to avoid confusing the user.
const filteredCommands = React.useMemo(() => {
if (!propsFilteredCommands) return [];

const seenDescriptions = new Set();
return propsFilteredCommands.filter((cmd) => {
// If there's no description or command name, let it through (shouldn't happen for shortcuts)
if (!cmd.description || !cmd.command) return true;

// Deduplicate by description to avoid confusing the user with multiple keys for the same action
if (seenDescriptions.has(cmd.description)) {
return false;
}
seenDescriptions.add(cmd.description);
return true;
});
}, [propsFilteredCommands]);
const { classNames, styleOverrides } = useComponentOverrides('CommandsList');
const { theme } = useTheme();
const styles = getCommandListStyles(theme);
Expand Down