Conversation
WalkthroughThis PR moves reactTable background styling into the inner table, changes the table wrapper layout to inline-block with content-width behavior, adds z-index to a sidebar popup container, and implements stored-file background image fetching and usage in TableWrapper while expanding useSheshaApplication to return backendUrl and httpHeaders. Changes
Sequence DiagramsequenceDiagram
participant TW as TableWrapper Component
participant Hook as useSheshaApplication Hook
participant Helper as getBackgroundImageUrl Helper
participant Style as getBackgroundStyle Util
TW->>Hook: read backendUrl, httpHeaders (and permissions)
TW->>TW: detect background.type === "storedFile"
TW->>Helper: getBackgroundImageUrl(background, backendUrl, httpHeaders)
Helper-->>TW: storedFileBackgroundUrl
TW->>TW: set storedFileBackgroundUrl state
TW->>Style: getBackgroundStyle(..., storedFileBackgroundUrl)
Style-->>TW: computed background CSS
TW->>TW: apply background to inner .shaTable
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@shesha-reactjs/src/components/reactTable/styles/styles.ts`:
- Around line 193-195: The current rule sets min-width: calc(100% - 16px)
unconditionally, causing unwanted gaps when no box-shadow/margins are present;
change the styling to only subtract the 16px when the box-shadow margin is
applied by either (A) introducing a CSS variable (e.g., --box-shadow-margin) and
using min-width: calc(100% - var(--box-shadow-margin, 0)) so the subtraction
defaults to 0, or (B) move min-width: calc(100% - 16px) into a conditional class
(e.g., .withBoxShadow or .hasBoxShadow) that you add when the 8px margins are
present; update the rule that defines display, width and min-width in styles.ts
to use one of these approaches so the subtraction is only applied when the
boxShadow margin exists.
In `@shesha-reactjs/src/designer-components/dataTable/table/tableWrapper.tsx`:
- Around line 159-173: The effect that sets storedFileBackgroundUrl via
fetchStoredFileUrl must handle errors and avoid stale state updates: wrap the
await getBackgroundImageUrl(...) call in try/catch and log or swallow errors to
prevent unhandled rejections, and add a cleanup mechanism (e.g., an
AbortController passed into getBackgroundImageUrl if supported or an
isCancelled/isMounted flag) inside the useEffect so that
setStoredFileBackgroundUrl is only called when the fetch is still valid; update
the useEffect to cancel or ignore outstanding requests on unmount or when
props/background changes to prevent stale updates from fetchStoredFileUrl.
| display: inline-block; | ||
| width: max-content; | ||
| min-width: calc(100% - 16px); |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Tie the -16px min-width to the boxShadow margin.
The width reduction is applied even when no boxShadow/margin is set, which can leave an unintended gap or trigger horizontal scroll in full-width layouts. Consider applying the subtraction only when the 8px margins are actually added.
♻️ Suggested adjustment
- min-width: calc(100% - 16px);
+ min-width: ${boxShadow ? 'calc(100% - 16px)' : '100%'};🤖 Prompt for AI Agents
In `@shesha-reactjs/src/components/reactTable/styles/styles.ts` around lines 193 -
195, The current rule sets min-width: calc(100% - 16px) unconditionally, causing
unwanted gaps when no box-shadow/margins are present; change the styling to only
subtract the 16px when the box-shadow margin is applied by either (A)
introducing a CSS variable (e.g., --box-shadow-margin) and using min-width:
calc(100% - var(--box-shadow-margin, 0)) so the subtraction defaults to 0, or
(B) move min-width: calc(100% - 16px) into a conditional class (e.g.,
.withBoxShadow or .hasBoxShadow) that you add when the 8px margins are present;
update the rule that defines display, width and min-width in styles.ts to use
one of these approaches so the subtraction is only applied when the boxShadow
margin exists.
Summary by CodeRabbit
New Features
Bug Fixes