Fix U2Net, alertify dialogs, and improve AI Paint workflow

- Switch U2Net from onnxruntime to OpenCV DNN to avoid
  "cannot enable executable stack" error in Docker
- Add alertify dialog styling to fix white text on white
  background issue in popups
- Add offerFloatSelection() to AI Paint that prompts user
  after selection to move/scale it (Canva-like workflow)
- Auto-switch to Select tool after floating selection

https://claude.ai/code/session_01CLedz6CanT9t46KBvng3vz
This commit is contained in:
Claude
2026-01-28 13:23:49 +00:00
parent ed491ab9ba
commit 871fc696f5
4 changed files with 132 additions and 54 deletions
+57
View File
@@ -867,6 +867,63 @@ canvas{
background-color: #ffc107;
color: #000;
}
/* Alertify dialog styling - fix text color issues */
.alertify .ajs-dialog {
background-color: #3a3f44;
color: #f4f3f3;
border-radius: 6px;
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.alertify .ajs-header {
background-color: #4a5058;
color: #f4f3f3;
border-bottom: 1px solid #555;
padding: 10px 15px;
font-weight: bold;
}
.alertify .ajs-body {
color: #f4f3f3;
padding: 15px;
}
.alertify .ajs-body .ajs-content {
color: #f4f3f3;
}
.alertify .ajs-footer {
background-color: #3a3f44;
border-top: 1px solid #555;
padding: 10px 15px;
}
.alertify .ajs-footer .ajs-buttons .ajs-button {
background-color: #4a5058;
color: #f4f3f3;
border: 1px solid #666;
border-radius: 4px;
padding: 6px 16px;
margin: 0 4px;
cursor: pointer;
}
.alertify .ajs-footer .ajs-buttons .ajs-button:hover {
background-color: #5a6068;
}
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok {
background-color: #28a745;
border-color: #28a745;
}
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok:hover {
background-color: #218838;
}
.alertify .ajs-input {
background-color: #2a2f34;
color: #f4f3f3;
border: 1px solid #555;
padding: 8px;
border-radius: 4px;
width: 100%;
}
.alertify .ajs-input::placeholder {
color: #999;
}
.effectsPreview{
cursor: pointer;
background-color: #ddd;
+32 -2
View File
@@ -262,7 +262,8 @@ class Brush_select_class extends Base_tools_class {
if (isAdditive && this.currentMask) {
alertify.success('Added to selection! Shift+brush to add more.');
} else {
alertify.success('Selection complete! Ctrl+C to copy, Ctrl+X to cut.');
// Offer to float the selection for immediate manipulation (Canva-like)
this.offerFloatSelection();
}
} catch (error) {
@@ -287,7 +288,8 @@ class Brush_select_class extends Base_tools_class {
var maskCanvas = await this.decodeMask(result.mask);
this.applyMaskCanvas(maskCanvas, false);
alertify.success('Selection complete! Brush over more to add.');
// Offer to float the selection for immediate manipulation
this.offerFloatSelection();
} catch (error) {
console.error('Select error:', error);
@@ -297,6 +299,34 @@ class Brush_select_class extends Base_tools_class {
}
}
/**
* Offer to float the selection to a new layer for manipulation (Canva-like workflow)
*/
offerFloatSelection() {
var _this = this;
alertify.confirm(
'Selection Complete',
'Would you like to move/scale this selection? This will copy it to a new layer.',
function() {
// Yes - copy to layer and switch to Select tool
_this.copyToLayer();
// Switch to Select tool
setTimeout(function() {
var selectTool = document.querySelector('.sidebar_left .item[data-tool="select"]');
if (selectTool) {
selectTool.click();
}
}, 100);
},
function() {
// No - just keep the selection
alertify.message('Tip: Use Ctrl+C to copy or Ctrl+X to cut the selection.');
}
).set('labels', {ok: 'Yes, Move/Scale', cancel: 'Keep Selection'});
}
/**
* Sample key points from brush stroke for SAM
*/