(null);
+
+ useEffect(() => {
+ const self = node.current;
+
+ if (self && scrollable) {
+ addScrollableNode(self);
+ }
+ return () => {
+ if (self && scrollable) {
+ removeScrollableNode(self);
+ }
+ };
+ }, []);
return (
{children}
@@ -56,9 +72,4 @@ function LayoutContent(props: ContentProps) {
);
}
-LayoutContent.defaultHooks = {
- onComponentDidMount: (node) => addScrollableNode(node),
- onComponentWillUnmount: (node) => removeScrollableNode(node),
-};
-
Layout.Content = LayoutContent;
diff --git a/tgui/packages/tgui/layouts/Pane.tsx b/tgui/packages/tgui/layouts/Pane.tsx
index a2858fae7fc..f34205545fb 100644
--- a/tgui/packages/tgui/layouts/Pane.tsx
+++ b/tgui/packages/tgui/layouts/Pane.tsx
@@ -9,6 +9,7 @@ import { classes } from 'common/react';
import { useBackend } from '../backend';
import { Box } from '../components';
import { BoxProps } from '../components/Box';
+import { useDebug } from '../debug';
import { Layout } from './Layout';
type Props = Partial<{
@@ -18,11 +19,8 @@ type Props = Partial<{
export function Pane(props: Props) {
const { theme, children, className, ...rest } = props;
- const { suspended, debug } = useBackend();
- let debugLayout = false;
- if (debug) {
- debugLayout = debug.debugLayout;
- }
+ const { suspended } = useBackend();
+ const { debugLayout = false } = useDebug();
return (
diff --git a/tgui/packages/tgui/layouts/Window.tsx b/tgui/packages/tgui/layouts/Window.tsx
index 2b6fbf87356..aa91370bfc3 100644
--- a/tgui/packages/tgui/layouts/Window.tsx
+++ b/tgui/packages/tgui/layouts/Window.tsx
@@ -13,6 +13,7 @@ import { globalStore } from '../backend';
import { Icon } from '../components';
import { BoxProps } from '../components/Box';
import { UI_DISABLED, UI_INTERACTIVE, UI_UPDATE } from '../constants';
+import { useDebug } from '../debug';
import { toggleKitchenSink } from '../debug/actions';
import {
dragStartHandler,
@@ -48,10 +49,8 @@ export const Window = (props: Props) => {
height,
} = props;
- const { config, suspended, debug } = useBackend();
- if (suspended) {
- return null;
- }
+ const { config, suspended } = useBackend();
+ const { debugLayout = false } = useDebug();
useEffect(() => {
const updateGeometry = () => {
@@ -80,11 +79,6 @@ export const Window = (props: Props) => {
};
}, [width, height]);
- let debugLayout = false;
- if (debug) {
- debugLayout = debug.debugLayout;
- }
-
const dispatch = globalStore.dispatch;
const fancy = config.window?.fancy;
@@ -95,11 +89,11 @@ export const Window = (props: Props) => {
? config.status < UI_DISABLED
: config.status < UI_INTERACTIVE);
- return (
+ return suspended ? null : (
{
// Get the component for the current route
export const getRoutedComponent = () => {
- const { suspended, config, debug } = useBackend();
+ const { suspended, config } = useBackend();
+ const { kitchenSink = false } = useDebug();
+
if (suspended) {
return SuspendedWindow;
}
@@ -61,7 +64,7 @@ export const getRoutedComponent = () => {
}
if (process.env.NODE_ENV !== 'production') {
// Show a kitchen sink
- if (debug?.kitchenSink) {
+ if (kitchenSink) {
return require('./debug').KitchenSink;
}
}
diff --git a/tgui/packages/tgui/styles/components/SearchItem.scss b/tgui/packages/tgui/styles/components/SearchItem.scss
new file mode 100644
index 00000000000..76946ec9c5a
--- /dev/null
+++ b/tgui/packages/tgui/styles/components/SearchItem.scss
@@ -0,0 +1,22 @@
+@use '../colors.scss';
+
+.SearchItem {
+ align-items: center;
+ background: black;
+ border: thin solid #212121;
+ display: flex;
+ height: 3rem;
+ justify-content: center;
+ position: relative;
+ width: 3rem;
+ margin-bottom: 0;
+}
+
+.SearchItem--amount {
+ bottom: -1rem;
+ color: colors.$teal;
+ font-family: 'Roboto', sans-serif;
+ font-size: 1.5rem;
+ position: absolute;
+ right: -4px;
+}
diff --git a/tgui/packages/tgui/styles/main.scss b/tgui/packages/tgui/styles/main.scss
index 25443ae606c..87715e2ae30 100644
--- a/tgui/packages/tgui/styles/main.scss
+++ b/tgui/packages/tgui/styles/main.scss
@@ -38,6 +38,7 @@
@include meta.load-css('./components/NumberInput.scss');
@include meta.load-css('./components/ProgressBar.scss');
@include meta.load-css('./components/RoundGauge.scss');
+@include meta.load-css('./components/SearchItem.scss');
@include meta.load-css('./components/Section.scss');
@include meta.load-css('./components/Slider.scss');
@include meta.load-css('./components/Stack.scss');
diff --git a/tools/test_merge_bot/main.js b/tools/test_merge_bot/main.js
index 0ad51304ecf..ae7d4c7a98d 100644
--- a/tools/test_merge_bot/main.js
+++ b/tools/test_merge_bot/main.js
@@ -87,19 +87,41 @@ export async function processTestMerges({ github, context }) {
}
if (existingComment === undefined) {
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: prNumber,
- body: newBody,
- });
+ try {
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: prNumber,
+ body: newBody,
+ });
+ } catch (error) {
+ if(error.status){
+ console.error(`Failed to create comment for #{prNumber}`)
+ console.error(error)
+ continue;
+ }
+ else{
+ throw error
+ }
+ }
} else {
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existingComment.databaseId,
- body: newBody,
- });
+ try {
+ await github.rest.issues.updateComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ comment_id: existingComment.databaseId,
+ body: newBody,
+ });
+ } catch (error) {
+ if(error.status){
+ console.error(`Failed to update comment for #{prNumber}`)
+ console.error(error)
+ continue;
+ }
+ else{
+ throw error
+ }
+ }
}
}
}