Merge with latest upstream

This commit is contained in:
midn8hustlr
2024-03-17 16:55:38 +05:30
19 changed files with 246 additions and 203 deletions
@@ -283,19 +283,15 @@ export const ChatMessage = (message, modelName = 'Model') => {
const messageContentBox = MessageContent(message.content);
const thisMessage = Box({
className: 'sidebar-chat-message',
homogeneous: true,
children: [
Box({
className: `sidebar-chat-indicator ${message.role == 'user' ? 'sidebar-chat-indicator-user' : 'sidebar-chat-indicator-bot'}`,
}),
Box({
vertical: true,
hpack: 'fill',
hexpand: true,
children: [
Label({
hpack: 'fill',
hpack: 'start',
xalign: 0,
className: 'txt txt-bold sidebar-chat-name',
className: `txt txt-bold sidebar-chat-name sidebar-chat-name-${message.role == 'user' ? 'user' : 'bot'}`,
wrap: true,
useMarkup: true,
label: (message.role == 'user' ? USERNAME : modelName),
@@ -324,17 +320,13 @@ export const SystemMessage = (content, commandName, scrolledWindow) => {
const thisMessage = Box({
className: 'sidebar-chat-message',
children: [
Box({
className: `sidebar-chat-indicator sidebar-chat-indicator-System`,
}),
Box({
vertical: true,
hpack: 'fill',
hexpand: true,
children: [
Label({
xalign: 0,
className: 'txt txt-bold sidebar-chat-name',
hpack: 'start',
className: 'txt txt-bold sidebar-chat-name sidebar-chat-name-system',
wrap: true,
label: `System • ${commandName}`,
}),
+14 -20
View File
@@ -204,9 +204,6 @@ const BooruPage = (taglist) => {
overlays: [imageActions]
})
}
const colorIndicator = Box({
className: `sidebar-chat-indicator`,
});
const downloadState = Stack({
homogeneous: false,
transition: 'slide_up_down',
@@ -233,7 +230,7 @@ const BooruPage = (taglist) => {
hscroll: 'automatic',
child: Box({
hpack: 'fill',
className: 'sidebar-waifu-content spacing-h-5',
className: 'spacing-h-5',
children: [
...taglist.map((tag) => CommandButton(tag)),
Box({ hexpand: true }),
@@ -246,8 +243,7 @@ const BooruPage = (taglist) => {
const pageImageGrid = Grid({
// columnHomogeneous: true,
// rowHomogeneous: true,
className: 'sidebar-waifu-image',
// css: 'min-height: 90px;'
className: 'sidebar-booru-imagegrid',
});
const pageImageRevealer = Revealer({
transition: 'slide_down',
@@ -256,6 +252,7 @@ const BooruPage = (taglist) => {
child: pageImageGrid,
});
const thisPage = Box({
homogeneous: true,
className: 'sidebar-chat-message',
attribute: {
'imagePath': '',
@@ -289,20 +286,17 @@ const BooruPage = (taglist) => {
downloadIndicator.attribute.hide();
},
},
children: [
colorIndicator,
Box({
vertical: true,
className: 'spacing-v-5',
children: [
pageHeading,
Box({
vertical: true,
children: [pageImageRevealer],
})
]
})
],
children: [Box({
vertical: true,
className: 'spacing-v-5',
children: [
pageHeading,
Box({
vertical: true,
children: [pageImageRevealer],
})
]
})],
});
return thisPage;
}
+1 -1
View File
@@ -247,7 +247,7 @@ const GPTWelcome = () => Box({
});
export const chatContent = Box({
className: 'spacing-v-15',
className: 'spacing-v-5',
vertical: true,
setup: (self) => self
.hook(GPTService, (box, id) => {
+1 -1
View File
@@ -151,7 +151,7 @@ const geminiWelcome = Box({
});
export const chatContent = Box({
className: 'spacing-v-15',
className: 'spacing-v-5',
vertical: true,
setup: (self) => self
.hook(GeminiService, (box, id) => {
+3 -9
View File
@@ -11,6 +11,7 @@ import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
import { MarginRevealer } from '../../.widgethacks/advancedrevealers.js';
import { setupCursorHover, setupCursorHoverInfo } from '../../.widgetutils/cursorhover.js';
import WaifuService from '../../../services/waifus.js';
import { darkMode } from '../../.miscutils/system.js';
async function getImageViewerApp(preferredApp) {
Utils.execAsync(['bash', '-c', `command -v ${preferredApp}`])
@@ -117,9 +118,6 @@ const WaifuImage = (taglist) => {
onClicked: action,
setup: setupCursorHover,
})
const colorIndicator = Box({
className: `sidebar-chat-indicator`,
});
const downloadState = Stack({
homogeneous: false,
transition: 'slide_up_down',
@@ -139,7 +137,7 @@ const WaifuImage = (taglist) => {
});
const blockHeading = Box({
hpack: 'fill',
className: 'sidebar-waifu-content spacing-h-5',
className: 'spacing-h-5',
children: [
...taglist.map((tag) => CommandButton(tag)),
Box({ hexpand: true }),
@@ -248,14 +246,10 @@ const WaifuImage = (taglist) => {
else Utils.execAsync(['bash', '-c', `wget -O '${thisBlock.attribute.imagePath}' '${url}'`])
.then(showImage)
.catch(print);
blockHeading.get_children().forEach((child) => {
child.setCss(`border-color: ${dominant_color};`);
})
colorIndicator.css = `background-color: ${dominant_color};`;
thisBlock.css = `background-color: mix(${darkMode ? 'black' : 'white'}, ${dominant_color}, 0.9);`;
},
},
children: [
colorIndicator,
Box({
vertical: true,
className: 'spacing-v-5',