Skip to content

Commit eb574be

Browse files
Tim020claude
andcommitted
[Collab] Add disabled-reason tooltips to Edit/Cuts buttons
Show tooltip explaining why the button is disabled (active editors, active cutter, or unsaved draft). Uses span wrappers with manual border-radius to preserve button-group joined styling. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent b79f799 commit eb574be

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

client/src/vue_components/show/config/script/ScriptEditor.vue

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
<b-col cols="2">
2020
<b-button-group v-if="IS_SCRIPT_EDITOR">
2121
<template v-if="!IS_CURRENT_EDITOR && !IS_CURRENT_CUTTER">
22-
<b-button variant="warning" :disabled="!CAN_REQUEST_EDIT" @click="requestEdit">
23-
Edit
24-
</b-button>
25-
<b-button variant="warning" :disabled="!CAN_REQUEST_CUTS" @click="requestCutEdit">
26-
Cuts
27-
</b-button>
22+
<span v-b-tooltip.hover="editDisabledReason" class="btn-group-item">
23+
<b-button variant="warning" :disabled="!CAN_REQUEST_EDIT" @click="requestEdit">
24+
Edit
25+
</b-button>
26+
</span>
27+
<span v-b-tooltip.hover="cutsDisabledReason" class="btn-group-item">
28+
<b-button variant="warning" :disabled="!CAN_REQUEST_CUTS" @click="requestCutEdit">
29+
Cuts
30+
</b-button>
31+
</span>
2832
</template>
2933
<template v-if="IS_CURRENT_EDITOR">
3034
<b-button
@@ -291,6 +295,16 @@ export default {
291295
}
292296
return 'primary';
293297
},
298+
editDisabledReason() {
299+
if (this.CUTTERS.length > 0) return 'Another user is currently making cuts';
300+
return '';
301+
},
302+
cutsDisabledReason() {
303+
if (this.EDITORS.length > 0) return 'Another user is currently editing';
304+
if (this.CUTTERS.length > 0) return 'Another user is currently making cuts';
305+
if (this.HAS_DRAFT) return 'An unsaved draft exists';
306+
return '';
307+
},
294308
canEdit() {
295309
return this.IS_CURRENT_EDITOR;
296310
},
@@ -1145,4 +1159,18 @@ export default {
11451159
border-bottom: 1px solid #dee2e6;
11461160
background: var(--body-background);
11471161
}
1162+
1163+
.btn-group-item {
1164+
display: flex;
1165+
}
1166+
1167+
.btn-group-item:first-child > .btn {
1168+
border-top-right-radius: 0;
1169+
border-bottom-right-radius: 0;
1170+
}
1171+
1172+
.btn-group-item:last-child > .btn {
1173+
border-top-left-radius: 0;
1174+
border-bottom-left-radius: 0;
1175+
}
11481176
</style>

0 commit comments

Comments
 (0)