Skip to content

feat(gateway): redesign frontend with premium SaaS aesthetic - #6

Merged
manishym merged 2 commits into
mainfrom
fix-frontend
Mar 19, 2026
Merged

feat(gateway): redesign frontend with premium SaaS aesthetic#6
manishym merged 2 commits into
mainfrom
fix-frontend

Conversation

@manishym

Copy link
Copy Markdown
Owner

Summary

  • Redesign frontend with premium SaaS aesthetic (glassmorphism, smooth animations)
  • Add logo display and favicon
  • Show delete key after URL shortening
  • Date picker for expiration with seconds conversion
  • Copy buttons with Copied feedback
  • Proper loading states for buttons

Changes

  • gateway/static/index.html - Complete UI redesign

Testing

  • Manual testing in browser - UI loads and functions correctly

- Add glassmorphism effects with backdrop blur
- Implement smooth animations and transitions
- Add logo display and favicon
- Show delete key after URL shortening
- Date picker for expiration with seconds conversion
- Copy buttons with Copied feedback
- Proper loading states for buttons
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly overhauls the user interface of the URL shortener, transforming its appearance and enhancing usability. The changes aim to provide a more modern, intuitive, and visually appealing experience for users, making common actions like shortening and deleting URLs more streamlined and interactive.

Highlights

  • UI Redesign: The frontend has been completely redesigned to feature a premium SaaS aesthetic, incorporating glassmorphism effects, smooth animations, and a refined color palette.
  • Enhanced User Experience: Improvements include a more prominent logo, a new favicon, clearer display of the delete key after URL shortening, and a date picker for expiration with accurate seconds conversion.
  • Interactive Elements: Copy buttons now provide 'Copied!' feedback, and all primary action buttons feature proper loading states with spinners to indicate ongoing operations.
  • Code Structure and Styling: The HTML structure was refactored with new semantic elements like <header> and <main>, and CSS variables were extensively updated to support the new visual design and transitions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a major and impressive redesign of the frontend, giving it a modern 'premium SaaS' aesthetic. The changes include a complete overhaul of the CSS, semantic improvements to the HTML structure, and new JavaScript functionality for better user feedback, such as loading states and copy animations. My review focuses on improving consistency and robustness in the new JavaScript helpers.

Comment thread gateway/static/index.html
Comment on lines +466 to 476
function setBtnLoading(btnId, isLoading, text) {
const btn = document.getElementById(btnId);
const span = btn.querySelector('span');
if (isLoading) {
btn.disabled = true;
btn.innerHTML = '<div class="spinner"></div><span>' + text + '</span>';
} else {
btn.disabled = false;
btn.innerHTML = '<span>' + text + '</span>';
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Using innerHTML can introduce security vulnerabilities (XSS) if the text parameter contains untrusted content. Although it's safe in the current context with hardcoded strings, it's best practice to avoid innerHTML for setting text. Using DOM manipulation methods like replaceChildren and textContent is more secure and robust. This change also removes an unused span variable.

Suggested change
function setBtnLoading(btnId, isLoading, text) {
const btn = document.getElementById(btnId);
const span = btn.querySelector('span');
if (isLoading) {
btn.disabled = true;
btn.innerHTML = '<div class="spinner"></div><span>' + text + '</span>';
} else {
btn.disabled = false;
btn.innerHTML = '<span>' + text + '</span>';
}
}
function setBtnLoading(btnId, isLoading, text) {
const btn = document.getElementById(btnId);
btn.disabled = isLoading;
const textSpan = document.createElement('span');
textSpan.textContent = text;
if (isLoading) {
const spinner = document.createElement('div');
spinner.className = 'spinner';
btn.replaceChildren(spinner, textSpan);
} else {
btn.replaceChildren(textSpan);
}
}

Comment thread gateway/static/index.html
Comment on lines 202 to +214
.btn-danger {
width: 100%;
background: transparent;
color: var(--danger);
border: 1px solid var(--danger);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.15); }
.result {
margin-top: 1rem;
font-family: inherit;
font-weight: 600;
font-size: 1rem;
padding: 1rem;
background: var(--bg);
border-radius: 12px;
border: 1px solid rgba(255, 69, 58, 0.2);
cursor: pointer;
transition: var(--transition);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To support a loading indicator with a spinner and text (similar to .btn-primary), the .btn-danger class should also use flexbox for layout. This will ensure consistent behavior for loading states across different button types and improve maintainability.

Suggested change
.btn-danger {
width: 100%;
background: transparent;
color: var(--danger);
border: 1px solid var(--danger);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.15); }
.result {
margin-top: 1rem;
font-family: inherit;
font-weight: 600;
font-size: 1rem;
padding: 1rem;
background: var(--bg);
border-radius: 12px;
border: 1px solid rgba(255, 69, 58, 0.2);
cursor: pointer;
transition: var(--transition);
}
.btn-danger {
width: 100%;
background: transparent;
color: var(--danger);
font-family: inherit;
font-weight: 600;
font-size: 1rem;
padding: 1rem;
border-radius: 12px;
border: 1px solid rgba(255, 69, 58, 0.2);
cursor: pointer;
transition: var(--transition);
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
}

Comment thread gateway/static/index.html Outdated
Comment on lines 566 to 588
const btn = document.getElementById('delete-btn');
const origText = btn.textContent;
btn.disabled = true;
btn.textContent = 'Deleting...';

try {
const res = await fetch(base + '/r/' + encodeURIComponent(path) + '?delete_key=' + encodeURIComponent(key), { method: 'DELETE' });
const data = await res.json();
if (!res.ok) {
showMessage('delete-message', data.detail || 'Delete failed', 'error');
return;
}
showMessage('delete-message', 'Deleted: ' + path + ' (cache purged via Redpanda)', 'success');
showMessage('delete-message', 'Link deleted successfully.', 'success');
document.getElementById('delete-path').value = '';
document.getElementById('delete-key').value = '';
lastShortPath = '';
lastDeleteKey = '';
} catch (e) {
showMessage('delete-message', 'Network error: ' + e.message, 'error');
} finally {
btn.disabled = false;
btn.textContent = origText;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The loading state for the delete button is implemented manually. For consistency and better maintainability, you should reuse the setBtnLoading helper function, which is already used for the 'Shorten' button.

Suggested change
const btn = document.getElementById('delete-btn');
const origText = btn.textContent;
btn.disabled = true;
btn.textContent = 'Deleting...';
try {
const res = await fetch(base + '/r/' + encodeURIComponent(path) + '?delete_key=' + encodeURIComponent(key), { method: 'DELETE' });
const data = await res.json();
if (!res.ok) {
showMessage('delete-message', data.detail || 'Delete failed', 'error');
return;
}
showMessage('delete-message', 'Deleted: ' + path + ' (cache purged via Redpanda)', 'success');
showMessage('delete-message', 'Link deleted successfully.', 'success');
document.getElementById('delete-path').value = '';
document.getElementById('delete-key').value = '';
lastShortPath = '';
lastDeleteKey = '';
} catch (e) {
showMessage('delete-message', 'Network error: ' + e.message, 'error');
} finally {
btn.disabled = false;
btn.textContent = origText;
}
setBtnLoading('delete-btn', true, 'Deleting...');
try {
const res = await fetch(base + '/r/' + encodeURIComponent(path) + '?delete_key=' + encodeURIComponent(key), { method: 'DELETE' });
const data = await res.json();
if (!res.ok) {
showMessage('delete-message', data.detail || 'Delete failed', 'error');
return;
}
showMessage('delete-message', 'Link deleted successfully.', 'success');
document.getElementById('delete-path').value = '';
document.getElementById('delete-key').value = '';
lastShortPath = '';
lastDeleteKey = '';
} catch (e) {
showMessage('delete-message', 'Network error: ' + e.message, 'error');
} finally {
setBtnLoading('delete-btn', false, 'Delete Link');
}

- Replace innerHTML with DOM manipulation in setBtnLoading (XSS prevention)
- Add flexbox to .btn-danger for spinner + text alignment
- Use setBtnLoading helper in delete button handler
@manishym

Copy link
Copy Markdown
Owner Author

All review comments addressed:

  1. [HIGH] ✅ Replaced with + in for XSS prevention
  2. [MEDIUM] ✅ Added flexbox to for consistent spinner + text alignment
  3. [MEDIUM] ✅ Delete button now uses helper for consistency

Changes pushed to branch.

@manishym
manishym merged commit ab1e04b into main Mar 19, 2026
3 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.

1 participant