Skip to content

chore: add template syntax and signals#2

Merged
santoshyadavdev merged 2 commits intomainfrom
template-syntax-part=2
Mar 4, 2026
Merged

chore: add template syntax and signals#2
santoshyadavdev merged 2 commits intomainfrom
template-syntax-part=2

Conversation

@santoshyadavdev
Copy link
Owner

@santoshyadavdev santoshyadavdev commented Feb 26, 2026

Summary by CodeRabbit

  • New Features

    • Property-type filter buttons to view Hotels, Motels, Resorts, or Hostels.
    • Improved hotel entries showing name, location and contextual room availability messages.
    • New empty-state and error messages for each property type and general failures.
  • Style

    • Alternating row colors for improved dashboard readability.

@santoshyadavdev
Copy link
Owner Author

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 663cb9ef-7f51-4882-85a5-2bade915f68a

📥 Commits

Reviewing files that changed from the base of the PR and between c0896ba and c4dbb84.

📒 Files selected for processing (2)
  • apps/hotelmanagement/src/app/dashboard/dashboard.html
  • apps/hotelmanagement/src/app/dashboard/dashboard.ts

📝 Walkthrough

Walkthrough

Refactors Dashboard to use Angular signals for reactive state (title, bookings, hotel list), adds property-type filtering with template switch rendering and conditional room-availability messages, adds alternating-row CSS classes, and removes Tailwind directives from global styles.

Changes

Cohort / File(s) Summary
Dashboard Component
apps/hotelmanagement/src/app/dashboard/dashboard.ts, apps/hotelmanagement/src/app/dashboard/dashboard.html, apps/hotelmanagement/src/app/dashboard/dashboard.css
Converted title, numberOfBookings, and hotelList to Angular signals; extended Hotel interface with id and numberOfRooms; added propertyTypes signal. Template now uses {{title()}}, filter buttons, a switch over propertyTypes() with cases for Hotel/Motel/Resort/Hostel, loop over hotelList() with index-parity .even/.odd classes and conditional room-availability messages. Added .even and .odd CSS classes.
Global Styling
apps/hotelmanagement/src/styles.css
Removed Tailwind directives @tailwind base;, @tailwind components;, and @tailwind utilities; (global Tailwind layers deleted).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped into code with a twitchy nose,
Buttons and signals where the data flows,
Stripes on each row, rooms told with a wink,
Filters click softly — quicker than a blink,
The dashboard hums; I bounce, nibble, and pose.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore: add template syntax and signals' is vague and does not clearly describe the main changes. While it mentions 'template syntax and signals,' it lacks specificity about what was actually changed. Use a more descriptive title that clearly conveys the primary changes, such as 'refactor: migrate dashboard to signals and enhance property filtering' or similar.
✅ 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 changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch template-syntax-part=2

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

@coderabbitai coderabbitai bot added the enhancement New feature or request label Feb 26, 2026
Copy link
Contributor

@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: 3

🧹 Nitpick comments (4)
apps/hotelmanagement/src/app/dashboard/dashboard.css (1)

1-7: Consider verifying color contrast for accessibility.

These background colors are fairly dark/saturated. Ensure that any text rendered on these backgrounds has sufficient contrast ratio (WCAG recommends at least 4.5:1 for normal text). Based on the template, the <p> element displaying the index will have these backgrounds.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/hotelmanagement/src/app/dashboard/dashboard.css` around lines 1 - 7, The
.even and .odd background colors are dark/saturated and may fail WCAG contrast
for the index <p>; verify contrast and update styles so text meets at least
4.5:1 (e.g., set a high-contrast foreground color or choose lighter/darker
background variants). Locate the .even and .odd selectors in dashboard.css and
either change the background colors to accessible hex values or explicitly set a
contrasting color property for the index <p> (or a shared class) and document
the chosen color values after testing with a contrast checker.
apps/hotelmanagement/src/app/dashboard/dashboard.html (2)

3-3: Remove commented-out code.

Lines 3 and 41-43 contain commented-out template code. Consider removing dead code to keep the template clean, or restore it if still needed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/hotelmanagement/src/app/dashboard/dashboard.html` at line 3, The
template contains dead commented-out conditional code (e.g. <!-- `@if`
(hotelList.length > 0) {  --> and its corresponding closing comment later) that
should be cleaned up; either remove these HTML comments entirely to keep
dashboard.html tidy, or restore them to active template logic by replacing the
comment wrappers with the actual framework directive (for example use
*ngIf="hotelList.length > 0" or the appropriate templating syntax your app uses)
so the conditional is functional; update only the commented block(s) around the
hotel list rendering to either delete them or convert them into the correct
conditional directive.

12-16: Inconsistent variable usage: prefer index over $index.

You declare let index = $index on line 12-13 but then use $index directly on line 16. For consistency, use the index variable you declared.

♻️ Proposed fix
-  <p [class]="even ? 'even' : 'odd'">{{$index + 1}}</p>
+  <p [class]="even ? 'even' : 'odd'">{{index + 1}}</p>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/hotelmanagement/src/app/dashboard/dashboard.html` around lines 12 - 16,
You declared a local loop variable `index` (let index = $index) but the template
still uses `$index`; update the template to use the `index` variable wherever
`$index` is referenced (e.g., replace `{{$index + 1}}` with `{{index + 1}}`)
inside the for loop over `hotelList()` (track hotel.id) to keep variable usage
consistent with the declared `index` binding; ensure other references inside the
same loop do not use `$index` elsewhere.
apps/hotelmanagement/src/app/dashboard/dashboard.ts (1)

20-22: Unused properties: numberOfBookings and dateOfLastBooking.

These properties are defined but not referenced in the template. If they're intended for future use, consider adding a TODO comment; otherwise, remove them to reduce confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/hotelmanagement/src/app/dashboard/dashboard.ts` around lines 20 - 22,
The class defines unused properties numberOfBookings (a signal) and
dateOfLastBooking which aren't referenced in the template; either remove these
properties from apps/hotelmanagement/src/app/dashboard/dashboard.ts if they're
not needed, or annotate them with a clear TODO comment and a short justification
and/or wire them into the template or component logic (e.g., update methods that
set numberOfBookings or dateOfLastBooking) to make their usage explicit; update
or remove imports related to signal if you delete numberOfBookings to avoid
unused-import warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/hotelmanagement/src/app/dashboard/dashboard.html`:
- Line 38: Fix the typo in the dashboard template by changing the H4 text
"Somehing went wrong. Please try again later." to "Something went wrong. Please
try again later." — update the string in
apps/hotelmanagement/src/app/dashboard/dashboard.html (the H4 element in the
dashboard view) so the user-facing message reads "Something" correctly.

In `@apps/hotelmanagement/src/app/dashboard/dashboard.ts`:
- Line 2: The import of the symbol "single" from 'rxjs' is unused in this file;
remove the unused import statement (the "import { single } from 'rxjs';" line)
so the module no longer imports an unused symbol and lints cleanly.

In `@apps/hotelmanagement/src/styles.css`:
- Line 1: Restore the Tailwind directives in styles.css or add equivalent custom
CSS: reopen styles.css and either re-add the three Tailwind directives
"@tailwind base; `@tailwind` components; `@tailwind` utilities;" so Tailwind
generates utilities like rounded and shadow used by components (e.g.,
nx-welcome.ts), or, if you prefer not to use Tailwind, implement CSS rules in
styles.css for every used utility class (rounded, shadow, etc.) ensuring those
class names match the utilities referenced in components.

---

Nitpick comments:
In `@apps/hotelmanagement/src/app/dashboard/dashboard.css`:
- Around line 1-7: The .even and .odd background colors are dark/saturated and
may fail WCAG contrast for the index <p>; verify contrast and update styles so
text meets at least 4.5:1 (e.g., set a high-contrast foreground color or choose
lighter/darker background variants). Locate the .even and .odd selectors in
dashboard.css and either change the background colors to accessible hex values
or explicitly set a contrasting color property for the index <p> (or a shared
class) and document the chosen color values after testing with a contrast
checker.

In `@apps/hotelmanagement/src/app/dashboard/dashboard.html`:
- Line 3: The template contains dead commented-out conditional code (e.g. <!--
`@if` (hotelList.length > 0) {  --> and its corresponding closing comment later)
that should be cleaned up; either remove these HTML comments entirely to keep
dashboard.html tidy, or restore them to active template logic by replacing the
comment wrappers with the actual framework directive (for example use
*ngIf="hotelList.length > 0" or the appropriate templating syntax your app uses)
so the conditional is functional; update only the commented block(s) around the
hotel list rendering to either delete them or convert them into the correct
conditional directive.
- Around line 12-16: You declared a local loop variable `index` (let index =
$index) but the template still uses `$index`; update the template to use the
`index` variable wherever `$index` is referenced (e.g., replace `{{$index + 1}}`
with `{{index + 1}}`) inside the for loop over `hotelList()` (track hotel.id) to
keep variable usage consistent with the declared `index` binding; ensure other
references inside the same loop do not use `$index` elsewhere.

In `@apps/hotelmanagement/src/app/dashboard/dashboard.ts`:
- Around line 20-22: The class defines unused properties numberOfBookings (a
signal) and dateOfLastBooking which aren't referenced in the template; either
remove these properties from apps/hotelmanagement/src/app/dashboard/dashboard.ts
if they're not needed, or annotate them with a clear TODO comment and a short
justification and/or wire them into the template or component logic (e.g.,
update methods that set numberOfBookings or dateOfLastBooking) to make their
usage explicit; update or remove imports related to signal if you delete
numberOfBookings to avoid unused-import warnings.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f6730c and c0896ba.

📒 Files selected for processing (4)
  • apps/hotelmanagement/src/app/dashboard/dashboard.css
  • apps/hotelmanagement/src/app/dashboard/dashboard.html
  • apps/hotelmanagement/src/app/dashboard/dashboard.ts
  • apps/hotelmanagement/src/styles.css

@tailwind base;
@tailwind components;
@tailwind utilities;

Copy link
Contributor

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

🏁 Script executed:

# First, check the actual content of styles.css
cat -n apps/hotelmanagement/src/styles.css

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 184


🏁 Script executed:

# Search for Tailwind utility class usage in the codebase
rg -n --type=html --type=ts '\bclass[=:].*\b(flex|grid|p-|m-|text-|bg-|w-|h-|border|rounded|shadow|hover:|focus:)' --max-count=50

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 987


🏁 Script executed:

# Also search for `@tailwind` and other Tailwind directives to confirm removal
rg '@tailwind|@layer|@apply' apps/hotelmanagement/

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 64


🏁 Script executed:

# Check for Tailwind configuration files
fd tailwind.config

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 121


🏁 Script executed:

# Check package.json for Tailwind dependency
rg 'tailwind' package.json

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 110


🏁 Script executed:

# Search for CSS definitions of 'rounded' and 'shadow'
rg '\.rounded|\.shadow' --type=css --type=scss

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 110


🏁 Script executed:

# Check the structure of styles in the project
find apps/hotelmanagement/src -name "*.css" -o -name "*.scss" | head -20

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 207


🏁 Script executed:

# Check tailwind.config.js to understand the configuration
cat -n apps/hotelmanagement/tailwind.config.js

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 538


🏁 Script executed:

# Check the app.css and dashboard.css files to see how styles are applied
cat -n apps/hotelmanagement/src/app/app.css

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 64


🏁 Script executed:

# Search for where Tailwind utilities are actually being used
rg 'class=' apps/hotelmanagement/src --type=ts --type=html -A 1 | head -50

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 2616


🏁 Script executed:

# Check if there's a styles preprocessing step or generated CSS
cat -n apps/hotelmanagement/src/app/dashboard/dashboard.css

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 212


🏁 Script executed:

# Check angular.json to see how styles are configured
rg 'styles' apps/hotelmanagement/angular.json -A 3 -B 1

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 155


🏁 Script executed:

# Search for CSS definitions of the classes used
rg '\.rounded|\.shadow|\.wrapper|\.container|\.button-pill' --type=css

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 183


🏁 Script executed:

# Check if there's any build-time CSS generation or if Tailwind is expected to be processed
rg 'postcss|tailwind' apps/hotelmanagement/ -g '*.json' -g '*.js' --type=json --type=javascript -A 2

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 116


🏁 Script executed:

# Search for CSS class definitions with a broader pattern
rg '^\.' --type=css apps/hotelmanagement/src/ -A 2

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 483


🏁 Script executed:

# Check if there's a project.json or other config files
ls -la apps/hotelmanagement/ | grep -E 'json|config'

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 606


🏁 Script executed:

# Check the main angular configuration
cat -n apps/hotelmanagement/project.json | head -50

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 1839


🏁 Script executed:

# Check if tailwind is being built/compiled in the project
rg 'tailwind' apps/hotelmanagement/project.json -A 5 -B 5

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 64


🏁 Script executed:

# Check vite.config to see if Tailwind is configured there
cat -n apps/hotelmanagement/vite.config.mts

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 1228


🏁 Script executed:

# Check if there's a postcss configuration
fd postcss.config

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 64


🏁 Script executed:

# Double-check nx-welcome.ts to see what classes are being used
rg 'class="rounded|class="shadow' apps/hotelmanagement/src/app/nx-welcome.ts

Repository: santoshyadavdev/live-stream-coderabbit

Length of output: 292


Restore Tailwind directives in styles.css or provide custom CSS definitions.

The @tailwind directives have been removed from styles.css, but components in the application still use Tailwind utility classes like rounded and shadow (e.g., in nx-welcome.ts). Without the @tailwind directives, these utilities will not be generated, breaking styling. Either restore the Tailwind directives in styles.css (@tailwind base; @tailwindcomponents;@tailwind utilities;) or replace them with custom CSS definitions for all used utility classes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/hotelmanagement/src/styles.css` at line 1, Restore the Tailwind
directives in styles.css or add equivalent custom CSS: reopen styles.css and
either re-add the three Tailwind directives "@tailwind base; `@tailwind`
components; `@tailwind` utilities;" so Tailwind generates utilities like rounded
and shadow used by components (e.g., nx-welcome.ts), or, if you prefer not to
use Tailwind, implement CSS rules in styles.css for every used utility class
(rounded, shadow, etc.) ensuring those class names match the utilities
referenced in components.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@santoshyadavdev santoshyadavdev merged commit 0b636ca into main Mar 4, 2026
0 of 2 checks passed
This was referenced Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant