-
Notifications
You must be signed in to change notification settings - Fork 208
fix: added responsive-table class in few tables for mobile responsivness #2757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,40 +101,44 @@ | |
| </Typography.Text> | ||
| </Layout.Stack> | ||
|
|
||
| <Table.Root | ||
| columns={[ | ||
| { id: 'type', width: { min: 150 } }, | ||
| { id: 'name', width: { min: 80 } }, | ||
| { id: 'value', width: { min: 100 } } | ||
| ]} | ||
| let:root> | ||
| <svelte:fragment slot="header" let:root> | ||
| <Table.Header.Cell column="type" {root}>Type</Table.Header.Cell> | ||
| <Table.Header.Cell column="name" {root}>Name</Table.Header.Cell> | ||
| <Table.Header.Cell column="value" {root}>Value</Table.Header.Cell> | ||
| </svelte:fragment> | ||
| <Table.Row.Base {root}> | ||
| <Table.Cell column="type" {root}>{variant.toUpperCase()}</Table.Cell> | ||
| <Table.Cell column="name" {root}>{subdomain || '@'}</Table.Cell> | ||
| <Table.Cell column="value" {root}> | ||
| <InteractiveText variant="copy" isVisible text={setTarget()} /> | ||
| </Table.Cell> | ||
| </Table.Row.Base> | ||
| {#if $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA} | ||
| <div class="responsive-table"> | ||
| <Table.Root | ||
| columns={[ | ||
| { id: 'type', width: { min: 150 } }, | ||
| { id: 'name', width: { min: 80 } }, | ||
| { id: 'value', width: { min: 200 } } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reconsider increasing the column width for mobile responsiveness. Increasing the value column's 💡 Alternative approachesOption 1: Revert to the original width: -{ id: 'value', width: { min: 200 } }
+{ id: 'value', width: { min: 100 } }Option 2: Use a flexible width without a fixed minimum: -{ id: 'value', width: { min: 200 } }
+{ id: 'value', width: { min: 80 } }Option 3: Make long values wrap or truncate with ellipsis on mobile using CSS. 🤖 Prompt for AI Agents |
||
| ]} | ||
| let:root> | ||
| <svelte:fragment slot="header" let:root> | ||
| <Table.Header.Cell column="type" {root}>Type</Table.Header.Cell> | ||
| <Table.Header.Cell column="name" {root}>Name</Table.Header.Cell> | ||
| <Table.Header.Cell column="value" {root}>Value</Table.Header.Cell> | ||
| </svelte:fragment> | ||
|
|
||
| <Table.Row.Base {root}> | ||
| <Table.Cell column="type" {root}> | ||
| <Layout.Stack gap="s" direction="row" alignItems="center"> | ||
| <span>CAA</span> | ||
| <Badge variant="secondary" size="xs" content="Recommended" /> | ||
| </Layout.Stack> | ||
| </Table.Cell> | ||
| <Table.Cell column="name" {root}>@</Table.Cell> | ||
| <Table.Cell column="type" {root}>{variant.toUpperCase()}</Table.Cell> | ||
| <Table.Cell column="name" {root}>{subdomain || '@'}</Table.Cell> | ||
| <Table.Cell column="value" {root}> | ||
| <InteractiveText variant="copy" isVisible text={caaText} /> | ||
| <InteractiveText variant="copy" isVisible text={setTarget()} /> | ||
| </Table.Cell> | ||
| </Table.Row.Base> | ||
| {/if} | ||
| </Table.Root> | ||
|
|
||
| {#if $regionalConsoleVariables._APP_DOMAIN_TARGET_CAA} | ||
| <Table.Row.Base {root}> | ||
| <Table.Cell column="type" {root}> | ||
| <Layout.Stack direction="row" alignItems="center" gap="s"> | ||
| <span>CAA</span> | ||
| <Badge variant="secondary" size="xs" content="Recommended" /> | ||
| </Layout.Stack> | ||
| </Table.Cell> | ||
| <Table.Cell column="name" {root}>@</Table.Cell> | ||
| <Table.Cell column="value" {root}> | ||
| <InteractiveText variant="copy" isVisible text={caaText} /> | ||
| </Table.Cell> | ||
| </Table.Row.Base> | ||
| {/if} | ||
| </Table.Root> | ||
| </div> | ||
|
Comment on lines
+104
to
+141
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: The responsive wrapper uses 🔎 Proposed fixUpdate the CSS (lines 180-185) to enable horizontal scrolling: .responsive-table {
- overflow: hidden;
+ overflow-x: auto;
width: 100%;
scrollbar-width: thin;
position: relative;
}
🤖 Prompt for AI Agents |
||
| <Layout.Stack gap="s" direction="row" alignItems="center"> | ||
| {#if variant === 'cname' && !subdomain} | ||
| {#if isCloud} | ||
|
|
@@ -170,3 +174,13 @@ | |
| {/if} | ||
| </Layout.Stack> | ||
| </Layout.Stack> | ||
|
|
||
| <style> | ||
| /* responsive table container */ | ||
| .responsive-table { | ||
| overflow: hidden; | ||
| width: 100%; | ||
| scrollbar-width: thin; | ||
| position: relative; | ||
| } | ||
| </style> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,57 +49,59 @@ | |
| expanded={databasesScreen && !insideSideSheet} | ||
| slotSpacing={databasesScreen && !insideSideSheet}> | ||
| {#if logs.total} | ||
| <Table.Root {columns} let:root> | ||
| <svelte:fragment slot="header" let:root> | ||
| <Table.Header.Cell column="user" {root}>User</Table.Header.Cell> | ||
| <Table.Header.Cell column="event" {root}>Event</Table.Header.Cell> | ||
| <Table.Header.Cell column="location" {root}>Location</Table.Header.Cell> | ||
| <Table.Header.Cell column="ip" {root}>IP</Table.Header.Cell> | ||
| <Table.Header.Cell column="date" {root}>Date</Table.Header.Cell> | ||
| </svelte:fragment> | ||
| {#each logs.logs as log} | ||
| <Table.Row.Base {root}> | ||
| <Table.Cell column="user" {root}> | ||
| <Layout.Stack direction="row" alignItems="center"> | ||
| {#if log.userEmail} | ||
| {#if log.userName} | ||
| <AvatarInitials size="xs" name={log.userName} /> | ||
| <Trim>{log.userName}</Trim> | ||
| <div class="responsive-table"> | ||
| <Table.Root {columns} let:root> | ||
| <svelte:fragment slot="header" let:root> | ||
| <Table.Header.Cell column="user" {root}>User</Table.Header.Cell> | ||
| <Table.Header.Cell column="event" {root}>Event</Table.Header.Cell> | ||
| <Table.Header.Cell column="location" {root}>Location</Table.Header.Cell> | ||
| <Table.Header.Cell column="ip" {root}>IP</Table.Header.Cell> | ||
| <Table.Header.Cell column="date" {root}>Date</Table.Header.Cell> | ||
| </svelte:fragment> | ||
| {#each logs.logs as log} | ||
| <Table.Row.Base {root}> | ||
| <Table.Cell column="user" {root}> | ||
| <Layout.Stack direction="row" alignItems="center"> | ||
| {#if log.userEmail} | ||
| {#if log.userName} | ||
| <AvatarInitials size="xs" name={log.userName} /> | ||
| <Trim>{log.userName}</Trim> | ||
| {:else} | ||
| <AvatarInitials size="xs" name={log.userEmail} /> | ||
| <Trim>{log.userEmail}</Trim> | ||
| {/if} | ||
| {:else} | ||
| <AvatarInitials size="xs" name={log.userEmail} /> | ||
| <Trim>{log.userEmail}</Trim> | ||
| <div class="avatar is-size-small"> | ||
| <span class="icon-anonymous" aria-hidden="true"></span> | ||
| </div> | ||
| <span class="text u-trim">{log.userName ?? 'Anonymous'}</span> | ||
| {/if} | ||
| {:else} | ||
| <div class="avatar is-size-small"> | ||
| <span class="icon-anonymous" aria-hidden="true"></span> | ||
| </div> | ||
| <span class="text u-trim">{log.userName ?? 'Anonymous'}</span> | ||
| {/if} | ||
| </Layout.Stack> | ||
| </Table.Cell> | ||
| </Layout.Stack> | ||
| </Table.Cell> | ||
|
|
||
| <Table.Cell column="event" {root}> | ||
| {log.event} | ||
| </Table.Cell> | ||
| <Table.Cell column="event" {root}> | ||
| {log.event} | ||
| </Table.Cell> | ||
|
|
||
| <Table.Cell column="location" {root}> | ||
| {#if log.countryCode !== '--'} | ||
| {log.countryName} | ||
| {:else} | ||
| Unknown | ||
| {/if} | ||
| </Table.Cell> | ||
| <Table.Cell column="location" {root}> | ||
| {#if log.countryCode !== '--'} | ||
| {log.countryName} | ||
| {:else} | ||
| Unknown | ||
| {/if} | ||
| </Table.Cell> | ||
|
|
||
| <Table.Cell column="ip" {root}> | ||
| <InteractiveText variant="copy" text={log.ip} isVisible /> | ||
| </Table.Cell> | ||
| <Table.Cell column="ip" {root}> | ||
| <InteractiveText variant="copy" text={log.ip} isVisible /> | ||
| </Table.Cell> | ||
|
|
||
| <Table.Cell column="date" {root}> | ||
| <DualTimeView time={log.time} showDatetime /> | ||
| </Table.Cell> | ||
| </Table.Row.Base> | ||
| {/each} | ||
| </Table.Root> | ||
| <Table.Cell column="date" {root}> | ||
| <DualTimeView time={log.time} showDatetime /> | ||
| </Table.Cell> | ||
| </Table.Row.Base> | ||
| {/each} | ||
| </Table.Root> | ||
| </div> | ||
|
Comment on lines
+52
to
+104
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: The responsive wrapper uses 🔎 Proposed fixUpdate the CSS (lines 133-138) to enable horizontal scrolling: .responsive-table {
- overflow: hidden;
+ overflow-x: auto;
width: 100%;
scrollbar-width: thin;
position: relative;
}
🤖 Prompt for AI Agents |
||
|
|
||
| <PaginationWithLimit | ||
| {limit} | ||
|
|
@@ -126,3 +128,12 @@ | |
| </Card.Base> | ||
| {/if} | ||
| </Container> | ||
|
|
||
| <style> | ||
| .responsive-table { | ||
| overflow: hidden; | ||
| width: 100%; | ||
| scrollbar-width: thin; | ||
| position: relative; | ||
| } | ||
| </style> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical:
overflow: hiddenprevents scrolling on mobile devices.The responsive wrapper uses
overflow: hidden, which will clip table content when it exceeds the container width on mobile devices. This defeats the purpose of adding responsive table support, as users won't be able to access clipped content.🔎 Proposed fix
Update the CSS to enable horizontal scrolling:
.responsive-table { - overflow: hidden; + overflow-x: auto; width: 100%; scrollbar-width: thin; position: relative; }🤖 Prompt for AI Agents