Repository: provectus/kafka-ui
Issue: Brokers: Broker config "Edit" button is either partially or not shown at all on narrow window size.
Labels: type/bug
good first issue
scope/frontend
status/accepted
status/confirmed
hacktoberfest

**Set up**
Version: [eb06235](https://github.com/provectus/kafka-ui/commit/eb06235)


**Steps to Reproduce**
1. Open the "Brokers" page and click on one of the brokers.
2. Open the Configs tab.
**Actual behavior**
- If the window width is narrower than 1284px, then "Edit" button is not fitting in the window, and not visible at all at 1215px or less.
- Source tab is not visible at all in that case.
- No horizontal scroll is available on the page.

**Expected behavior**
- "Key" and "Value" columns have a lot of free space and could be narrowed down to value length or value broken down into several lines, if they are too wide.
- Horizontal scroll should be added, if the suggestion above is not possible.

**Screenshots**
![image](https://user-images.githubusercontent.com/112083452/192478027-fc5ffb54-a9a3-4a1f-b9da-2ec5149fabe7.png)

**Additional context**
Might be affected by "Broker configs: allow resetting values to nulls [#2582](https://github.com/provectus/kafka-ui/issues/2582)"


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/kafka-ui-react-app/src/components/App.styled.ts b/kafka-ui-react-app/src/components/App.styled.ts
index 71353f08762..90eade047d1 100644
--- a/kafka-ui-react-app/src/components/App.styled.ts
+++ b/kafka-ui-react-app/src/components/App.styled.ts
@@ -20,9 +20,10 @@ export const Container = styled.main(
     position: relative;
     padding-bottom: 30px;
     z-index: 20;
-
+    max-width: calc(100vw - ${theme.layout.navBarWidth});
     @media screen and (max-width: 1023px) {
       margin-left: initial;
+      max-width: 100vw;
     }
   `
 );
diff --git a/kafka-ui-react-app/src/components/Brokers/Broker/Configs/Configs.styled.ts b/kafka-ui-react-app/src/components/Brokers/Broker/Configs/Configs.styled.ts
index a49bcf5d7d9..03030b12498 100644
--- a/kafka-ui-react-app/src/components/Brokers/Broker/Configs/Configs.styled.ts
+++ b/kafka-ui-react-app/src/components/Brokers/Broker/Configs/Configs.styled.ts
@@ -12,7 +12,7 @@ export const Value = styled.span`
   line-height: 24px;
   margin-right: 10px;
   text-overflow: ellipsis;
-  width: 600px;
+  max-width: 400px;
   overflow: hidden;
   white-space: nowrap;
 `;
diff --git a/kafka-ui-react-app/src/components/Brokers/Broker/Configs/InputCell.tsx b/kafka-ui-react-app/src/components/Brokers/Broker/Configs/InputCell.tsx
index ceeff2bd59e..422abbbac99 100644
--- a/kafka-ui-react-app/src/components/Brokers/Broker/Configs/InputCell.tsx
+++ b/kafka-ui-react-app/src/components/Brokers/Broker/Configs/InputCell.tsx
@@ -70,7 +70,7 @@ const InputCell: React.FC<InputCellProps> = ({ row, getValue, onUpdate }) => {
           : { fontWeight: 400 }
       }
     >
-      <S.Value>{initialValue}</S.Value>
+      <S.Value title={initialValue}>{initialValue}</S.Value>
       <Button
         buttonType="primary"
         buttonSize="S"
diff --git a/kafka-ui-react-app/src/components/Topics/Topic/MessagesV2/Messages.styled.ts b/kafka-ui-react-app/src/components/Topics/Topic/MessagesV2/Messages.styled.ts
index da464fe808f..c360f706d37 100644
--- a/kafka-ui-react-app/src/components/Topics/Topic/MessagesV2/Messages.styled.ts
+++ b/kafka-ui-react-app/src/components/Topics/Topic/MessagesV2/Messages.styled.ts
@@ -14,7 +14,7 @@ export const Wrapper = styled.div(
 
 export const Sidebar = styled.div(
   ({ theme }) => css`
-    width: 300px;
+    width: ${theme.layout.filtersSidebarWidth};
     position: sticky;
     top: ${theme.layout.navBarHeight};
     align-self: start;
@@ -27,7 +27,9 @@ export const SidebarContent = styled.div`
 
 export const TableWrapper = styled.div(
   ({ theme }) => css`
-    width: 100%;
+    width: calc(
+      100vw - ${theme.layout.navBarWidth} - ${theme.layout.filtersSidebarWidth}
+    );
     border-left: 1px solid ${theme.layout.stuffBorderColor};
   `
 );
diff --git a/kafka-ui-react-app/src/components/common/NewTable/Table.styled.ts b/kafka-ui-react-app/src/components/common/NewTable/Table.styled.ts
index 483e4e32160..d66bb45091c 100644
--- a/kafka-ui-react-app/src/components/common/NewTable/Table.styled.ts
+++ b/kafka-ui-react-app/src/components/common/NewTable/Table.styled.ts
@@ -211,3 +211,7 @@ export const Ellipsis = styled.div`
   text-overflow: ellipsis;
   display: block;
 `;
+
+export const TableWrapper = styled.div`
+  overflow-x: auto;
+`;
diff --git a/kafka-ui-react-app/src/components/common/NewTable/Table.tsx b/kafka-ui-react-app/src/components/common/NewTable/Table.tsx
index 2d1646aa99e..7e3b571c375 100644
--- a/kafka-ui-react-app/src/components/common/NewTable/Table.tsx
+++ b/kafka-ui-react-app/src/components/common/NewTable/Table.tsx
@@ -198,95 +198,97 @@ const Table: React.FC<TableProps<any>> = ({
           />
         </S.TableActionsBar>
       )}
-      <S.Table>
-        <thead>
-          {table.getHeaderGroups().map((headerGroup) => (
-            <tr key={headerGroup.id}>
-              {!!enableRowSelection && (
-                <S.Th key={`${headerGroup.id}-select`}>
-                  {flexRender(
-                    SelectRowHeader,
-                    headerGroup.headers[0].getContext()
-                  )}
-                </S.Th>
-              )}
-              {table.getCanSomeRowsExpand() && (
-                <S.Th expander key={`${headerGroup.id}-expander`} />
-              )}
-              {headerGroup.headers.map((header) => (
-                <S.Th
-                  key={header.id}
-                  colSpan={header.colSpan}
-                  sortable={header.column.getCanSort()}
-                  sortOrder={header.column.getIsSorted()}
-                  onClick={header.column.getToggleSortingHandler()}
-                >
-                  <div>
-                    {flexRender(
-                      header.column.columnDef.header,
-                      header.getContext()
-                    )}
-                  </div>
-                </S.Th>
-              ))}
-            </tr>
-          ))}
-        </thead>
-        <tbody>
-          {table.getRowModel().rows.map((row) => (
-            <React.Fragment key={row.id}>
-              <S.Row
-                expanded={row.getIsExpanded()}
-                onClick={handleRowClick(row)}
-                clickable={
-                  !enableRowSelection &&
-                  (row.getCanExpand() || onRowClick !== undefined)
-                }
-              >
+      <S.TableWrapper>
+        <S.Table>
+          <thead>
+            {table.getHeaderGroups().map((headerGroup) => (
+              <tr key={headerGroup.id}>
                 {!!enableRowSelection && (
-                  <td key={`${row.id}-select`} style={{ width: '1px' }}>
+                  <S.Th key={`${headerGroup.id}-select`}>
                     {flexRender(
-                      SelectRowCell,
-                      row.getVisibleCells()[0].getContext()
+                      SelectRowHeader,
+                      headerGroup.headers[0].getContext()
                     )}
-                  </td>
+                  </S.Th>
                 )}
                 {table.getCanSomeRowsExpand() && (
-                  <td key={`${row.id}-expander`} style={{ width: '1px' }}>
-                    {flexRender(
-                      ExpanderCell,
-                      row.getVisibleCells()[0].getContext()
-                    )}
-                  </td>
+                  <S.Th expander key={`${headerGroup.id}-expander`} />
                 )}
-                {row
-                  .getVisibleCells()
-                  .map(({ id, getContext, column: { columnDef } }) => (
-                    <td key={id} style={columnDef.meta}>
-                      {flexRender(columnDef.cell, getContext())}
+                {headerGroup.headers.map((header) => (
+                  <S.Th
+                    key={header.id}
+                    colSpan={header.colSpan}
+                    sortable={header.column.getCanSort()}
+                    sortOrder={header.column.getIsSorted()}
+                    onClick={header.column.getToggleSortingHandler()}
+                  >
+                    <div>
+                      {flexRender(
+                        header.column.columnDef.header,
+                        header.getContext()
+                      )}
+                    </div>
+                  </S.Th>
+                ))}
+              </tr>
+            ))}
+          </thead>
+          <tbody>
+            {table.getRowModel().rows.map((row) => (
+              <React.Fragment key={row.id}>
+                <S.Row
+                  expanded={row.getIsExpanded()}
+                  onClick={handleRowClick(row)}
+                  clickable={
+                    !enableRowSelection &&
+                    (row.getCanExpand() || onRowClick !== undefined)
+                  }
+                >
+                  {!!enableRowSelection && (
+                    <td key={`${row.id}-select`} style={{ width: '1px' }}>
+                      {flexRender(
+                        SelectRowCell,
+                        row.getVisibleCells()[0].getContext()
+                      )}
                     </td>
-                  ))}
-              </S.Row>
-              {row.getIsExpanded() && SubComponent && (
-                <S.Row expanded>
-                  <td colSpan={row.getVisibleCells().length + 2}>
-                    <S.ExpandedRowInfo>
-                      <SubComponent row={row} />
-                    </S.ExpandedRowInfo>
-                  </td>
+                  )}
+                  {table.getCanSomeRowsExpand() && (
+                    <td key={`${row.id}-expander`} style={{ width: '1px' }}>
+                      {flexRender(
+                        ExpanderCell,
+                        row.getVisibleCells()[0].getContext()
+                      )}
+                    </td>
+                  )}
+                  {row
+                    .getVisibleCells()
+                    .map(({ id, getContext, column: { columnDef } }) => (
+                      <td key={id} style={columnDef.meta}>
+                        {flexRender(columnDef.cell, getContext())}
+                      </td>
+                    ))}
                 </S.Row>
-              )}
-            </React.Fragment>
-          ))}
-          {table.getRowModel().rows.length === 0 && (
-            <S.Row>
-              <S.EmptyTableMessageCell colSpan={100}>
-                {emptyMessage || 'No rows found'}
-              </S.EmptyTableMessageCell>
-            </S.Row>
-          )}
-        </tbody>
-      </S.Table>
+                {row.getIsExpanded() && SubComponent && (
+                  <S.Row expanded>
+                    <td colSpan={row.getVisibleCells().length + 2}>
+                      <S.ExpandedRowInfo>
+                        <SubComponent row={row} />
+                      </S.ExpandedRowInfo>
+                    </td>
+                  </S.Row>
+                )}
+              </React.Fragment>
+            ))}
+            {table.getRowModel().rows.length === 0 && (
+              <S.Row>
+                <S.EmptyTableMessageCell colSpan={100}>
+                  {emptyMessage || 'No rows found'}
+                </S.EmptyTableMessageCell>
+              </S.Row>
+            )}
+          </tbody>
+        </S.Table>
+      </S.TableWrapper>
       {table.getPageCount() > 1 && (
         <S.Pagination>
           <S.Pages>
diff --git a/kafka-ui-react-app/src/theme/theme.ts b/kafka-ui-react-app/src/theme/theme.ts
index 19c082c2840..5a2b806a01f 100644
--- a/kafka-ui-react-app/src/theme/theme.ts
+++ b/kafka-ui-react-app/src/theme/theme.ts
@@ -90,6 +90,7 @@ const theme = {
     navBarWidth: '201px',
     navBarHeight: '53px',
     rightSidebarWidth: '70vw',
+    filtersSidebarWidth: '300px',
 
     stuffColor: Colors.neutral[5],
     stuffBorderColor: Colors.neutral[10],


Test patch: