{"summary":"Infobulle, infobulle de curseur, confirmation contextuelle, boîte de dialogue, tiroir et page entière : dans quels cas utiliser chacun.","notes":"<p>Beaucoup de back-offices utilisent des boîtes de dialogue partout : l’explication d’un point d’interrogation, la confirmation avant un archivage, un formulaire de modification ; à chaque fois, il faut d’abord s’occuper de la boîte de dialogue avant de continuer. Une infobulle n’interrompt presque pas l’utilisateur, une boîte de dialogue recouvre toute la page. Voici les surcouches les plus courantes :</p>\n        <ol>\n        <li><strong>Infobulle (Tooltip)</strong> : ajoute du texte au contenu sous le pointeur, souvent pour un texte long tronqué, comme un long nom de fichier dans un tableau. Elle disparaît dès que le pointeur s’éloigne et ne contient donc que du texte ; pour des boutons ou des liens, utilisez plutôt une bulle qui s’ouvre au clic (Popover).</li>\n        <li><strong>Infobulle de curseur (Cursor tip)</strong> : fournit de l’information en continu sur toute une zone, souvent pour les graphiques et les éléments assez autonomes. Elle n’apparaît que lorsque le pointeur entre dans la zone, et le suit ; sur un graphique en courbes, par exemple, elle affiche la date et la valeur du point de données sous le pointeur.</li>\n        <li><strong>Confirmation contextuelle (Popconfirm)</strong> : pour la plupart des actions irréversibles, comme supprimer un commentaire. La confirmation s’affiche à côté du bouton : l’utilisateur n’a pas à détourner le regard, le parcours est court et il n’est pas dérangé.</li>\n        <li><strong>Boîte de dialogue (Dialog)</strong> : pour les confirmations à fort impact, les actions groupées ou celles où l’utilisateur doit s’arrêter pour réfléchir, comme la suppression définitive d’un projet entier ; aussi pour les formulaires courts qui n’ont pas besoin des autres informations de la page, comme renommer un fichier.</li>\n        <li><strong>Tiroir (Drawer)</strong> : pour les formulaires longs ou ceux qu’on remplit en regardant la page, comme modifier la fiche d’un client à côté de la liste des clients. Le tiroir glisse depuis le côté, la page principale reste visible, et l’espace horizontal des grands écrans est mieux utilisé.</li>\n        <li><strong>Page entière</strong> : quand le formulaire est en lui-même la tâche principale, comme la configuration complète d’un nouveau projet, il devient une page entière, avec sa propre adresse et son propre chemin de retour.</li>\n        </ol>\n        <p>Par ailleurs, une action annulable, comme l’archivage, n’a pas besoin de confirmation : on l’exécute directement et on propose « Annuler ». Sur téléphone, l’infobulle et l’infobulle de curseur s’affichent au toucher.</p>\n        <p>Le prompt associé recense d’abord toutes les surcouches du produit, détermine pour chacune le type qui convient et présente le tout dans un tableau pour que vous décidiez ; après confirmation, il ne modifie que ce que vous avez accepté, sans changer le style visuel.</p>","prompt":"Review how my product uses floating UI (tooltips, tooltips that follow the pointer, popovers, popconfirms, drawers and dialogs) and decide which kind each case should be. Work inside my existing design system. This is about choosing the right kind, not about restyling: keep my components, colours, radii, shadows, fonts, motion and copy style.\n\n0. Start from what exists\n- Find every overlay in the product and the components behind it: tooltips, hover cards, popovers, confirm bubbles, menus that confirm, side panels, drawers, sheets, modals and dialogs.\n- For each use, note where it is, what opens it, what it holds and what happens when the user confirms.\n- Find the design system's own component for each kind. Reuse it. If two components do the same job, say so and suggest which one to keep.\n\n1. What each kind is for\n- Tooltip: adds text about what the pointer is on, such as long text that has been cut short, an icon-only button or a disabled control. Text only. If it needs actions, it becomes a popover opened by a click.\n- Tooltip that follows the pointer: keeps giving information across an area. It appears when the pointer enters, follows it, and goes when the pointer leaves. Common on charts and on other self-contained elements.\n- Popconfirm: the second check for an irreversible action on a single item, right where it was clicked. The path stays short and nothing else is interrupted.\n- Dialog: for something the user must stop and confirm or complete before going on: an action with a large impact, one that affects other people, a bulk action, or one that needs another decision first (such as who takes over the projects). Also for a short form that doesn't need anything else on the page for reference.\n- Drawer: for a long form, for work that needs the page in view to compare against, or to make better use of horizontal space. Never use a drawer to confirm something.\n- Full page: when the task is the user's main job there, or it needs a link that can be shared and survives a reload.\n\n2. Questions that settle a case\n- Can the action be undone? Then don't confirm: do it at once and offer Undo (a toast, or a way back such as a trash).\n- If it can't: is it one item of the user's own, with a button to anchor to? Popconfirm. Large impact, other people, a bulk selection, or a decision still to make? Dialog.\n- Is it a form? Short, and nothing on the page is needed for reference: dialog. Long, needs the page in view, or wants the width: drawer. The main task, or needs its own URL: a page.\n- Is the information about one element, or about wherever the pointer is inside an area? One element: tooltip. An area: tooltip that follows the pointer. Either way, does it need anything to click? Then it is a popover.\n- On touch screens there is no hover: anything shown on hover must also be reachable by a tap.\n\n3. What each kind should do\nFill in only what is missing, with the design system's existing parts.\n- Tooltip: shows on hover and on keyboard focus, after about 500ms for the first one, then at once when moving to a neighbour. Stays inside the viewport, lets the pointer through, one at a time, linked with aria-describedby.\n- Tooltip that follows the pointer: sits beside the pointer without covering it and flips near the edges of the viewport. On a chart, the guide line follows the pointer and the value snaps to the nearest data point. On touch, a tap shows the value.\n- Popconfirm: anchored to the button that opened it and grows from it. Escape or a click outside closes it, and focus goes back to that button. The confirm button names the action.\n- Dialog: the system's modal or a native dialog opened with showModal(). Keeps focus inside and Escape cancels. It says who or what is affected and what cannot be undone. Buttons name the action (\"Remove member\", not \"OK\").\n- Drawer: comes in from the edge it is attached to and leaves the page in view. Changes show up in the page behind it as they are made. Closes with Escape and a close button; focus moves into it and back out to what opened it.\n- Drawers, dialogs and pages with a form: closing with unsaved changes asks first.\n\n4. Keep the design as it is\n- Change only the kind where the current one is wrong, plus the missing behaviour from step 3.\n- Don't change colours, radii, shadows, fonts, spacing or animations, and don't add new visual patterns.\n- Keep copy as it is, except confirm buttons and the line that explains what cannot be undone.\n- If a case needs a component the system doesn't have (an undo toast, a popover), stop and ask me before adding one.\n\n5. Deliver the decisions first\n- Before changing any code, give me a table: each use, where it is, its current kind, the kind you recommend, and why in one line.\n- Mark the ones that are already right, and the ones that could fit two kinds, with what decides between them.\n- Wait for my go-ahead, then make only the changes I approve and list every file you touched.","skill":"/skills/kubai-overlays/SKILL.md","skillText":"# 浮层组件的选择规则\n\n《999 个小技巧，让你 Vibe 的产品更有质感》第 009 期 · @kubai087\n\n在用户的项目里按下面的要求改造。要求以用户的口吻写成：文中的 I、me、my 指用户；写着要先问的地方，先停下来问用户再继续。\n\n## 改造要求\n\nReview how my product uses floating UI (tooltips, tooltips that follow the pointer, popovers, popconfirms, drawers and dialogs) and decide which kind each case should be. Work inside my existing design system. This is about choosing the right kind, not about restyling: keep my components, colours, radii, shadows, fonts, motion and copy style.\n\n0. Start from what exists\n- Find every overlay in the product and the components behind it: tooltips, hover cards, popovers, confirm bubbles, menus that confirm, side panels, drawers, sheets, modals and dialogs.\n- For each use, note where it is, what opens it, what it holds and what happens when the user confirms.\n- Find the design system's own component for each kind. Reuse it. If two components do the same job, say so and suggest which one to keep.\n\n1. What each kind is for\n- Tooltip: adds text about what the pointer is on, such as long text that has been cut short, an icon-only button or a disabled control. Text only. If it needs actions, it becomes a popover opened by a click.\n- Tooltip that follows the pointer: keeps giving information across an area. It appears when the pointer enters, follows it, and goes when the pointer leaves. Common on charts and on other self-contained elements.\n- Popconfirm: the second check for an irreversible action on a single item, right where it was clicked. The path stays short and nothing else is interrupted.\n- Dialog: for something the user must stop and confirm or complete before going on: an action with a large impact, one that affects other people, a bulk action, or one that needs another decision first (such as who takes over the projects). Also for a short form that doesn't need anything else on the page for reference.\n- Drawer: for a long form, for work that needs the page in view to compare against, or to make better use of horizontal space. Never use a drawer to confirm something.\n- Full page: when the task is the user's main job there, or it needs a link that can be shared and survives a reload.\n\n2. Questions that settle a case\n- Can the action be undone? Then don't confirm: do it at once and offer Undo (a toast, or a way back such as a trash).\n- If it can't: is it one item of the user's own, with a button to anchor to? Popconfirm. Large impact, other people, a bulk selection, or a decision still to make? Dialog.\n- Is it a form? Short, and nothing on the page is needed for reference: dialog. Long, needs the page in view, or wants the width: drawer. The main task, or needs its own URL: a page.\n- Is the information about one element, or about wherever the pointer is inside an area? One element: tooltip. An area: tooltip that follows the pointer. Either way, does it need anything to click? Then it is a popover.\n- On touch screens there is no hover: anything shown on hover must also be reachable by a tap.\n\n3. What each kind should do\nFill in only what is missing, with the design system's existing parts.\n- Tooltip: shows on hover and on keyboard focus, after about 500ms for the first one, then at once when moving to a neighbour. Stays inside the viewport, lets the pointer through, one at a time, linked with aria-describedby.\n- Tooltip that follows the pointer: sits beside the pointer without covering it and flips near the edges of the viewport. On a chart, the guide line follows the pointer and the value snaps to the nearest data point. On touch, a tap shows the value.\n- Popconfirm: anchored to the button that opened it and grows from it. Escape or a click outside closes it, and focus goes back to that button. The confirm button names the action.\n- Dialog: the system's modal or a native dialog opened with showModal(). Keeps focus inside and Escape cancels. It says who or what is affected and what cannot be undone. Buttons name the action (\"Remove member\", not \"OK\").\n- Drawer: comes in from the edge it is attached to and leaves the page in view. Changes show up in the page behind it as they are made. Closes with Escape and a close button; focus moves into it and back out to what opened it.\n- Drawers, dialogs and pages with a form: closing with unsaved changes asks first.\n\n4. Keep the design as it is\n- Change only the kind where the current one is wrong, plus the missing behaviour from step 3.\n- Don't change colours, radii, shadows, fonts, spacing or animations, and don't add new visual patterns.\n- Keep copy as it is, except confirm buttons and the line that explains what cannot be undone.\n- If a case needs a component the system doesn't have (an undo toast, a popover), stop and ask me before adding one.\n\n5. Deliver the decisions first\n- Before changing any code, give me a table: each use, where it is, its current kind, the kind you recommend, and why in one line.\n- Mark the ones that are already right, and the ones that could fit two kinds, with what decides between them.\n- Wait for my go-ahead, then make only the changes I approve and list every file you touched.\n"}