Skip to content

Conversation

@shubhamkumar9199
Copy link
Contributor

@shubhamkumar9199 shubhamkumar9199 commented Oct 22, 2025

Description

Enhanced the CSS for the button to improve spacing, padding, and alignment.

#{Issue Number}
WEB-(356)

Screenshots, if any

before:
Screenshot 2025-10-22 160037
after:
Screenshot 2025-10-22 170535

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • [ X ] If you have multiple commits please combine them into one commit by squashing them.

  • [ X ] Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

Summary by CodeRabbit

  • Style
    • Reorganized office details layout for improved readability with visual section dividers between data fields
    • Relocated Edit button from top navigation to bottom of page for intuitive access
    • Enhanced responsive design with compact styling for mobile and tablet views
    • Improved visual hierarchy and spacing throughout the office details interface

@coderabbitai
Copy link

coderabbitai bot commented Oct 22, 2025

Walkthrough

The pull request refactors the office view layout to a more compact, detail-focused design. Changes include HTML restructuring with repositioned buttons, added section dividers, modified external ID rendering, and extensive CSS updates for spacing, layout utilities, responsive behavior, and card styling.

Changes

Cohort / File(s) Summary
General tab component
src/app/organization/offices/view-office/general-tab/general-tab.component.html
Layout restructured to compact view: replaced top action area, added horizontal dividers after data rows, changed external ID rendering to conditional component display, moved Edit button to bottom with updated icon spacing.
General tab styling
src/app/organization/offices/view-office/general-tab/general-tab.component.scss
Added compact layout utility classes (compact-button, compact-details, m-b-10, m-r-5, bottom-button-container, layout-row-wrap, section-divider). Adjusted tab-container spacing (padding 1% → 0.5rem), width constraints (max-width 600px, width 90%), and enhanced button styling with sizing and hover effects.
View office component
src/app/organization/offices/view-office/view-office.component.html
Added CSS classes for layout styling: outer container uses narrow-container extra-small; mat-card-content, tab links, and tab panel receive presentation classes (card-content, compact-tab, tab-panel).
View office styling
src/app/organization/offices/view-office/view-office.component.scss
Extensive styling updates: action-button width 95% → 85%; office-card width 100% with card appearance enhancements; navigation-tabs with padding and scrollbar styling; added responsive rule for ≤768px viewports; introduced layout utility classes (.container, .narrow-container, .extra-small, .compact-tab, .card-content, .tab-panel).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes involve multiple files with straightforward styling and layout updates, along with minor HTML restructuring. While the scope is reasonable and most modifications follow consistent patterns (spacing adjustments, new utility classes), reviewers should verify responsive behavior across viewport sizes, button accessibility after repositioning, and component rendering logic for the external ID conditional display.

Suggested reviewers

  • alberto-art3ch
  • IOhacker

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "WEB-(356)-improve the css of general-tab" is specific and related to actual changes in the changeset. However, it captures only a portion of the work performed. The PR includes significant HTML template restructuring of the general-tab component (layout rework, added dividers, relocated buttons, changed external ID rendering) in addition to CSS improvements, and also introduces modifications to the view-office component (both HTML classes and styling). The title's focus on CSS improvements to only the general-tab component does not fully represent the scope and nature of the changes, which span multiple components and include substantial template modifications beyond pure styling improvements. Consider revising the title to better capture the full scope of changes. A more comprehensive title might reference the layout restructuring and multi-component nature of the changes, such as "WEB-(356)-refactor general-tab and view-office layouts with CSS improvements" or similar, to help teammates quickly understand that this PR involves both HTML restructuring and styling updates across multiple components.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/app/organization/offices/view-office/view-office.component.html (1)

15-27: *Add trackBy function to ngFor loop for better performance.

The *ngFor loop iterating over officeDatatables (line 15) is missing a trackBy function. Without it, Angular re-renders the entire list on each change cycle, causing unnecessary DOM operations.

Add a trackBy function to the component:

trackByTableName(index: number, item: any): string {
  return item.registeredTableName;
}

Then update the template to reference it:

-        <span *ngFor="let officeDatatable of officeDatatables">
+        <span *ngFor="let officeDatatable of officeDatatables; trackBy: trackByTableName">
🧹 Nitpick comments (3)
src/app/organization/offices/view-office/general-tab/general-tab.component.html (1)

22-27: *Simplify external ID conditional rendering using ngIf-else.

The dual *ngIf pattern for rendering external ID or "Unassigned" can be simplified with Angular's *ngIf-else directive to reduce redundant markup.

     <div class="flex-45 mat-body-strong left">{{ 'labels.inputs.External Id' | translate }}</div>
-    <div class="flex-50 right" *ngIf="officeData.externalId">
+    <div class="flex-50 right" *ngIf="officeData.externalId; else noExternalId">
       <mifosx-external-identifier externalId="{{ officeData.externalId }}"></mifosx-external-identifier>
     </div>
-    <div class="flex-50 right" *ngIf="!officeData.externalId">
+    <ng-template #noExternalId>
+      <div class="flex-50 right">
-      {{ 'labels.inputs.Unassigned' | translate }}
-    </div>
+        {{ 'labels.inputs.Unassigned' | translate }}
+      </div>
+    </ng-template>
src/app/organization/offices/view-office/view-office.component.scss (1)

43-46: Consider adding additional responsive breakpoints for better mobile coverage.

The current media query only targets devices with width ≤ 768px. Consider adding breakpoints for smaller screens (e.g., 480px, 600px) to ensure the layout remains usable on various mobile devices and tablets.

For example:

// Mobile-first: additional breakpoints
@media (width <= 480px) {
  .office-card {
    width: 95%;
    padding: 0.3rem;
  }
}

@media (width <= 600px) {
  // Tablet-specific adjustments
}
src/app/organization/offices/view-office/general-tab/general-tab.component.scss (1)

80-97: Clarify the distinction between container width constraints.

The stylesheet defines multiple width constraint classes with overlapping purposes:

  • .compact-view (max-width: 450px)
  • .narrow-container (max-width: 600px, in view-office.component.scss)
  • .tab-container.compact-view (max-width: 450px, lines 109-112)

The purpose and intended usage of each is unclear. Consider adding comments to document when to use which class, or consolidate if they serve identical purposes.

Example documentation:

// Use for the general tab's compact detail view
.compact-view {
  max-width: 450px;
  // ...
}

// Use for the outer office view container (wider than general tab)
.narrow-container {
  max-width: 600px;
  // ...
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bddeb56 and 81dc6f8.

📒 Files selected for processing (4)
  • src/app/organization/offices/view-office/general-tab/general-tab.component.html (2 hunks)
  • src/app/organization/offices/view-office/general-tab/general-tab.component.scss (2 hunks)
  • src/app/organization/offices/view-office/view-office.component.html (2 hunks)
  • src/app/organization/offices/view-office/view-office.component.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/app/**

⚙️ CodeRabbit configuration file

src/app/**: For Angular code: verify component separation, trackBy on *ngFor,
strict type safety, and clean observable patterns.

Files:

  • src/app/organization/offices/view-office/general-tab/general-tab.component.html
  • src/app/organization/offices/view-office/view-office.component.html
  • src/app/organization/offices/view-office/view-office.component.scss
  • src/app/organization/offices/view-office/general-tab/general-tab.component.scss
🔇 Additional comments (1)
src/app/organization/offices/view-office/general-tab/general-tab.component.html (1)

30-36: Button relocation and styling updates look good.

The repositioning of the Edit button to the bottom-button-container with updated icon spacing and permission gating is clean and aligns with the compact UI design.

Comment on lines +39 to +45
.m-b-10 {
margin-bottom: 10px;
}

.m-r-5 {
margin-right: 5px;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Consider centralizing margin utility classes.

The generic margin utilities .m-b-10 and .m-r-5 are defined within this component-scoped SCSS file. If these are used across multiple components or if a global utility system already exists, consider:

  1. Moving these to a shared utilities file (e.g., src/styles/utilities.scss or similar)
  2. Checking if a Tailwind CSS or Bootstrap utility system already provides these

This will improve maintainability and prevent duplicate utility definitions across the codebase.

Run the following script to check if these utilities exist elsewhere:


🏁 Script executed:

#!/bin/bash
# Search for duplicate margin utility definitions

echo "=== Searching for .m-r-5 definition ==="
rg -nA2 '\.m-r-5\s*\{' --type scss

echo "=== Searching for .m-b-10 definition ==="
rg -nA2 '\.m-b-10\s*\{' --type scss

echo "=== Checking for global utilities file ==="
fd -e scss -e css | grep -iE 'utilities|common|global|variables' | head -10

Length of output: 508


Now I'll run a corrected script to search for the margin utilities in the codebase.


---

🏁 Script executed:

```shell
#!/bin/bash
# Search for margin utility definitions using corrected approach

echo "=== Searching for .m-r-5 definitions (glob pattern) ==="
rg -nA2 '\.m-r-5\s*\{' -g '*.scss' -g '*.css'

echo ""
echo "=== Searching for .m-b-10 definitions (glob pattern) ==="
rg -nA2 '\.m-b-10\s*\{' -g '*.scss' -g '*.css'

echo ""
echo "=== Searching for margin utility pattern m-[rblt]-[0-9] ==="
rg -nA1 '\.m-[rblt]-\d+\s*\{' -g '*.scss' -g '*.css' | head -20

echo ""
echo "=== Checking if general-tab.component.scss has margins ==="
rg -n 'margin-(right|bottom):' src/app/organization/offices/view-office/general-tab/general-tab.component.scss

echo ""
echo "=== Checking theme variables file ==="
cat src/theme/_variables.scss 2>/dev/null | head -50 || echo "File not found or cannot be read"

Length of output: 2189


Now I'll verify how global utilities are loaded in this component and whether there are other style imports.


🏁 Script executed:

#!/bin/bash
# Verify component style configuration and global utility import

echo "=== Full general-tab.component.scss content ==="
cat src/app/organization/offices/view-office/general-tab/general-tab.component.scss

echo ""
echo "=== Checking general-tab.component.ts for styleUrls ==="
rg -n 'styleUrls|styles:' src/app/organization/offices/view-office/general-tab/general-tab.component.ts -A3 -B1

echo ""
echo "=== Checking if global styles are imported in angular.json or main.ts ==="
grep -r '_margin\.scss' src/ 2>/dev/null | head -5

echo ""
echo "=== Checking styles.scss for global utility imports ==="
cat src/styles.scss 2>/dev/null | grep -E '@import.*margin|@include' | head -10

Length of output: 1902


Remove duplicate margin utilities from component SCSS.

The utilities .m-b-10 and .m-r-5 (lines 39-45) are duplicated. They already exist in src/assets/styles/_margin.scss with identical definitions. Remove these lines and either:

  • Import the global utilities file: @import 'src/assets/styles/margin';
  • Or ensure global styles are accessible to this component

This eliminates code duplication and aligns with the established utility system.

🤖 Prompt for AI Agents
In
src/app/organization/offices/view-office/general-tab/general-tab.component.scss
around lines 39 to 45, the `.m-b-10` and `.m-r-5` margin utility rules are
duplicates of the global utilities in src/assets/styles/_margin.scss; remove
these two rule blocks from this component stylesheet and either add an import of
the shared utilities (e.g., import the global margin utilities file from
src/assets/styles/margin) at the top of this component SCSS or ensure the global
styles are included via the project/global style pipeline so the component uses
the single source of truth for margin utilities.

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.

1 participant