Skip to content

UI and build cleanups - #320

Merged
AhmadRAbuhussein merged 4 commits into
releases/r10.0from
hamza/fix/ui-and-build-cleanups
Sep 21, 2026
Merged

AhmadRAbuhussein merged 4 commits into
releases/r10.0from
hamza/fix/ui-and-build-cleanups

Conversation

@hamzahalq

Copy link
Copy Markdown
Contributor

Four small fixes, one per commit.

  • Mapper editor toolbar — fourteen controls sat in one flat row. The formats and their CSV options move behind a JSON → CSV chip, which also stops the row jumping width when a side changes format.
  • Popover — the panel closed on any scroll anywhere on the page, because the listener is on document in the capture phase. A pane re-rendering elsewhere was enough to shut it under you. Opt-out prop, default unchanged.
  • wwwroot/assets — chunks are named after their content, so nothing ever overwrote anything and the folder only grew: 146 files and 178MB of superseded bundles, all still servable. Cleared on each build, assets/ only.
  • Silent sign-out — getSession turned every failure into "signed out", so a busy or briefly unreachable backend sent people to the sign-in page mid-task with a good token still in localStorage. Only a refused token ends the session now; anything else shows an outage with a retry.

Verified in the browser, plus the four mapper specs and a new session-outage.spec.ts (5 tests).

The scroll listener is on document in the capture phase, so any scrolling
element on the page closed the panel — including a pane that had only
re-rendered elsewhere. Defaults to the old behaviour.
The formats and their CSV options move behind a "JSON -> CSV" chip, which
stops the row jumping width when a side changes format. Back/title, rule
actions and editor state are now separated rather than all at one level.
Chunks are named after their content, so nothing overwrote anything and the
folder only grew — 146 files and 178MB of superseded bundles, all servable.
Only assets/, since the rest of wwwroot is legacy content the SPA does not own.
getSession turned every failure into "signed out", so a busy or briefly
unreachable backend sent people to the sign-in page mid-task with a perfectly
good token still in localStorage. Only a refused token ends the session now;
anything else shows an outage with a retry.
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: simplify9/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 0a9d79a6-ae4b-4ade-af5e-0399c922eb1b

📥 Commits

Reviewing files that changed from the base of the PR and between b660a96 and 112ae99.

📒 Files selected for processing (12)
  • SW.Bitween.Web/ClientApp/e2e/mapper-csv.spec.ts
  • SW.Bitween.Web/ClientApp/e2e/mapper-xml.spec.ts
  • SW.Bitween.Web/ClientApp/e2e/mapperHelpers.ts
  • SW.Bitween.Web/ClientApp/e2e/native-mapper.spec.ts
  • SW.Bitween.Web/ClientApp/e2e/readable-documents.spec.ts
  • SW.Bitween.Web/ClientApp/e2e/session-outage.spec.ts
  • SW.Bitween.Web/ClientApp/src/api/http/session.ts
  • SW.Bitween.Web/ClientApp/src/auth/SessionContext.tsx
  • SW.Bitween.Web/ClientApp/src/auth/guards.tsx
  • SW.Bitween.Web/ClientApp/src/components/nativeMapper/NativeMapperEditor.tsx
  • SW.Bitween.Web/ClientApp/src/components/ui/Popover.tsx
  • SW.Bitween.Web/ClientApp/vite.config.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
🔇 Additional comments (12)
SW.Bitween.Web/ClientApp/vite.config.ts (1)

1-3: LGTM!

Also applies to: 7-25, 32-32, 37-37

SW.Bitween.Web/ClientApp/src/components/nativeMapper/NativeMapperEditor.tsx (1)

4-4: LGTM!

Also applies to: 29-29, 177-183, 199-206, 320-393, 462-462, 502-516, 537-537, 554-570, 582-590

SW.Bitween.Web/ClientApp/src/components/ui/Popover.tsx (1)

24-24: LGTM!

Also applies to: 34-41, 73-81

SW.Bitween.Web/ClientApp/e2e/mapperHelpers.ts (1)

66-84: LGTM!

SW.Bitween.Web/ClientApp/e2e/mapper-csv.spec.ts (1)

9-9: LGTM!

Also applies to: 46-52, 148-152, 171-171, 184-184, 216-220, 271-271, 280-282

SW.Bitween.Web/ClientApp/e2e/mapper-xml.spec.ts (1)

14-14: LGTM!

Also applies to: 63-63, 124-127, 158-161, 187-190, 210-213

SW.Bitween.Web/ClientApp/e2e/readable-documents.spec.ts (1)

9-9: LGTM!

Also applies to: 44-44, 137-137

SW.Bitween.Web/ClientApp/e2e/native-mapper.spec.ts (1)

223-225: LGTM!

SW.Bitween.Web/ClientApp/src/auth/SessionContext.tsx (1)

27-34: LGTM!

Also applies to: 53-59, 66-78, 178-191

SW.Bitween.Web/ClientApp/src/auth/guards.tsx (1)

3-11: LGTM!

Also applies to: 21-37

SW.Bitween.Web/ClientApp/src/api/http/session.ts (1)

88-88: 🎯 Functional Correctness

The HTTP_403 concern is refuted for /accounts/profile. The profile handler is deliberately ungated for every signed-in caller, and repository authorization failures are mapped to HTTP 401. No profile account-state or permission path returns HTTP 403.

SW.Bitween.Web/ClientApp/e2e/session-outage.spec.ts (1)

1-61: LGTM!


📝 Summary

Summary

  • Reorganized mapper format and CSV controls behind a JSON → CSV popover chip.
  • Added Popover.closeOnScroll, with the existing default of true.
  • Cleared only wwwroot/assets before Vite builds to remove stale hashed chunks.
  • Changed session handling so only authentication refusal signs users out. Other failures show a retryable Can't reach Bitween state.
  • Added Playwright coverage for session outages, recovery, mapper format controls, and mapper selection behavior.

Risk

risk:medium

Session state and sign-out behavior changed. Build cleanup also affects generated deployment assets.

Security-sensitive areas

  • getSession now preserves tokens during non-authentication failures.
  • HTTP 401/403-style authentication refusal still redirects users to sign-in.
  • The outage state exposes a retry path without treating backend availability failures as authentication failures.

Test coverage impact

  • Added session-outage.spec.ts coverage for 429, 500, 503, 401, token retention, retry, and recovery.
  • Updated mapper and readable-document tests to use the format-settings helper.
  • Browser verification and the stated mapper/session test coverage were completed.

Operational concerns

  • The build removes wwwroot/assets before each build.
  • Other wwwroot content remains unchanged.
  • Verify deployment behavior when builds run incrementally or when previous asset files are required for rollback.
  • No migration is indicated. Rollback requires reverting the session behavior, popover API, UI changes, and build plugin together.

Walkthrough

The pull request adds session outage handling with retry support, moves mapper format controls into a popover, centralizes related end-to-end interactions, updates mapper selection coverage, and selectively cleans Vite assets before builds.

Changes

Session outage handling

Layer / File(s) Summary
Session state and outage UI
SW.Bitween.Web/ClientApp/src/api/http/session.ts, SW.Bitween.Web/ClientApp/src/auth/SessionContext.tsx, SW.Bitween.Web/ClientApp/src/auth/guards.tsx
Session requests now rethrow non-authentication failures. The authentication context exposes unreachable and retry. RequireAuth renders an outage screen with a retry button.
Outage and recovery coverage
SW.Bitween.Web/ClientApp/e2e/session-outage.spec.ts
Playwright tests cover 429, 500, 503, and 401 responses, token retention, sign-out, and recovery.

Mapper settings interaction

Layer / File(s) Summary
Format settings panel
SW.Bitween.Web/ClientApp/src/components/nativeMapper/NativeMapperEditor.tsx, SW.Bitween.Web/ClientApp/src/components/ui/Popover.tsx
Format and CSV controls now render in a popover with shared setting rows. Popover supports disabling scroll dismissal.
Shared format-panel test helper
SW.Bitween.Web/ClientApp/e2e/mapperHelpers.ts
withFormats opens the format panel, runs selections, closes it, and verifies that it is hidden.
Format selection test migration
SW.Bitween.Web/ClientApp/e2e/mapper-csv.spec.ts, SW.Bitween.Web/ClientApp/e2e/mapper-xml.spec.ts, SW.Bitween.Web/ClientApp/e2e/readable-documents.spec.ts
Existing format and CSV-control interactions now use withFormats.
Selected mapper editor validation
SW.Bitween.Web/ClientApp/e2e/native-mapper.spec.ts
The mapper-selection test now checks for the selected editor's mapping description button.

Asset build cleanup

Layer / File(s) Summary
Selective asset cleanup
SW.Bitween.Web/ClientApp/vite.config.ts
Vite resolves the assets directory and removes it before each build while keeping other wwwroot content.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix

Suggested labels: security, risk:critical

Suggested reviewers: ahmadrabuhussein

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately covers the UI and build changes, although it omits the session outage handling changes.
Description check ✅ Passed The description clearly summarizes all four changes and the related browser and end-to-end test verification.
Docstring Coverage ✅ Passed Docstring coverage is 82.35% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 12 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AhmadRAbuhussein
AhmadRAbuhussein merged commit f5f199d into releases/r10.0 Sep 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants