mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-16 17:36:07 +00:00
fix: plugin card source badge blocked by hover overlay (#1802)
* Initial plan * Add View Source menu item and remove clickable source badges - Add "viewSource" translation key to all language files - Add View Source menu item to plugin card dropdown (only for GitHub/marketplace plugins) - Remove onClick handlers and ExternalLink icons from source badges - Keep the badges themselves for visual indication of plugin source Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> * Fix prettier formatting issue in PluginCardComponent Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: RockChinQ <45992437+RockChinQ@users.noreply.github.com>
This commit is contained in:
+25
-19
@@ -91,16 +91,8 @@ export default function PluginCardComponent({
|
|||||||
<Badge
|
<Badge
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="text-[0.7rem] border-blue-400 text-blue-400 flex-shrink-0"
|
className="text-[0.7rem] border-blue-400 text-blue-400 flex-shrink-0"
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
window.open(
|
|
||||||
cardVO.install_info.github_url,
|
|
||||||
'_blank',
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{t('plugins.fromGithub')}
|
{t('plugins.fromGithub')}
|
||||||
<ExternalLink className="w-4 h-4" />
|
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
{cardVO.install_source === 'local' && (
|
{cardVO.install_source === 'local' && (
|
||||||
@@ -115,19 +107,8 @@ export default function PluginCardComponent({
|
|||||||
<Badge
|
<Badge
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="text-[0.7rem] border-purple-400 text-purple-400 flex-shrink-0"
|
className="text-[0.7rem] border-purple-400 text-purple-400 flex-shrink-0"
|
||||||
onClick={(e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
window.open(
|
|
||||||
getCloudServiceClientSync().getPluginMarketplaceURL(
|
|
||||||
cardVO.author,
|
|
||||||
cardVO.name,
|
|
||||||
),
|
|
||||||
'_blank',
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{t('plugins.fromMarketplace')}
|
{t('plugins.fromMarketplace')}
|
||||||
<ExternalLink className="w-4 h-4" />
|
|
||||||
</Badge>
|
</Badge>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
@@ -200,6 +181,31 @@ export default function PluginCardComponent({
|
|||||||
<span>{t('plugins.update')}</span>
|
<span>{t('plugins.update')}</span>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
)}
|
)}
|
||||||
|
{/**view source */}
|
||||||
|
{(cardVO.install_source === 'github' ||
|
||||||
|
cardVO.install_source === 'marketplace') && (
|
||||||
|
<DropdownMenuItem
|
||||||
|
className="flex flex-row items-center justify-start gap-[0.4rem] cursor-pointer"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (cardVO.install_source === 'github') {
|
||||||
|
window.open(cardVO.install_info.github_url, '_blank');
|
||||||
|
} else if (cardVO.install_source === 'marketplace') {
|
||||||
|
window.open(
|
||||||
|
getCloudServiceClientSync().getPluginMarketplaceURL(
|
||||||
|
cardVO.author,
|
||||||
|
cardVO.name,
|
||||||
|
),
|
||||||
|
'_blank',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
setDropdownOpen(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ExternalLink className="w-4 h-4" />
|
||||||
|
<span>{t('plugins.viewSource')}</span>
|
||||||
|
</DropdownMenuItem>
|
||||||
|
)}
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
className="flex flex-row items-center justify-start gap-[0.4rem] cursor-pointer text-red-600 focus:text-red-600"
|
className="flex flex-row items-center justify-start gap-[0.4rem] cursor-pointer text-red-600 focus:text-red-600"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
|||||||
@@ -282,6 +282,7 @@ const enUS = {
|
|||||||
saveConfigError: 'Configuration save failed: ',
|
saveConfigError: 'Configuration save failed: ',
|
||||||
config: 'Configuration',
|
config: 'Configuration',
|
||||||
readme: 'Documentation',
|
readme: 'Documentation',
|
||||||
|
viewSource: 'View Source',
|
||||||
loadingReadme: 'Loading documentation...',
|
loadingReadme: 'Loading documentation...',
|
||||||
noReadme: 'This plugin does not provide README documentation',
|
noReadme: 'This plugin does not provide README documentation',
|
||||||
fileUpload: {
|
fileUpload: {
|
||||||
|
|||||||
@@ -283,6 +283,7 @@ const jaJP = {
|
|||||||
saveConfigError: '設定の保存に失敗しました:',
|
saveConfigError: '設定の保存に失敗しました:',
|
||||||
config: '設定',
|
config: '設定',
|
||||||
readme: 'ドキュメント',
|
readme: 'ドキュメント',
|
||||||
|
viewSource: 'ソースを表示',
|
||||||
loadingReadme: 'ドキュメントを読み込み中...',
|
loadingReadme: 'ドキュメントを読み込み中...',
|
||||||
noReadme: 'このプラグインはREADMEドキュメントを提供していません',
|
noReadme: 'このプラグインはREADMEドキュメントを提供していません',
|
||||||
fileUpload: {
|
fileUpload: {
|
||||||
|
|||||||
@@ -268,6 +268,7 @@ const zhHans = {
|
|||||||
saveConfigError: '保存配置失败:',
|
saveConfigError: '保存配置失败:',
|
||||||
config: '配置',
|
config: '配置',
|
||||||
readme: '文档',
|
readme: '文档',
|
||||||
|
viewSource: '查看来源',
|
||||||
loadingReadme: '正在加载文档...',
|
loadingReadme: '正在加载文档...',
|
||||||
noReadme: '该插件没有提供 README 文档',
|
noReadme: '该插件没有提供 README 文档',
|
||||||
fileUpload: {
|
fileUpload: {
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ const zhHant = {
|
|||||||
saveConfigError: '儲存配置失敗:',
|
saveConfigError: '儲存配置失敗:',
|
||||||
config: '配置',
|
config: '配置',
|
||||||
readme: '文件',
|
readme: '文件',
|
||||||
|
viewSource: '查看來源',
|
||||||
loadingReadme: '正在載入文件...',
|
loadingReadme: '正在載入文件...',
|
||||||
noReadme: '該插件沒有提供 README 文件',
|
noReadme: '該插件沒有提供 README 文件',
|
||||||
fileUpload: {
|
fileUpload: {
|
||||||
|
|||||||
Reference in New Issue
Block a user