Skip to content
Merged
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
6 changes: 5 additions & 1 deletion docs/dncl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@

日本語で書いているあいだ(日本語タブを開いてから、ルビータブを開くまで)はコードタブのブロックが制限される(後述の「関連ブロック」参照)ため、「ブロックが少ない・拡張機能が選べない」状態に気づけるよう、2 つの導線を用意している。

**通知バナー(コードタブ)**: ワークスペース右上に「日本語タブで書いています:ブロックが制限されています」バナー(`data-testid: dncl-mode-notice`)を常時表示する。「すべてのブロックを使う」ボタン(`data-testid: dncl-mode-notice-exit-button`)を押すと confirm ダイアログを表示し、OK でタブ切り替えなしで全ブロックを即時復元する。
**通知バナー(コードタブ)**: ワークスペース右上に「日本語タブで書いています:ブロックが制限されています」バナー(`data-testid: dncl-mode-notice`)を常時表示する。見た目はデザインシステムのお知らせの色(`$color-info-background`・`$color-info`。[`../design-system/components/alerts.md`](../design-system/components/alerts.md))で、ボタンは小さい副ボタンの形。

![コードタブの通知バナー](screenshots/0105-code-tab-notice-1280x800.png)

「すべてのブロックを使う」ボタン(`data-testid: dncl-mode-notice-exit-button`)を押すと confirm ダイアログを表示し、OK でタブ切り替えなしで全ブロックを即時復元する。

**拡張機能ボタンの confirm ダイアログ**: 日本語で書いているあいだに拡張機能ボタン(`data-testid: extension-button`)を押すと、「日本語タブで書いているあいだは、拡張機能と一部のブロックは使えません。すべてのブロックと拡張機能を使えるようにしますか?(日本語タブに戻ると、また制限されます)」の confirm ダイアログを表示する。OK で全ブロックに戻して拡張機能ライブラリを開く。キャンセルでは何も変わらない。

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
@import '../../css/smalruby-tokens.css';

/*
* The notice of the Code tab while the program is written in the Japanese tab.
* It is an お知らせ (the info alert colors of docs/design-system/components/alerts.md)
* on the top right of the workspace, joined to its top and right edges.
*/
.notice {
position: absolute;
top: 0;
Expand All @@ -11,34 +18,45 @@
flex-wrap: wrap;
justify-content: flex-end;
max-width: calc(100% - 8px);
padding: 6px 12px;
background-color: rgba(255, 243, 205, 0.95);
border-bottom: 1px solid #ffc107;
border-left: 1px solid #ffc107;
font-size: 12px;
gap: 8px;
padding: $space-small $space-medium $space-small 0.75rem;
background-color: $color-info-background;
border-bottom: 1px solid $color-info;
border-left: 1px solid $color-info;
border-bottom-left-radius: $radius-medium;
color: $color-text;
font-size: $font-size-small;
gap: $space-medium;
pointer-events: auto;
}

.message {
color: #856404;
font-weight: 500;
font-weight: $font-weight-bold;
flex: 1;
}

/* The 副ボタン of docs/design-system/components/README.md, small */
.exitButton {
background: none;
border: 1px solid #856404;
border-radius: 4px;
color: #856404;
padding: $space-small $space-medium;
background-color: $color-surface;
border: 1px solid $color-border;
border-radius: $radius-small;
color: $color-text;
cursor: pointer;
font-size: 11px;
padding: 3px 8px;
font-size: $font-size-small;
font-weight: $font-weight-bold;
white-space: nowrap;
flex-shrink: 0;
}

.exitButton:hover {
background-color: #ffc107;
color: #fff;
border-color: $color-info;
}

.exitButton:active {
background-color: $color-background;
}

.exitButton:focus-visible {
outline: 2px solid $color-primary;
outline-offset: 2px;
}
Loading