aws-samples / bedrock-claude-chat

AWS-native chatbot using Bedrock + Claude (+Mistral)
MIT No Attribution
687 stars 230 forks source link

add keyboard command #369

Open k70suK3-k06a7ash1 opened 2 weeks ago

k70suK3-k06a7ash1 commented 2 weeks ago

Issue #, if available:

370

368

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

k70suK3-k06a7ash1 commented 2 weeks ago

チャット欄フォーカス QuestionIconでショートカット一覧を表示

k70suK3-k06a7ash1 commented 1 week ago

refをChatInput内で定義しているため、liftupするか、ref合成の必要ありそう?

k70suK3-k06a7ash1 commented 1 week ago

綺麗ではないけどText Areaに個別にEffect追加

k70suK3-k06a7ash1 commented 1 week ago
スクリーンショット 2024-06-17 15 01 46

こんな感じでModal作成しました

k70suK3-k06a7ash1 commented 1 week ago

@wadabee @statefb こちらお手隙でご確認いただけますと幸いですmm

k70suK3-k06a7ash1 commented 1 week ago

Lint修正

k70suK3-k06a7ash1 commented 1 week ago

@wadabee レビューありがとうございます!! 修正します!

k70suK3-k06a7ash1 commented 1 week ago

sample code

var ua = window.navigator.userAgent.toLowerCase();

if(ua.indexOf("windows nt") !== -1) {
  console.log("「Microsoft Windows」をお使いですね!");
} else if(ua.indexOf("android") !== -1) {
  console.log("「Android」をお使いですね!");
} else if(ua.indexOf("iphone") !== -1 || ua.indexOf("ipad") !== -1) {
  console.log("「iOS」をお使いですね!");
} else if(ua.indexOf("mac os x") !== -1) {
  console.log("「macOS」をお使いですね!");
} else {
  console.log("何をお使いなのですか?");
}
k70suK3-k06a7ash1 commented 1 week ago

Premise : macOS

userAgent userAgentData
Safari macOS disabled api
Chrome getOS => Android NotWindows as macOS
k70suK3-k06a7ash1 commented 1 week ago
      window.navigator?.userAgentData
        ?.getHighEntropyValues(['platformVersion'])
        ?.then((ua) => {
          if (navigator.userAgentData.platform === 'Windows') {
            const majorPlatformVersion = parseInt(
              ua.platformVersion.split('.')[0]
            );
            if (majorPlatformVersion >= 13) {
              console.log('Windows 11 or later');
            } else if (majorPlatformVersion > 0) {
              console.log('Windows 10');
            } else {
              console.log('Before Windows 10');
            }
          } else {
            console.log('Not running on Windows');
          }
        });

See : https://learn.microsoft.com/ja-jp/microsoft-edge/web-platform/how-to-detect-win11

k70suK3-k06a7ash1 commented 1 week ago
import Bowser from 'bowser';
...

const browser = Bowser.getParser(window.navigator.userAgent);
const os = browser.getOSName();

build-in

k70suK3-k06a7ash1 commented 5 days ago

@statefb @wadabee こちら修正とWindows端末での検証まで完了しました!

statefb commented 5 days ago

ありがとうございます! @wadabee LGTMでしたらマージお願いします!