Skip to content

Conversation

@Turtle-Hwan
Copy link
Owner

@Turtle-Hwan Turtle-Hwan commented Dec 9, 2025

Summary

  • 헤더에 실험실(Labs) 버튼 추가 (FlaskConical 아이콘)
  • 서버시계: 서버 시간 실시간 동기화 (RTT 보정, 밀리초 표시, URL 변경 가능)
  • QR 생성기: URL → QR 코드 변환, 중앙 로고 옵션 (없음/LinKU/커스텀 업로드)
  • 템플릿 동기화 로직 개선: 미동기화 템플릿 처리 수정

Changes

  • src/components/LabsDialog.tsx - 실험실 다이얼로그
  • src/components/Labs/ServerClockSection.tsx - 서버시계 UI
  • src/components/Labs/useServerTime.ts - 서버 시간 동기화 Hook
  • src/components/Labs/QRGeneratorSection.tsx - QR 생성기 UI
  • src/components/MainLayout.tsx - 헤더에 실험실 아이콘 추가
  • src/apis/templates.ts - 템플릿 동기화 조건 수정

Test plan

  • 헤더의 실험실 아이콘 클릭 시 다이얼로그 열림
  • 서버시계: 기본 URL(sugang.konkuk.ac.kr)로 시간 표시
  • 서버시계: URL 변경 후 해당 서버 시간 표시
  • QR 생성기: URL 입력 후 QR 코드 생성
  • QR 생성기: 로고 옵션 변경 시 QR 코드 재생성
  • QR 생성기: 다운로드 버튼 동작 확인

@Turtle-Hwan Turtle-Hwan self-assigned this Dec 9, 2025
@cloudflare-workers-and-pages
Copy link

Deploying linku with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7162451
Status: ✅  Deploy successful!
Preview URL: https://39870998.linku-6s6.pages.dev
Branch Preview URL: https://feat-template.linku-6s6.pages.dev

View logs

@gemini-code-assist
Copy link

Summary of Changes

Hello @Turtle-Hwan, 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 enhances the application by introducing a new 'Labs' section, which includes two valuable utilities: a QR code generator and a server clock. The QR code generator offers flexible options for creating scannable codes with custom branding, while the server clock provides critical timing information for external services. Additionally, a subtle but important refinement to the template synchronization mechanism ensures more reliable data handling for user-created and cloned templates.

Highlights

  • New 'Labs' Section Introduced: A new 'Labs' section has been added to the application, accessible via a new icon in the header, to house experimental utility features.
  • QR Code Generator: A new QR Code Generator utility is available in the Labs section, allowing users to convert URLs into QR codes with options to embed a custom or default LinKU logo.
  • Server Clock Utility: A Server Clock utility has been implemented, providing real-time server time and network latency (RTT) for a specified URL, useful for precise timing needs.
  • Template Synchronization Logic Improved: The template synchronization API has been updated to correctly identify and create new templates on the server if their synchronization status is not 'synced' or if they are cloned, ensuring robust handling of unsynced templates.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@Turtle-Hwan Turtle-Hwan changed the title Feat/template feat: 실험실(Labs) 기능 추가 - 서버시계 및 QR 생성기 Dec 9, 2025
Copy link

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

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 new "Labs" section with two experimental features: a QR Code Generator and a Server Clock. It includes new components for these features, along with necessary dependency updates in package.json and pnpm-lock.yaml. Additionally, a minor but important logic improvement was made in src/apis/templates.ts to correctly handle template syncing based on their syncStatus and cloned properties, ensuring that templates not explicitly synced or those that are cloned are always created as new entries on the server. The new components are well-structured and demonstrate good practices for state management, UI interaction, and network requests.

// Templates not synced with server (syncStatus undefined or 'local') should use POST
// Cloned templates should also create a new template (to get a new ID)
const shouldCreateNew = template.syncStatus === 'local' || template.cloned === true;
const shouldCreateNew = template.syncStatus !== 'synced' || template.cloned === true;

Choose a reason for hiding this comment

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

medium

The change from template.syncStatus === 'local' to template.syncStatus !== 'synced' is a good improvement. It makes the logic more robust by ensuring that any template not explicitly marked as 'synced' (including undefined or other statuses) will be treated as a new creation, which is safer and more aligned with the intent of creating new entries for local or cloned templates.

Comment on lines +72 to +74
} catch {
console.warn("로고 로드 실패, 로고 없이 생성");
}

Choose a reason for hiding this comment

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

medium

While console.warn is used here, it might be beneficial to provide user-facing feedback if the logo fails to load. This would improve the user experience by clearly indicating why the QR code might not have a logo as expected, rather than just logging a warning to the console.

refresh: () => Promise<void>;
}

const SYNC_INTERVAL = 1000; // 1초마다 재동기화

Choose a reason for hiding this comment

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

medium

A SYNC_INTERVAL of 1000ms (1 second) for re-syncing the server time offset might be quite aggressive. While requestAnimationFrame handles the visual update, frequent network requests (even HEAD requests) can consume resources and potentially hit rate limits on some servers. Consider increasing this interval to something like 5-10 seconds to reduce network overhead, as the offset doesn't typically change rapidly enough to warrant 1-second updates.

@Turtle-Hwan Turtle-Hwan merged commit 22bae59 into main Dec 9, 2025
2 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