Skip to content

Full rewrite that works#2

Merged
Ashex merged 28 commits intomainfrom
copilot/yabbering-butterfly
Mar 12, 2026
Merged

Full rewrite that works#2
Ashex merged 28 commits intomainfrom
copilot/yabbering-butterfly

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

Two issues are addressed: the CI build was failing due to an unreachable i2c-tools submodule, and the README described a Makefile and make commands that don't exist in the repo.

Build fix

  • Removed i2c-tools from GIT_SUBMODULES in the ExternalProject_Add(fbink_ext) call — git.kernel.org was returning HTTP 502, aborting the entire FBInk clone step. This submodule is only needed for I²C bus access (battery/temp sensors), unused by the KOBO=1 IMAGE=1 OPENTYPE=1 build flags.

README corrections

  • Replaced the "Convenience targets" section (referenced a non-existent Makefile with make build/clean/rebuild) with a "Docker build" section pointing to ./docker-build.sh
  • Updated native and cross-compile sections to use -GNinja + ninja, consistent with docker-build.sh and CI
  • Fixed make kobo-packageninja kobo-package (the target is defined in CMake; the build uses Ninja)
Original prompt

Implement the plan outlined in docs/implementation-plan.md

[Chronological Review: The conversation is very brief. The user issued a single command "ls" to list directory contents. The agent executed a bash command to list files, and the results were returned showing a project directory structure.]

[Intent Mapping: The user's only explicit request was "ls" - listing the current directory contents. No further goals have been stated yet.]

[Technical Inventory: Based on the directory listing, this appears to be a C/C++ project (CMakeLists.txt, cmake/, src/) with Docker cross-compilation support (Dockerfile.cross, docker-build.sh) targeting Kobo e-readers (build-kobo/, toolchain/). It includes emoji font files and an update mechanism.]

[Code Archaeology: No files have been opened or modified. Only directory listing was performed.]

[Progress Assessment: The user has only listed the directory. No tasks have been assigned or started.]

[Context Validation: Minimal context exists - just a directory listing of what appears to be a Kobo e-reader project.]

[Recent Commands Analysis:

  • Command: bash "ls" - List files in current directory
  • Result: Directory listing showing project files including build-kobo, cmake, CMakeLists.txt, docker-build.sh, Dockerfile.cross, docs, EmojiOneColor.otf, Makefile, "Noto Emoji Light 300.ttf", README.md, run.sh, src, toolchain, update, update.tar
  • Pre-summarization state: Agent had just returned the directory listing to the user]
1. Conversation Overview: - Primary Objectives: User issued an "ls" command to list the current working directory. No further objectives have been stated. - Session Context: This is the very beginning of a conversation. The user has only requested a directory listing. - User Intent Evolution: No evolution yet — single command issued.
  1. Technical Foundation:

    • Project Type: Appears to be a C/C++ project targeting Kobo e-readers (cross-compilation setup)
    • Build System: CMake (CMakeLists.txt, cmake/ directory) and Make (Makefile)
    • Docker: Cross-compilation via Docker (Dockerfile.cross, docker-build.sh)
    • Target Platform: Kobo e-reader (build-kobo/ directory, toolchain/ directory)
    • Assets: Emoji font files (EmojiOneColor.otf, "Noto Emoji Light 300.ttf")
    • SQL Tables: No tables exist yet; default tables (todos, todo_deps) will be created on first use.
  2. Codebase Status:

    • Directory Structure (top-level):
      • build-kobo/ - Build output directory for Kobo target
      • cmake/ - CMake configuration files
      • CMakeLists.txt - Main CMake build file
      • docker-build.sh - Docker build script
      • Dockerfile.cross - Dockerfile for cross-compilation
      • docs/ - Documentation directory
      • EmojiOneColor.otf - Emoji font file
      • Makefile - Make build file
      • Noto Emoji Light 300.ttf - Noto emoji font file
      • README.md - Project readme
      • run.sh - Run script
      • src/ - Source code directory
      • toolchain/ - Cross-compilation toolchain
      • update/ - Update-related files
      • update.tar - Update archive
    • No files have been opened, read, or modified yet.
  3. Problem Resolution:

    • No issues encountered yet.
  4. Progress Tracking:

    • Completed Tasks: Directory listing returned successfully.
    • No other tasks assigned or in progress.
  5. Active Work State:

    • Current Focus: User has just listed the directory; awaiting further instructions.
    • Recent Context: Single exchange — user said "ls", agent executed bash ls command and returned results.
    • Working Code: None yet.
    • Immediate Context: Awaiting user's next command or request.
  6. Recent Operations:

    • Last Agent Commands: report_intent (logged intent "Listing directory contents") and bash (executed ls command)
    • Tool Results Summary: Directory listing returned 15 items: build-kobo, cmake, CMakeLists.txt, docker-build.sh, Dockerfile.cross, docs, EmojiOneColor.otf, Makefile, Noto Emoji Light 300.ttf, README.md, run.sh, src, toolchain, update, update.tar — exited with code 0.
    • Pre-Summary State: Agent had just displayed the directory listing to the user.
    • Operation Context: User's initial exploration of the project directory.
  7. Continuation Plan:

    • No pending tasks have been defined by the user.
    • Next Action: Await user's next instruction — they may want to explore specific files (e.g., README.md, src/, CMakeLists.txt), build the project, or make modifications.

Created from Copilot CLI via the copilot delegate command.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 4 commits March 11, 2026 09:50
Phase 0 - Fix Coordinate Misalignment:
- fb.h/fb.cpp: Remove FB_WIDTH/FB_HEIGHT defines; add font_w/font_h
  to fb_t populated from fbink_get_state(). Convert all color constants
  and function signatures from RGB565 uint16_t to 8-bit grayscale uint8_t.
  Remove rgb565_to_gray(). Add fb_mark_dirty/fb_flush/fb_wait_for_complete/
  fb_refresh_gc16_partial for deferred refresh support.
- font.h/font.cpp: Remove FONT_CHAR_W/FONT_CHAR_H defines. Add
  font_cell_w()/font_cell_h() getters backed by s_font_w/s_font_h
  initialized from fb->font_w/fb->font_h. Update all color params
  uint16_t -> uint8_t. Remove rgb565_to_gray().
- input.h/input.cpp: Change input_open(void) -> input_open(int fb_w, int fb_h).
  Add swipe and TOUCH_LONG_PRESS types to touch_type_t enum. Store fb_w/fb_h
  in input_ctx; use them in should_swap_axes and map_touch_point. Add
  long-press detection (LONG_PRESS_MS=500ms hold with minimal movement).
- View files: Replace all FB_WIDTH/FB_HEIGHT/FONT_CHAR_H uses with runtime
  values from state->fb.width/height and font_cell_h().

Phase 1 - Scaffolding:
- Delete compose_view.h/cpp and login_view.h/cpp.
- Add auth_view.h/cpp: static instructions splash showing how to create
  login.txt, with an Exit button only.
- views.h: Replace VIEW_LOGIN with VIEW_AUTH_WAIT; remove VIEW_COMPOSE.
- app.h: Remove compose_reply_*/compose_root_* fields. Replace images_enabled
  with profile_images_enabled (default true) and embed_images_enabled
  (default false). Default view is now VIEW_AUTH_WAIT.
- app.cpp: Update includes, view dispatch, image-cache redraw (direct draw
  calls instead of app_switch_view). app_ensure_auth now switches to
  VIEW_AUTH_WAIT on failure. Login flow uses auth_view_set_error().
- feed_view.cpp: Remove '+Post' button and compose navigation. Use
  profile_images_enabled/embed_images_enabled separately.
- thread_view.cpp: Remove Reply button from topbar; remove all compose nav.
- settings_view.cpp: Two image toggles (Profile Images, Embed Images).
  Logout navigates to VIEW_AUTH_WAIT. Runtime layout from fb->width/height.
- paths.h/cpp: Add skeets_login_txt_path().
- config.cpp: Bump CONFIG_MAX_ENTRIES 64 -> 128.
- CMakeLists.txt: Replace login_view.cpp/compose_view.cpp with auth_view.cpp.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ggles

Phase 2 – Credential file login:
- Replace app_password-in-config flow with login.txt (handle, password,
  optional pds_url/appview key=value format). On startup: try saved
  session tokens first; if none, look for login.txt, parse it, call
  createSession, save tokens, then delete the file. On error delete
  login.txt and display message on auth screen.
- Add appview_url field to Bsky::Session and persist it in config.ini.
- Remove createPost()/PostCreatedCb from AtprotoClient (unused).

Phase 3 – Like & repost interaction:
- Add viewer_like, viewer_repost, reposted_by fields to Bsky::Post.
- Extract mViewer->mLike/mRepost in convertPostView().
- Extract FeedViewPostReasonType::REASON_REPOST in getTimeline() loop.
- Add likePost, unlikePost, repostPost, unrepostPost to AtprotoClient
  using ATProto::PostMaster (synchronous QEventLoop pattern).
- feed_view: stats line shows ♥/♡ and ⟳/⟲ based on viewer state;
  repost attribution line (⟳ Reposted by @handle) above author line;
  tapping like/repost zones does optimistic update + async API call
  with rollback on error; taps outside the zone navigate to thread.
- thread_view: stats line reflects viewer like state (♥/♡); tapping
  the like zone on the root post performs like/unlike with rollback.

Phase 3.5 – Dual image toggles:
- thread_view: wrap avatar image_cache_lookup with profile_images bool
  (new parameter on draw_thread_post, sourced from
  state->profile_images_enabled). feed_view already complete.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sk eviction, README update

- Phase 4a: swipe detection (SWIPE_MIN_DIST=80px, SWIPE_MIN_VEL=0.2px/ms) in
  BTN_TOUCH up handler; stationary long-press via poll() timeout path;
  reset last_emit_type=TOUCH_NONE on TOUCH_DOWN
- Phase 4b: TOUCH_SWIPE_UP/DOWN handling in feed_view and thread_view
  (half-screen scroll step per swipe)
- B4: JWT refresh tracking — session_last_refresh field in app_state;
  proactive resumeSession when token >85 minutes old in app_ensure_auth()
- B5: recursive flattenReplies() in atproto_client replaces single-level loop
- B7: image_evict_disk_cache() LRU evicts oldest disk cache files on startup
  (50 MB cap); called from app_init()
- B8: in-memory image cache upgraded to LRU — last_accessed timestamp on
  every entry, evict_if_full() picks oldest non-loading entry
- B9: font_draw_wrapped_fallback() bounds-check before memcpy to prevent
  char line[512] overflow on very long words
- B16: hash-collision guard in image_cache_lookup() — url stored per entry,
  evict and re-fetch on mismatch
- Phase 6: README Getting Started / Authentication section documenting
  login.txt flow and appview field; removed compose/reply references

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e constants, cleaner snprintf check

Co-authored-by: Ashex <4143436+Ashex@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement plan outlined in implementation document sKeets v2: implement full rewrite plan (Phases 0–6) Mar 11, 2026
Co-authored-by: Ashex <4143436+Ashex@users.noreply.github.com>
Copilot AI changed the title sKeets v2: implement full rewrite plan (Phases 0–6) fix: remove i2c-tools submodule from fbink ExternalProject to unblock CI Mar 11, 2026
… ninja

Co-authored-by: Ashex <4143436+Ashex@users.noreply.github.com>
Copilot AI changed the title fix: remove i2c-tools submodule from fbink ExternalProject to unblock CI Fix CI build failure and update README build instructions Mar 11, 2026
…obo static build actually uses, including i2c-tools and libevdev. That removed the failing libi2c.built step.

sKeets/src/util/image.h now includes the standard header needed for size_t, which fixed the image cache compile break.
sKeets/src/atproto/atproto_client.cpp was updated to match the pinned libatproto API: feed reasons are now handled as an optional variant, and like/repost calls now pass the required viaUri and viaCid arguments.
Copilot stopped work on behalf of Ashex due to an error March 11, 2026 10:31
@Ashex Ashex changed the title Fix CI build failure and update README build instructions Full rewrite that works Mar 12, 2026
@Ashex Ashex marked this pull request as ready for review March 12, 2026 21:49
@Ashex Ashex merged commit 3de8263 into main Mar 12, 2026
1 check passed
@Ashex Ashex deleted the copilot/yabbering-butterfly branch March 12, 2026 21:50
Ashex pushed a commit that referenced this pull request Mar 12, 2026
* Heavy rewrite

* Promote rewrite to main codebase

* Finish removing legacy code and restructure

* Pretty buttons

* Feed with cache cleanup

* Fix packaging for github

---------
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