Skip to content

Conversation

@satof3
Copy link
Contributor

@satof3 satof3 commented Nov 28, 2025

Task

https://redmine.weseek.co.jp/issues/173835

Summary

  • 画面右下に出ていたバージョン表示とショートカットのショートカットキー表示をヘルプのドロップダウンに収納
  • ドロップダウンのショートカットを表示からモーダルを呼び出せるように改良
  • Figma
image

@satof3 satof3 requested a review from miya November 28, 2025 10:34
@satof3 satof3 self-assigned this Nov 28, 2025
Comment on lines 48 to 74
<DropdownItem
tag="a"
href="https://docs.growi.org"
target="_blank"
rel="noopener noreferrer"
className="my-1"
data-testid="growi-docs-link"
>
<span className="d-flex align-items-center">
GROWI Docs
<span className="material-symbols-outlined ms-1 fs-6">open_in_new</span>
</span>
</DropdownItem>

<DropdownItem
tag="a"
href="https://growi.cloud/help/"
target="_blank"
rel="noopener noreferrer"
className="my-1"
data-testid="growi-cloud-help-link"
>
<span className="d-flex align-items-center">
{t('help_dropdown.growi_cloud_help')}
<span className="material-symbols-outlined ms-1 fs-6">open_in_new</span>
</span>
</DropdownItem>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs と Help は両方出さなくてもいいかと思います (Cloud ユーザーに「開発ガイド」 等は不要なので)。Cloud のアプリの場合は Help でそれ以外は Docs のリンクを表示するで良いかと思います。

Help/Docs の出し分けは SecondaryItems.tsx の旧実装を参考に useGrowiCloudUri() を使えばできます。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応しました

export const SecondaryItems: FC = memo(() => {

const isAdmin = useIsAdmin();
const growiCloudUri = useGrowiCloudUri();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

growiCloudUri を使わなくなったのであれば削除お願いします (import 文も)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

削除しました

const HelpDropdown = dynamic(() => import('./HelpDropdown').then(mod => mod.HelpDropdown), {
ssr: false,
loading: () => <SkeletonItem />,
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細かいですが、親コンポーネントである Sidebar.tsx が dynamic import しており、HelpDropdown は Sidebar.tsx がレンダリングされていれば必ずレンダリングされるものなのでこれは Dynamic import しなくても良いかと思います。

PersonalDropdown は isGuestUser: true という条件の時は読み込まれなくてよい (Dom に存在しなくてよい) ので dynamic import の恩恵があります。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正しました

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the help UI by moving the GROWI version display and keyboard shortcuts access from a fixed position at the bottom-right of the screen into a new Help dropdown menu in the sidebar navigation. The SystemVersion component is removed and replaced with a more comprehensive HelpDropdown component that provides centralized access to documentation, shortcuts, and version information.

Key changes:

  • Replaces the SystemVersion component with a new HelpDropdown component in the sidebar
  • Consolidates help resources (GROWI Docs, GROWI.cloud Help, shortcuts modal, and version info) into a single dropdown menu
  • Adds translations for the new dropdown labels in 5 languages (en_US, ja_JP, fr_FR, ko_KR, zh_CN)

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
apps/app/src/components/Layout/ShareLinkLayout.tsx Removes SystemVersion component import and usage
apps/app/src/components/Layout/BasicLayout.tsx Removes SystemVersion component import and usage
apps/app/src/components/Layout/AdminLayout.tsx Removes SystemVersion component import and usage
apps/app/src/client/components/SystemVersion.tsx Deletes the entire SystemVersion component file
apps/app/src/client/components/SystemVersion.module.scss Deletes the SystemVersion styles file
apps/app/src/client/components/Sidebar/SidebarNav/SecondaryItems.tsx Replaces simple Help link with new HelpDropdown component
apps/app/src/client/components/Sidebar/SidebarNav/HelpDropdown.tsx Adds new HelpDropdown component with documentation links, shortcuts, and version display
apps/app/src/client/components/Sidebar/SidebarNav/HelpDropdown.module.scss Adds styles for the new HelpDropdown component
apps/app/public/static/locales/{lang}/translation.json Adds translations for help dropdown labels in 5 languages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +9 to +11
}

.help-dropdown-menu :global {
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .help-dropdown-menu :global selector is duplicated. Lines 7-9 and 11-14 both target the same selector. These should be merged into a single block:

.help-dropdown-menu :global {
  @include modifier-keys.modifier-key;
  --bs-dropdown-font-size: 14px;
  min-width: 240px;
}
Suggested change
}
.help-dropdown-menu :global {

Copilot uses AI. Check for mistakes.
Comment on lines 48 to 74
<DropdownItem
tag="a"
href="https://docs.growi.org"
target="_blank"
rel="noopener noreferrer"
className="my-1"
data-testid="growi-docs-link"
>
<span className="d-flex align-items-center">
GROWI Docs
<span className="material-symbols-outlined ms-1 fs-6">open_in_new</span>
</span>
</DropdownItem>

<DropdownItem
tag="a"
href="https://growi.cloud/help/"
target="_blank"
rel="noopener noreferrer"
className="my-1"
data-testid="growi-cloud-help-link"
>
<span className="d-flex align-items-center">
{t('help_dropdown.growi_cloud_help')}
<span className="material-symbols-outlined ms-1 fs-6">open_in_new</span>
</span>
</DropdownItem>
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HelpDropdown component shows both GROWI Docs and GROWI.cloud Help links unconditionally, but the original behavior (see SecondaryItems.tsx line 56 in the diff) was to show different help URLs based on whether growiCloudUri exists.

The component should conditionally render help links:

  • If growiCloudUri exists: show GROWI.cloud Help
  • Otherwise: show GROWI Docs

Consider using the existing useGrowiDocumentationUrl() hook from ~/states/context which already handles this logic, or implement similar conditional logic using useGrowiCloudUri().

Copilot uses AI. Check for mistakes.
data-testid="help-dropdown-button"
>
<span className="material-symbols-outlined">help</span>
</DropdownToggle>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

テーマ統一のため、SecondaryItem を利用すべきだと思う

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude に聞いた所 SecondaryItem はリンクベースでhrefを受け取るのでドロップダウンには使えないと言われました
onClick や Children で無理やりやってみましたがposition-absolute でアイコンを重ねる形になってしまうためホバー時のスタイルがばらついてしまいました

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants